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: <Pine.LNX.4.64.0802061059110.25173@schroedinger.engr.sgi.com>
Date:	Wed, 6 Feb 2008 11:01:19 -0800 (PST)
From:	Christoph Lameter <clameter@....com>
To:	Andrew Morton <akpm@...ux-foundation.org>
cc:	Pekka Enberg <penberg@...helsinki.fi>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: SLUB: Support for statistics to help analyze allocator behavior

On Wed, 6 Feb 2008, Andrew Morton wrote:

> > @@ -1357,17 +1366,22 @@ static struct page *get_partial(struct k
> >  static void unfreeze_slab(struct kmem_cache *s, struct page *page, int tail)
> >  {
> >  	struct kmem_cache_node *n = get_node(s, page_to_nid(page));
> > +	struct kmem_cache_cpu *c = get_cpu_slab(s, smp_processor_id());
> 
> So we're never running preemptibly here.

Correct.

> > +			if (SlabDebug(page) && (s->flags & SLAB_STORE_USER))
> >  			add_full(n, page);
> 
> missing a tab

Ack.

> 
> > +#ifdef CONFIG_SLUB_STATS
> > +
> > +#define STAT_ATTR(si, text) 					\
> > +static ssize_t text##_show(struct kmem_cache *s, char *buf)	\
> > +{								\
> > +	unsigned long sum  = 0;					\
> > +	int cpu;						\
> > +								\
> > +	for_each_online_cpu(cpu)				\
> > +		sum += get_cpu_slab(s, cpu)->stat[si];		\
> 
> maybe cache the get_cpu_slab() result in a local?

Every iteration must perform a different lookup. The cpu variable is 
passed to get_cpu_slab().

> 
> > +	return sprintf(buf, "%lu\n", sum);			\
> > +}								\
> > +SLAB_ATTR_RO(text);						\
> 
> this is pretty broken after cpu hot-unplug, isn't it?

No it still gives all the events on the processors that are up which is 
consistent in some way (and its only stats). There is really no clean 
solution. Same situation as with the event counters in the VM. We could 
fold them into some other processor when it goes down. Yuck.

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