lkml.org 
[lkml]   [2004]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC] [PATCH] kmem_alloc (generic wrapper for kmalloc and vmalloc)
    Carl-Daniel> OK, so how should I allocate memory for 512 struct
Carl-Daniel> loop_device's? Because of its odd size (304 bytes)
Carl-Daniel> it seems that if I use kmalloc seperately for each
Carl-Daniel> struct, I'd waste 208 bytes per allocation. 68%
Carl-Daniel> overhead would be a step backwards. Or am I missing
Carl-Daniel> something here?

Would creating your own slab cache with kmem_cache_create() and
allocating with kmem_cache_alloc() work? You can fit 13 304 byte
objects in a 4K page, which wastes 4096 - 13*304 = 144 bytes per page
or about 11 bytes per object. Less than 4% overhead seems OK to me.

- R.
-
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: 2005-03-22 14:07    [W:0.049 / U:6.024 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site