Re: [PATCH] Tight check of pfn_valid on sparsemem - v4

From: Russell King - ARM Linux
Date: Sat Jul 31 2010 - 06:40:37 EST


On Fri, Jul 30, 2010 at 06:32:04PM +0900, Minchan Kim wrote:
> On Fri, Jul 30, 2010 at 5:55 AM, Dave Hansen <dave@xxxxxxxxxxxxxxxxxx> wrote:
> > If you free up parts of the mem_map[] array, how does the buddy
> > allocator still work?  I thought we required at 'struct page's to be
> > contiguous and present for at least 2^MAX_ORDER-1 pages in one go.

(Dave, I don't seem to have your mail to reply to.)

What you say is correct, and memory banks as a rule of thumb tend to be
powers of two.

We do have the ability to change MAX_ORDER (which we need to do for some
platforms where there's only 1MB of DMA-able memory.)

However, in the case of two 512KB banks, the buddy allocator won't try
to satisfy a 1MB request as it'll only have two separate 2x512K free
'pages' to deal with, and 0x1M free 'pages'.
--
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/