Re: [PATCH 16/16] mm/slab: introduce new slab management type, OBJFREELIST_SLAB

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

 



On 01/14/2016 06:24 AM, Joonsoo Kim wrote:
> In fact, I tested another idea implementing OBJFREELIST_SLAB with
> extendable linked array through another freed object. It can remove
> memory waste completely but it causes more computational overhead
> in critical lock path and it seems that overhead outweigh benefit.
> So, this patch doesn't include it.

Can you elaborate? Do we actually need an extendable linked array? Why not just
store the pointer to the next free object into the object, NULL for the last
one? I.e. a singly-linked list. We should never need to actually traverse it?

freeing object obj:
*obj = page->freelist;
page->freelist = obj;

allocating object:
obj = page->freelist;
page->freelist = *obj;
*obj = NULL;

That means two writes, but if we omit managing page->active, it's not an
increase. For counting free objects, we would need to traverse the list, but
that's only needed for debugging?

Also during bulk operations, page->freelist could be updated just once at the
very end.

Vlastimil

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