lkml.org 
[lkml]   [1997]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: useful LKM?
From
Date
Jacques Gelinas <jack@solucorp.qc.ca> writes:

> Ultimatly, this optimisation could even be a compile time option
>
> [ ] Squeeze as much memory as need
>
> struct foo {
> .
> #if define(KERNEL_OPTION) || !defined(KERNEL_SQUEEZE)
> struct sub_foo *pt;
> #endif
> .
> };
Often is doesn't matter anyways, because the kmalloc() Linux uses always
rounds the block size to the next power of 2. Only when this additional
field causes the structure size to go into the next 'order' (e.g. from 32
to 64 bytes) it'll cost you memory. The kmalloc emulation on top of slab
in 2.1 is power-of-2 based too, if you use slap directly the effect is
still there (because slab aligns the objects in the page for the cache
colouring), but much less. Most structures in Linux are still managed
by kmalloc() though..

-Andi

\
 
 \ /
  Last update: 2005-03-22 13:40    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site