All of lore.kernel.org
 help / color / mirror / Atom feed
* slab: cache sizes for kmalloc
@ 2011-03-17 23:18 Maksym Planeta
  2011-03-17 23:56 ` Mulyadi Santosa
  0 siblings, 1 reply; 4+ messages in thread
From: Maksym Planeta @ 2011-03-17 23:18 UTC (permalink / raw)
  To: kernelnewbies

There are predefined cache sizes in <linux/kmalloc_sizes.h>. But I don't
understand why exactly these sizes were chosen. 

I've wrote a hook were I've counted witch object sizes are the most
popular. They were objects of sizes 8 and 16 bytes, but the smallest
available cache has size 32 bytes. So in this cache fragmentation is
about 40%. There is big fragmentation in 512 and 1024-byte caches too --
25 and 35 percent correspondingly. Also there are empty caches, all DMA
caches on my system are empty. In total there is wasting of memory.

That's why, I think that caches for kmalloc can be created dynamically.
For example, if I have 32-byte cache, but it's fragmentation exceeds
level of 20% can be created new cache with smaller size and new objects,
that fit this new size, should be allocated there. But if there are too
little objects in the cache, new allocating to it can be stopped and
with the lapse of time when it become empty it could be destroyed.

The aim is to reduce memory waste and make fragmentation nearly equal.
So I would like to know is there any sense in such cache management. If
yes, I'll work on this.

-- 
Thanks,

Maksym Planeta

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-18 22:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-17 23:18 slab: cache sizes for kmalloc Maksym Planeta
2011-03-17 23:56 ` Mulyadi Santosa
2011-03-18  5:52   ` Maksym Planeta
2011-03-18 22:26     ` Mulyadi Santosa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.