lkml.org 
[lkml]   [2006]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [MODSLAB 3/7] A Kmalloc subsystem
Christoph Lameter wrote:

>>If you have non-power-of-two caches, you could store the control data at
>>(addr&(~PAGE_SIZE)) - the lookup would be much faster. I wrote a patch a few
>>weeks ago, it's attached.
>>
>>
>
>That would only work for slabs that use order 0 pages.
>
>
>
Most slabs are order 0. Actually: there are only 6 slabs that are not
order 0 (excluding the kmalloc caches) on my system.

What about:

if (unlikely(addr & (~(PAGE_SIZE-1))))
slabp=virt_to_page(addr)->pagefield;
else
slabp=addr & (~(PAGE_SIZE-1));

Modify the kmalloc caches slightly and use non-power-of-2 cache sizes.
Move the kmalloc(PAGE_SIZE) users to gfp.

From my system:
good order 1 slab caches: (i.e.: forcing them to order 0 wastes some memory)
biovec-128
blkdev_queue
mqueue_inode_cache
RAWv6
UDPv6
bogus order 1 caches: (i.e.: they could be order 0 without wasting memory)
biovec-(256)

--
Manfred
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-19 09:13    [W:0.089 / U:4.732 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site