Re: [PATCH -mm v2 7/8] slub: make dead memcg caches discard free slabs immediately

Vladimir Davydov
2014-06-10T10:09:38Z

On Tue, Jun 10, 2014 at 05:09:35PM +0900, Joonsoo Kim wrote:
> On Fri, Jun 06, 2014 at 05:22:44PM +0400, Vladimir Davydov wrote:
> > @@ -2064,6 +2066,21 @@ static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain)
> >
> > } while (this_cpu_cmpxchg(s->cpu_slab->partial, oldpage, page)
> > != oldpage);
> > +
> > + if (memcg_cache_dead(s)) {
> > + bool done = false;
> > + unsigned long flags;
> > +
> > + local_irq_save(flags);
> > + if (this_cpu_read(s->cpu_slab->partial) == page) {
> > + unfreeze_partials(s, this_cpu_ptr(s->cpu_slab));
> > + done = true;
> > + }
> > + local_irq_restore(flags);
> > +
> > + if (!done)
> > + flush_all(s);
> > + }
>
> Now, slab_free() is non-preemptable so flush_all() isn't needed.

Right! Will fix.

Thanks.