Re: PCI memory allocation bug with CONFIG_HIGHMEM

From: Linus Torvalds
Date: Mon Jan 05 2004 - 20:43:42 EST




On Mon, 5 Jan 2004, Linus Torvalds wrote:
>
> Hmm.. I suspect that it might be ok to check "max_pfn" for being less than
> 4GB, and use that if so. Add something like
>
> if (max_pfn < 0x100000)
> if (pci_mem_start < (max_pfn << PAGE_SHIFT))
> pci_mem_start = max_pfn << PAGE_SHIFT;

Actually, that would suck.

I think the proper fix would be to make the "mem=" stuff do the right
thing to the iomem_resource handling, and add the "round up" code there
too (and mark it as being reserved).

Basically, it shouldn't be impossible to get a "reasonably good" map from
"mem=xxxx" that would work more of the time. It wouldn't necessarily be
perfect, but it would be better than what we have now.

You can always use much more complicated "exactmap" stuff to really
generate a full e820 map, but I suspect nobody has ever done that in real
life. Something like

mem=exactmap mem=0x9f000@0 mem=0xfe00000@0x100000 mem=0x100000$0xff00000

can be used to give you 255MB of RAM with the last 1MB marked as being
"reserved".

Or it _should_ work that way. I've never used it myself ;)

Anyway, we could change what the "simple" form of "mem=xxx" means to
something that is more likely to have success. Anybody willing to look at
this?

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/