[lkml]   [1997]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: useful LKM?
    Jacques Gelinas <> 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..


     \ /
      Last update: 2005-03-22 13:40    [W:0.017 / U:144.252 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site