Re: [patch 1/4] fs, jfs: remove slab object constructor

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

 



On Wed, Mar 25, 2015 at 07:37:40PM -0700, David Rientjes wrote:
> That would be true only for
> 
> 	ptr = mempool_alloc(gfp, pool);
> 	mempool_free(ptr, pool);
> 
> and nothing in between, and that's pretty pointless.  Typically, callers 
> allocate memory, modify it, and then free it.  When that happens with 
> mempools, and we can't allocate slab because of the gfp context, mempools 
> will return elements in the state in which they were freed (modified, not 
> as constructed).

The historic slab allocator (Solaris and early Linux) expects objects
to be returned in the same / similar enough form as the constructor
returned it, and the constructor is only called when allocating pages
from the page pool.

I have to admit that I haven't used this feature forever, and I have no idea if
people changed how the allocator works in the meantime.

--
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]