[lkml]   [2014]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH -mm v2 8/8] slab: make dead memcg caches discard free slabs immediately
On Tue, Jun 10, 2014 at 07:18:34PM +0400, Vladimir Davydov wrote:
> On Tue, Jun 10, 2014 at 09:26:19AM -0500, Christoph Lameter wrote:
> > On Tue, 10 Jun 2014, Vladimir Davydov wrote:
> >
> > > Frankly, I incline to shrinking dead SLAB caches periodically from
> > > cache_reap too, because it looks neater and less intrusive to me. Also
> > > it has zero performance impact, which is nice.
> > >
> > > However, Christoph proposed to disable per cpu arrays for dead caches,
> > > similarly to SLUB, and I decided to give it a try, just to see the end
> > > code we'd have with it.
> > >
> > > I'm still not quite sure which way we should choose though...
> >
> > Which one is cleaner?
> To shrink dead caches aggressively, we only need to modify cache_reap
> (see

Hmm, reap_alien, which is called from cache_reap to shrink per node
alien object arrays, only processes one node at a time. That means with
the patch I gave a link to above it will take up to
(REAPTIMEOUT_AC*nr_online_nodes) seconds to destroy a virtually empty
dead cache, which may be quite long on large machines. Of course, we can
make reap_alien walk over all alien caches of the current node, but that
will probably hurt performance...

> To zap object arrays for dead caches (this is what this patch does), we
> have to:
> - set array_cache->limit to 0 for each per cpu, shared, and alien array
> caches on kmem_cache_shrink;
> - make cpu/node hotplug paths init new array cache sizes to 0;
> - make free paths (__cache_free, cache_free_alien) handle zero array
> cache size properly, because currently they doesn't.
> So IMO the first one (reaping dead caches periodically) requires less
> modifications and therefore is cleaner.

 \ /
  Last update: 2014-06-12 00:01    [W:0.102 / U:3.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site