lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 14 Dec 2011 19:10:19 -0800 (PST)
From:	David Rientjes <rientjes@...gle.com>
To:	Pekka Enberg <penberg@...nel.org>
cc:	Christoph Lameter <cl@...ux.com>,
	Eric Dumazet <eric.dumazet@...il.com>,
	linux-kernel@...r.kernel.org
Subject: Re: Switch per cpu partial page support off for debugging

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@...ux.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.)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ