From: David Rientjes <rientjes@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>, linux-kernel@vger.kernel.org
Subject: Re: [patch] vmscan: print shrink_slab symbol name on negative shrinker objects
Date: Fri, 20 Mar 2009 03:15:41 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.00.0903200314280.10035@chino.kir.corp.google.com> (raw)
In-Reply-To: <20090319163314.527687fc.akpm@linux-foundation.org>
On Thu, 19 Mar 2009, Andrew Morton wrote:
> > diff --git a/mm/vmscan.c b/mm/vmscan.c
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -40,6 +40,7 @@
> > #include <linux/memcontrol.h>
> > #include <linux/delayacct.h>
> > #include <linux/sysctl.h>
> > +#include <linux/kallsyms.h>
> >
> > #include <asm/tlbflush.h>
> > #include <asm/div64.h>
> > @@ -214,8 +215,12 @@ unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
> > do_div(delta, lru_pages + 1);
> > shrinker->nr += delta;
> > if (shrinker->nr < 0) {
> > - printk(KERN_ERR "%s: nr=%ld\n",
> > - __func__, shrinker->nr);
> > + char symname[KSYM_NAME_LEN];
> > +
> > + if (lookup_symbol_name((unsigned long)shrinker->shrink,
> > + symname) > 0)
> > + printk(KERN_ERR "shrink_slab: %s nr=%ld\n",
> > + symname, shrinker->nr);
> > shrinker->nr = max_pass;
> > }
>
> Can we use the new printk("%pF", ...) here?
>
Cool, that's super convenient.
vmscan: print shrink_slab symbol name on negative shrinker objects
When a shrinker has a negative number of objects to delete, the symbol
name of the shrinker should be printed, not shrink_slab. This also makes
the error message slightly more informative.
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David Rientjes <rientjes@google.com>
---
mm/vmscan.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -214,8 +214,9 @@ unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
do_div(delta, lru_pages + 1);
shrinker->nr += delta;
if (shrinker->nr < 0) {
- printk(KERN_ERR "%s: nr=%ld\n",
- __func__, shrinker->nr);
+ printk(KERN_ERR "shrink_slab: %pF negative objects to "
+ "delete nr=%ld\n",
+ shrinker->shrink, shrinker->nr);
shrinker->nr = max_pass;
}
next prev parent reply other threads:[~2009-03-20 10:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-19 23:09 David Rientjes
2009-03-19 23:33 ` Andrew Morton
2009-03-20 10:15 ` David Rientjes [this message]
2009-03-20 8:27 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.00.0903200314280.10035@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®