powerpc/mm: Only define MAX_PHYSMEM_BITS in SPARSEMEM configurations

Michael Ellerman mpe at ellerman.id.au
Mon Mar 25 22:35:41 AEDT 2019


Ben Hutchings <ben at decadent.org.uk> writes:
> On Mon, 2019-03-25 at 01:03 +0100, Andreas Schwab wrote:
>> On Mär 24 2019, Ben Hutchings <ben at decadent.org.uk> wrote:
>> 
>> > Presumably you have CONFIG_PPC_BOOK3S_64 enabled and
>> > CONFIG_SPARSEMEM
>> > disabled?  Was this configuration actually usable?
>> 
>> Why not?
>
> I assume that CONFIG_SPARSEMEM is the default for a good reason.
> What I don't know is how strong that reason is (I am not a Power expert
> at all).  Looking a bit further, it seems to be related to CONFIG_NUMA
> in that you can enable CONFIG_FLATMEM if and only if that's disabled. 
> So I suppose the configuration you used works for non-NUMA systems.

Aneesh pointed out this fix would break FLATMEM after I'd merged it, but
it didn't break any of our defconfigs so I wondered if anyone would
notice.

I checked today and a G5 will boot with FLATMEM, which I assume is what
Andreas is using.

I guess we should fix this build break for now.

Even some G5's have discontiguous memory, so FLATMEM is not clearly a
good choice even for all G5's, and actually a fresh g5_defconfig uses
SPARSEMEM.

So I'm inclined to just switch to always using SPARSEMEM on 64-bit
Book3S, because that's what's well tested and we hardly need more code
paths to test. Unless anyone has a strong objection, I haven't actually
benchmarked FLATMEM vs SPARSEMEM on a G5.

cheers


More information about the Linuxppc-dev mailing list