lkml.org 
[lkml]   [2000]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: how does kernel get the "current" task struct?
Linus Torvalds wrote:
> > I'm lost. I know you need aligned allocations. I don't see why you
> > have to align a zone to get aligned allocations.
>
> You don't have to. However, if you don't align the zone, you have to
> still offset a lot of the calculations by the "alignment factor". Which
> bacially means that you in practice _do_ end up aligning it after all,
> it's just that you're doing it at run-time instead of setup-time. No
> real difference, and doing it at setup is clearer I think.

Fair enough. I see that for the bitmap index in particular.

I suppose a small amount of memory could be saved by noting that, as
some parts of a not-really-aligned zone are never allocated, those parts
of the bitmap don't have to exist.

Slightly different topic: I think I see a bug. This code in
free_pages_ok:

map_nr &= mask;
...
buddy = list(map_nr ^ -mask);
...
mask <<= 1;
...
map_nr &= mask;

map_nr here is relative to the first page in mem_map, whichever zone is
used. That means the first page in mem_map had better have as much
alignment as any zone, otherwise the masking operations on map_nr aren't
going to work nicely at all. This only affects the folks who are asking
about systems with memory that doesn't start at address zero.

enjoy,
-- Jamie

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

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