linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Trying to use SLUB in an odd way
@ 2010-05-24  2:39 Charles Manning
  0 siblings, 0 replies; only message in thread
From: Charles Manning @ 2010-05-24  2:39 UTC (permalink / raw)
  To: linux-kernel

Hi

YAFFS uses an internal almost slub-like allocator and I've been looking at 
moving it to use SLUB as part of an attempt to mainline yaffs.

In yaffs I create a lot of tiny objects which are allocated in blocks, like 
slub, and then managed in a free list. Very slubbish so far, but mine is far 
less intelligent than slub.

The difference though is that I can keep the objects for each mount separate 
and can dump the whole lot on umount without individually freeing objects. I 
just deallocate my whole cache.

There are two problems that I encountered in  moving to slub:
1) I want to keep each mount point separate, but slub just hooks up with an 
existing cache of the same size. I managed to trick slub into keeping yaffs 
objects in their own cache by assigning a fake ctor. That stops the 
combination (well at present anyway - could easy change in the future like if 
ctor gets dropped). Like a VW Bug: ugly but it gets you there....

2) If I dump a cache with existing in-use objects then slub gets upset and 
dumps warnings. I don't like the idea of just ignoring warnings. I also don't 
want to manually tear down trees etc when the existing  "just dump it" 
approach is a lot faster. Pity there is no "trust me I know what I'm doing" 
flag.

Questions:
A) Is there a better way to use slub to do this or is it better to just 
continue with my manual allocator?

B) Is it worth adding flags to kmem_cache_create() to say:
 a) Don't combine this slub with others.
 b) "Trust me I know what I'm doing": Allow the cache to be dumped with 
objects still allocated. 

If (B) makes sense I'll put together a patch.

-- Charles



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-24  2:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-24  2:39 Trying to use SLUB in an odd way Charles Manning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).