lkml.org 
[lkml]   [1997]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: useful LKM?
On Thu, 2 Oct 1997, Raul Miller wrote:

> Andi Kleen <ak@muc.de> wrote:
> > 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..
>
> Er... I'm not sure I understand this. It sounds as if it doesn't
> matter what offsets are used for the various fields of a structure.
> But if that's the case, why should it matter whether the kernel and
> the module agree on the structure definition at all?
>
> Is there some kind of interface layer in there that looks at the
> mechanical definition of the deviant structures across the two sides of
> the interface, then adjusts what's in memory as control passes across
> the barrier???
>
> Or is this just a case where something is advertised for export, but
> not really used??

No this is not the point. The exact layout of the structure does matter.
No linker fix that (although they should imho). What does not matter is to
optimise the size of a structure when some option is not enabled. He
claims that anyway, because of the way the various structures are
allocated with kmalloc, the exact same amount of memory is allocated in
many case. So there is little point in optimising the structure layout.

As post earlier, using a compile time option called "Module
compatibility", we could modify few header to achieve this for those who
wants it (most I guess). This means that with this "module comatibility"
option, most kernel structure would always be the same whatever options
are used, without recoding any modules.

--------------------------------------------------------
Jacques Gelinas (jacques@solucorp.qc.ca)
Linuxconf: The ultimate administration system for Linux.
see http://www.solucorp.qc.ca/linuxconf
new developments: mail to fax gateway, disk quota management, RPM for redhat



\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.197 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site