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]
Message-ID: <alpine.DEB.2.00.1108201059060.5267@router.home>
Date:	Sat, 20 Aug 2011 11:00:37 -0500 (CDT)
From:	Christoph Lameter <cl@...ux.com>
To:	Pekka Enberg <penberg@...nel.org>
cc:	linux-kernel@...r.kernel.org, rientjes@...gle.com
Subject: Re: [slub p4 6/7] slub: per cpu cache for partial pages

On Sat, 20 Aug 2011, Pekka Enberg wrote:

> > @@ -2919,7 +3071,34 @@ static int kmem_cache_open(struct kmem_c
> >  	 * The larger the object size is, the more pages we want on the
> > partial
> >  	 * list to avoid pounding the page allocator excessively.
> >  	 */
> > -	set_min_partial(s, ilog2(s->size));
> > +	set_min_partial(s, ilog2(s->size) / 2);
>
> Why do we want to make minimum size smaller?

Because we are getting additional partial pages cached for each processor.

> > +	 */
> > +	if (s->size >= PAGE_SIZE)
> > +		s->cpu_partial = 2;
> > +	else if (s->size >= 1024)
> > +		s->cpu_partial = 6;
> > +	else if (s->size >= 256)
> > +		s->cpu_partial = 13;
> > +	else
> > +		s->cpu_partial = 30;
>
> How did you come up with these limits?

These are the per cpu queue limits of SLAB.

> > +		struct {		/* slub per cpu partial pages */
> > +			struct page *next;	/* Next partial slab */
> > +#ifdef CONFIG_64BIT
> > +			int pages;	/* Nr of partial slabs left */
> > +			int pobjects;	/* Approximate # of objects */
> > +#else
> > +			short int pages;
> > +			short int pobjects;
> > +#endif
> > +		};
> > +	};
>
> Why are the sizes different on 32-bit and 64-bit? Does this change 'struct
> page' size?

int == long /2 under 64 bit
int == long on 32 bit.

without the ifdef the page struct could get bigger for 32 bit.

--
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