mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Pekka Enberg <penberg@kernel.org>
Cc: Christoph Lameter <cl@linux.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Switch per cpu partial page support off for debugging
Date: Wed, 14 Dec 2011 19:10:19 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1112141908410.27595@chino.kir.corp.google.com> (raw)
In-Reply-To: <alpine.LFD.2.02.1112120915030.2555@tux.localdomain>

On Mon, 12 Dec 2011, Pekka Enberg wrote:

> > Eric saw an issue with accounting of slabs during validation. Its not
> > possible to determine accurately how many per cpu partial slabs exist at
> > any time so this switches off per cpu partial pages during debug.
> > 
> > Subject: Switch per cpu partial page support off for debugging
> > 
> > Otherwise we have accounting issues.
> > 
> > Signed-off-by: Christoph Lameter <cl@linux.com>
> > 
> > 
> > ---
> > mm/slub.c |    4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > Index: linux-2.6/mm/slub.c
> > ===================================================================
> > --- linux-2.6.orig/mm/slub.c	2011-11-22 11:57:21.000000000 -0600
> > +++ linux-2.6/mm/slub.c	2011-11-22 11:57:55.000000000 -0600
> > @@ -3027,7 +3027,9 @@ static int kmem_cache_open(struct kmem_c
> > 	 *    per node list when we run out of per cpu objects. We only fetch
> > 50%
> > 	 *    to keep some capacity around for frees.
> > 	 */
> > -	if (s->size >= PAGE_SIZE)
> > +	if (kmem_cache_debug(s))
> > +		s->cpu_partial = 0;
> > +	else if (s->size >= PAGE_SIZE)
> > 		s->cpu_partial = 2;
> > 	else if (s->size >= 1024)
> > 		s->cpu_partial = 6;

I think this deserves a comment since it's not clear why it's being done 
neither in the code or by the changelog.  Also, you'd want a check for 
kmem_cache_debug() when storing to /sys/kernel/slab/cache/cpu_partial as 
well, otherwise this could easily be broken from userspace again.  (It 
also seems like Documentation/ABI/testing/sysfs-kernel-slab got left out 
of an update when that was added, too.)

  parent reply	other threads:[~2011-12-15  3:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.DEB.2.00.1111230923260.16544@router.home>
2011-12-12  7:16 ` Pekka Enberg
2011-12-12  7:23   ` Eric Dumazet
2011-12-15  3:10   ` David Rientjes [this message]
2012-01-06 17:37     ` David Rientjes
2012-01-08 10:54       ` Pekka Enberg
2012-01-09 14:56         ` Christoph Lameter
2012-01-09 21:19           ` [patch slab/urgent] disallow changing cpu_partial from userspace for debug caches David Rientjes
2012-01-10 16:49             ` Christoph Lameter

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.1112141908410.27595@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=cl@linux.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@kernel.org \
    /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®