Re: [PATCH] Permit inode & dentry hash tables to be allocated >MAX_ORDER size

From: Linus Torvalds
Date: Sun Jun 13 2004 - 11:10:25 EST




On Fri, 11 Jun 2004, Andrew Morton wrote:
>
> Confused. Why do we have that test in there at all? We should just toss
> the pages one at a time into the buddy list and let the normal coalescing
> work it out. That way we'd end up with a single 16MB "page" followed by N
> 256MB "pages".

Doesn't work that way. We use the base of the memory area as the "zero
point", and while the buddy allocator itself shouldn't really care where
that zero-point is, anybody who expects physical alignment would be really
upset if it doesn't get it.

So the base address has to be as aligned as anybody could ever want. And
"anybody" wants quite a bit of alignment. Largepages usually want
alignment guarantees, and on most architectures that means a minimum
_physical_ address alignment of at least a few megabytes.

So the rule really should be: make sure that the buddy system base address
is maximally aligned, and if your memory doesn't actually _start_ at that
alignment point, just add the pages and let the buddy allocator build up
all the bitmaps etc for you.

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