linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] slab: Don't scan cache_cache
@ 2006-02-24  7:52 Pekka J Enberg
  2006-02-24 16:16 ` Christoph Lameter
  0 siblings, 1 reply; 4+ messages in thread
From: Pekka J Enberg @ 2006-02-24  7:52 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, clameter, manfred, mark.fasheh, alok.kataria, kiran

From: Pekka Enberg <penberg@cs.helsinki.fi>

The cache_cache object cache is used for bootstrapping, but the cache is
essentially static. It is unlikely that we ever have more than one page
allocated for it. As SLAB_NO_REAP is gone now, fix a regression by skipping
cache_cache explicitly in cache_reap().

Boot-tested with UML.

Cc: Christoph Lameter <clameter@sgi.com>
Cc: Alok Kataria <alok.kataria@calsoftinc.com>
Cc: Ravikiran G Thirumalai <kiran@scalex86.org>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---

 mm/slab.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: 2.6-git/mm/slab.c
===================================================================
--- 2.6-git.orig/mm/slab.c
+++ 2.6-git/mm/slab.c
@@ -3483,6 +3483,10 @@ static void cache_reap(void *unused)
 		struct slab *slabp;
 
 		searchp = list_entry(walk, struct kmem_cache, next);
+
+		if (searchp == &cache_cache)
+			goto next;
+
 		check_irq_on();
 
 		l3 = searchp->nodelists[numa_node_id()];

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] slab: Don't scan cache_cache
  2006-02-24  7:52 [PATCH] slab: Don't scan cache_cache Pekka J Enberg
@ 2006-02-24 16:16 ` Christoph Lameter
  2006-02-25 21:50   ` Pekka Enberg
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Lameter @ 2006-02-24 16:16 UTC (permalink / raw)
  To: Pekka J Enberg
  Cc: akpm, linux-kernel, clameter, manfred, mark.fasheh, alok.kataria, kiran

On Fri, 24 Feb 2006, Pekka J Enberg wrote:

> From: Pekka Enberg <penberg@cs.helsinki.fi>
> 
> The cache_cache object cache is used for bootstrapping, but the cache is
> essentially static. It is unlikely that we ever have more than one page
> allocated for it. As SLAB_NO_REAP is gone now, fix a regression by skipping
> cache_cache explicitly in cache_reap().

There are other essentially static caches as well. Could we have something 
more general?

Are you really seeing any measurable regression?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] slab: Don't scan cache_cache
  2006-02-24 16:16 ` Christoph Lameter
@ 2006-02-25 21:50   ` Pekka Enberg
  2006-02-27  2:25     ` Ravikiran G Thirumalai
  0 siblings, 1 reply; 4+ messages in thread
From: Pekka Enberg @ 2006-02-25 21:50 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: akpm, linux-kernel, clameter, manfred, mark.fasheh, alok.kataria, kiran

On Fri, 24 Feb 2006, Pekka J Enberg wrote:
> > From: Pekka Enberg <penberg@cs.helsinki.fi>
> > 
> > The cache_cache object cache is used for bootstrapping, but the cache is
> > essentially static. It is unlikely that we ever have more than one page
> > allocated for it. As SLAB_NO_REAP is gone now, fix a regression by skipping
> > cache_cache explicitly in cache_reap().

On Fri, 2006-02-24 at 08:16 -0800, Christoph Lameter wrote:
> There are other essentially static caches as well. Could we have something 
> more general?
> 
> Are you really seeing any measurable regression?

I haven't measured it but it seems obvious enough that especially for
low end boxes. I don't think something more general is required because
other static caches should use kmalloc() instead.

			Pekka


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] slab: Don't scan cache_cache
  2006-02-25 21:50   ` Pekka Enberg
@ 2006-02-27  2:25     ` Ravikiran G Thirumalai
  0 siblings, 0 replies; 4+ messages in thread
From: Ravikiran G Thirumalai @ 2006-02-27  2:25 UTC (permalink / raw)
  To: Pekka Enberg
  Cc: Christoph Lameter, akpm, linux-kernel, clameter, manfred,
	mark.fasheh, alok.kataria

On Sat, Feb 25, 2006 at 11:50:13PM +0200, Pekka Enberg wrote:
> On Fri, 24 Feb 2006, Pekka J Enberg wrote:
> > > From: Pekka Enberg <penberg@cs.helsinki.fi>
> > 
> > Are you really seeing any measurable regression?
> 
> I haven't measured it but it seems obvious enough that especially for
> low end boxes. I don't think something more general is required because
> other static caches should use kmalloc() instead.
> 

I hope all of us mean "less used and not changing in usage over time"  when we
refer to static caches all throughout our discussion.  That said, for a
given workload,  one set of caches maybe static while the other is not
(networking loads may have networking slab caches grow and shrink, while the
fs driver caches stay static etc).  So I am not sure if static caches can
use kmalloc in general.  If scanning cache_cache is really a regression (it is
probably 1 of 15-20 other static caches on a system), then  IMHO, similar
treatment should be given to other static caches as well.  We could have a
counter on cachep (per-cpu of course) which keeps tracks of cachep usage,
and we could build logic not to scan these caches as frequently.

Now, it is not like cache_cache cannot grow at all or is absolutely static.
So not scanning just cache_cache, when SLAB_NO_REAP flag is taken out
does not make it look very good IMHO.  Sure, it was this way before, but
we had a flag to indicate so.  And if we think this is a regression, we
should generalize this for other less used caches too.

Thanks,
Kiran

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-02-27  2:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-24  7:52 [PATCH] slab: Don't scan cache_cache Pekka J Enberg
2006-02-24 16:16 ` Christoph Lameter
2006-02-25 21:50   ` Pekka Enberg
2006-02-27  2:25     ` Ravikiran G Thirumalai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).