Re: [RFC PATCH 2/2] slab: implement bulk free in SLAB allocator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 7 Dec 2015, Jesper Dangaard Brouer wrote:

> > s?
>
> The "s" comes from the slub.c code uses "struct kmem_cache *s" everywhere.

Ok then use it. Why is there an orig_s here.

> > > +
> > > +	local_irq_disable();
> > > +	for (i = 0; i < size; i++) {
> > > +		void *objp = p[i];
> > > +
> > > +		s = cache_from_obj(orig_s, objp);
> >
> > Does this support freeing objects from a set of different caches?
>
> This is for supporting memcg (CONFIG_MEMCG_KMEM).
>
> Quoting from commit 033745189b1b ("slub: add missing kmem cgroup
> support to kmem_cache_free_bulk"):
>
>    Incoming bulk free objects can belong to different kmem cgroups, and
>    object free call can happen at a later point outside memcg context.  Thus,
>    we need to keep the orig kmem_cache, to correctly verify if a memcg object
>    match against its "root_cache" (s->memcg_params.root_cache).

Where is that verification? This looks like SLAB would support freeing
objects from different caches.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]