Re: [PATCH -mm v3 8/8] slab: do not keep free objects/slabs on dead memcg caches

From: Vladimir Davydov
Date: Tue Jun 24 2014 - 03:43:17 EST


Hi,

On Tue, Jun 24, 2014 at 04:25:54PM +0900, Joonsoo Kim wrote:
> On Fri, Jun 13, 2014 at 12:38:22AM +0400, Vladimir Davydov wrote:
> > @@ -3368,7 +3379,8 @@ static void free_block(struct kmem_cache *cachep, void **objpp, int nr_objects,
> >
> > /* fixup slab chains */
> > if (page->active == 0) {
> > - if (n->free_objects > n->free_limit) {
> > + if (n->free_objects > n->free_limit ||
> > + memcg_cache_dead(cachep)) {
>
> I'd like to set 0 to free_limit in __kmem_cache_shrink()
> rather than memcg_cache_dead() test here, because memcg_cache_dead()
> is more expensive than it. Is there any problem in this way?

We'd have to be careful on cpu hotplug then, because it may update the
free_limit. Not a big problem though. Will fix.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/