linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/memcontrol: add tips for kmem.slabinfo
@ 2023-08-08  2:22 xiongwei.song
  2023-08-08  2:47 ` Matthew Wilcox
  2023-08-08  3:59 ` Roman Gushchin
  0 siblings, 2 replies; 7+ messages in thread
From: xiongwei.song @ 2023-08-08  2:22 UTC (permalink / raw)
  To: hannes, mhocko, roman.gushchin, shakeelb, muchun.song, akpm
  Cc: cgroups, linux-mm, linux-kernel

From: Xiongwei Song <xiongwei.song@windriver.com>

No any output from kmem.slabinfo, which is not friendly. Adding
tips for it.

Signed-off-by: Xiongwei Song <xiongwei.song@windriver.com>
---
 mm/memcontrol.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index e8ca4bdcb03c..58d3bd93890b 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5002,10 +5002,8 @@ static ssize_t memcg_write_event_control(struct kernfs_open_file *of,
 #if defined(CONFIG_MEMCG_KMEM) && (defined(CONFIG_SLAB) || defined(CONFIG_SLUB_DEBUG))
 static int mem_cgroup_slab_show(struct seq_file *m, void *p)
 {
-	/*
-	 * Deprecated.
-	 * Please, take a look at tools/cgroup/memcg_slabinfo.py .
-	 */
+	seq_puts(m, "This file is deprecated.\n"
+		"Please use tools/cgroup/memcg_slabinfo.py, which is in kernel source.\n");
 	return 0;
 }
 #endif
-- 
2.37.3



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mm/memcontrol: add tips for kmem.slabinfo
  2023-08-08  2:22 [PATCH] mm/memcontrol: add tips for kmem.slabinfo xiongwei.song
@ 2023-08-08  2:47 ` Matthew Wilcox
  2023-08-08 12:10   ` Xiongwei Song
  2023-08-08  3:59 ` Roman Gushchin
  1 sibling, 1 reply; 7+ messages in thread
From: Matthew Wilcox @ 2023-08-08  2:47 UTC (permalink / raw)
  To: xiongwei.song
  Cc: hannes, mhocko, roman.gushchin, shakeelb, muchun.song, akpm,
	cgroups, linux-mm, linux-kernel

On Tue, Aug 08, 2023 at 10:22:29AM +0800, xiongwei.song@windriver.com wrote:
> From: Xiongwei Song <xiongwei.song@windriver.com>
> 
> No any output from kmem.slabinfo, which is not friendly. Adding
> tips for it.

What happens to tools which look in this file?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mm/memcontrol: add tips for kmem.slabinfo
  2023-08-08  2:22 [PATCH] mm/memcontrol: add tips for kmem.slabinfo xiongwei.song
  2023-08-08  2:47 ` Matthew Wilcox
@ 2023-08-08  3:59 ` Roman Gushchin
  2023-08-08  7:29   ` Michal Hocko
  2023-08-08 12:08   ` Xiongwei Song
  1 sibling, 2 replies; 7+ messages in thread
From: Roman Gushchin @ 2023-08-08  3:59 UTC (permalink / raw)
  To: xiongwei.song
  Cc: hannes, mhocko, shakeelb, muchun.song, akpm, cgroups, linux-mm,
	linux-kernel

On Tue, Aug 08, 2023 at 10:22:29AM +0800, xiongwei.song@windriver.com wrote:
> From: Xiongwei Song <xiongwei.song@windriver.com>
> 
> No any output from kmem.slabinfo, which is not friendly. Adding
> tips for it.
> 
> Signed-off-by: Xiongwei Song <xiongwei.song@windriver.com>
> ---
>  mm/memcontrol.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index e8ca4bdcb03c..58d3bd93890b 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -5002,10 +5002,8 @@ static ssize_t memcg_write_event_control(struct kernfs_open_file *of,
>  #if defined(CONFIG_MEMCG_KMEM) && (defined(CONFIG_SLAB) || defined(CONFIG_SLUB_DEBUG))
>  static int mem_cgroup_slab_show(struct seq_file *m, void *p)
>  {
> -	/*
> -	 * Deprecated.
> -	 * Please, take a look at tools/cgroup/memcg_slabinfo.py .
> -	 */
> +	seq_puts(m, "This file is deprecated.\n"
> +		"Please use tools/cgroup/memcg_slabinfo.py, which is in kernel source.\n");

It'll break the ABI.
The only possible option here is to use WARN_ON_ONCE(), which will print once to dmesg.
But honestly I'm not sure we need it.

Thanks!


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mm/memcontrol: add tips for kmem.slabinfo
  2023-08-08  3:59 ` Roman Gushchin
@ 2023-08-08  7:29   ` Michal Hocko
  2023-08-08 12:08     ` Xiongwei Song
  2023-08-08 12:08   ` Xiongwei Song
  1 sibling, 1 reply; 7+ messages in thread
From: Michal Hocko @ 2023-08-08  7:29 UTC (permalink / raw)
  To: Roman Gushchin
  Cc: xiongwei.song, hannes, shakeelb, muchun.song, akpm, cgroups,
	linux-mm, linux-kernel

On Mon 07-08-23 20:59:59, Roman Gushchin wrote:
> On Tue, Aug 08, 2023 at 10:22:29AM +0800, xiongwei.song@windriver.com wrote:
> > From: Xiongwei Song <xiongwei.song@windriver.com>
> > 
> > No any output from kmem.slabinfo, which is not friendly. Adding
> > tips for it.
> > 
> > Signed-off-by: Xiongwei Song <xiongwei.song@windriver.com>
> > ---
> >  mm/memcontrol.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index e8ca4bdcb03c..58d3bd93890b 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -5002,10 +5002,8 @@ static ssize_t memcg_write_event_control(struct kernfs_open_file *of,
> >  #if defined(CONFIG_MEMCG_KMEM) && (defined(CONFIG_SLAB) || defined(CONFIG_SLUB_DEBUG))
> >  static int mem_cgroup_slab_show(struct seq_file *m, void *p)
> >  {
> > -	/*
> > -	 * Deprecated.
> > -	 * Please, take a look at tools/cgroup/memcg_slabinfo.py .
> > -	 */
> > +	seq_puts(m, "This file is deprecated.\n"
> > +		"Please use tools/cgroup/memcg_slabinfo.py, which is in kernel source.\n");
> 
> It'll break the ABI.

Agreed

> The only possible option here is to use WARN_ON_ONCE(), which will print once to dmesg.
> But honestly I'm not sure we need it.

There are systems with panic_on_warn configured. I do not think we want
those to go down just becasue some random tool tries to read this file.
-- 
Michal Hocko
SUSE Labs


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mm/memcontrol: add tips for kmem.slabinfo
  2023-08-08  7:29   ` Michal Hocko
@ 2023-08-08 12:08     ` Xiongwei Song
  0 siblings, 0 replies; 7+ messages in thread
From: Xiongwei Song @ 2023-08-08 12:08 UTC (permalink / raw)
  To: Michal Hocko
  Cc: Roman Gushchin, xiongwei.song, hannes, shakeelb, muchun.song,
	akpm, cgroups, linux-mm, linux-kernel

On Tue, Aug 8, 2023 at 3:30 PM Michal Hocko <mhocko@suse.com> wrote:
>
> On Mon 07-08-23 20:59:59, Roman Gushchin wrote:
> > On Tue, Aug 08, 2023 at 10:22:29AM +0800, xiongwei.song@windriver.com wrote:
> > > From: Xiongwei Song <xiongwei.song@windriver.com>
> > >
> > > No any output from kmem.slabinfo, which is not friendly. Adding
> > > tips for it.
> > >
> > > Signed-off-by: Xiongwei Song <xiongwei.song@windriver.com>
> > > ---
> > >  mm/memcontrol.c | 6 ++----
> > >  1 file changed, 2 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > > index e8ca4bdcb03c..58d3bd93890b 100644
> > > --- a/mm/memcontrol.c
> > > +++ b/mm/memcontrol.c
> > > @@ -5002,10 +5002,8 @@ static ssize_t memcg_write_event_control(struct kernfs_open_file *of,
> > >  #if defined(CONFIG_MEMCG_KMEM) && (defined(CONFIG_SLAB) || defined(CONFIG_SLUB_DEBUG))
> > >  static int mem_cgroup_slab_show(struct seq_file *m, void *p)
> > >  {
> > > -   /*
> > > -    * Deprecated.
> > > -    * Please, take a look at tools/cgroup/memcg_slabinfo.py .
> > > -    */
> > > +   seq_puts(m, "This file is deprecated.\n"
> > > +           "Please use tools/cgroup/memcg_slabinfo.py, which is in kernel source.\n");
> >
> > It'll break the ABI.
>
> Agreed
>
> > The only possible option here is to use WARN_ON_ONCE(), which will print once to dmesg.
> > But honestly I'm not sure we need it.
>
> There are systems with panic_on_warn configured. I do not think we want
> those to go down just becasue some random tool tries to read this file.

Thank you for the comments.

> --
> Michal Hocko
> SUSE Labs
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mm/memcontrol: add tips for kmem.slabinfo
  2023-08-08  3:59 ` Roman Gushchin
  2023-08-08  7:29   ` Michal Hocko
@ 2023-08-08 12:08   ` Xiongwei Song
  1 sibling, 0 replies; 7+ messages in thread
From: Xiongwei Song @ 2023-08-08 12:08 UTC (permalink / raw)
  To: Roman Gushchin
  Cc: xiongwei.song, hannes, mhocko, shakeelb, muchun.song, akpm,
	cgroups, linux-mm, linux-kernel

On Tue, Aug 8, 2023 at 12:00 PM Roman Gushchin <roman.gushchin@linux.dev> wrote:
>
> On Tue, Aug 08, 2023 at 10:22:29AM +0800, xiongwei.song@windriver.com wrote:
> > From: Xiongwei Song <xiongwei.song@windriver.com>
> >
> > No any output from kmem.slabinfo, which is not friendly. Adding
> > tips for it.
> >
> > Signed-off-by: Xiongwei Song <xiongwei.song@windriver.com>
> > ---
> >  mm/memcontrol.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index e8ca4bdcb03c..58d3bd93890b 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -5002,10 +5002,8 @@ static ssize_t memcg_write_event_control(struct kernfs_open_file *of,
> >  #if defined(CONFIG_MEMCG_KMEM) && (defined(CONFIG_SLAB) || defined(CONFIG_SLUB_DEBUG))
> >  static int mem_cgroup_slab_show(struct seq_file *m, void *p)
> >  {
> > -     /*
> > -      * Deprecated.
> > -      * Please, take a look at tools/cgroup/memcg_slabinfo.py .
> > -      */
> > +     seq_puts(m, "This file is deprecated.\n"
> > +             "Please use tools/cgroup/memcg_slabinfo.py, which is in kernel source.\n");
>
> It'll break the ABI.
> The only possible option here is to use WARN_ON_ONCE(), which will print once to dmesg.
> But honestly I'm not sure we need it.

Ok, thanks for the comments.

>
> Thanks!
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mm/memcontrol: add tips for kmem.slabinfo
  2023-08-08  2:47 ` Matthew Wilcox
@ 2023-08-08 12:10   ` Xiongwei Song
  0 siblings, 0 replies; 7+ messages in thread
From: Xiongwei Song @ 2023-08-08 12:10 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: xiongwei.song, hannes, mhocko, roman.gushchin, shakeelb,
	muchun.song, akpm, cgroups, linux-mm, linux-kernel

On Tue, Aug 8, 2023 at 10:47 AM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Tue, Aug 08, 2023 at 10:22:29AM +0800, xiongwei.song@windriver.com wrote:
> > From: Xiongwei Song <xiongwei.song@windriver.com>
> >
> > No any output from kmem.slabinfo, which is not friendly. Adding
> > tips for it.
>
> What happens to tools which look in this file?

I thought the mem_cgroup_slab_show() function should be removed or
provide some useful info.

Thanks.
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-08 12:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-08  2:22 [PATCH] mm/memcontrol: add tips for kmem.slabinfo xiongwei.song
2023-08-08  2:47 ` Matthew Wilcox
2023-08-08 12:10   ` Xiongwei Song
2023-08-08  3:59 ` Roman Gushchin
2023-08-08  7:29   ` Michal Hocko
2023-08-08 12:08     ` Xiongwei Song
2023-08-08 12:08   ` Xiongwei Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox