Re: [PATCH] Initialize max_pfn_mapped as initial ident mapping sizefor x86_64

From: H. Peter Anvin
Date: Mon Mar 05 2012 - 20:50:17 EST


On 03/05/2012 05:35 PM, Yinghai Lu wrote:
>
> whole history:
> before following patch, on x86_64, for low memory (under 4g) pgtable
> will be allocated just under TOML
> and even those memory is not mapped directly. because now we are using
> early_ioremap to access those
> page table.
>
> but looks it has problem with S4 resume. so good_end is set to initial
> mapped high address.
> (that is 512M). So page table will just below 512M
> but crash kernel is allocated below 768M. so will have no chance to
> get 512M porting for crashkernel.
>
> Now your patch just set initial mapping limit to 1g. but according to
> arch/x86/kernel/head_64.S
> we only have initial mapping to 512M.
>
> So you can not just simply set to 1G, that will confuse early
> memblock allocator.
>
> We may update find_early_table_space() to use 1G as good_end for
> x86_64 that will be less confusing.
>

This is crazy. All of it. We shouldn't have a bunch of magic memory
limits on 64 bits, and trying to add and subtract to them really just
makes the pain worse.

WHY does it have a problem with S4 resume? S4 is Linux code, so there
is a bug here that people keep trying to hack around instead of digging
into.

The early mapping range we can fix, and probably should. Mapping the
first 4 GiB is not a lot of memory and makes a much more sensible
starting point.

-hpa


--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.

--
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/