2015-11-09 23:21:00

by Tony Luck

[permalink] [raw]
Subject: Re: [PATCHv4] mm: Don't offset memmap for flatmem

> @@ -4984,9 +4987,9 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
> */
> if (pgdat == NODE_DATA(0)) {
> mem_map = NODE_DATA(0)->node_mem_map;
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> +#if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM)
> if (page_to_pfn(mem_map) != pgdat->node_start_pfn)
> - mem_map -= (pgdat->node_start_pfn - ARCH_PFN_OFFSET);
> + mem_map -= offset;
> #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
> }
> #endif

This piece breaks ia64. See the comment earlier in the function
that "ia64 gets its own node_mem_map" ... so we skip the initialization
of offset ... and arrive down here and just subtract "0" from mem_map.

Attached patch fixes ia64 ... does ARM still work if this is applied?

-Tony


Attachments:
fixia64.patch (1.20 kB)

2015-11-10 01:34:17

by Laura Abbott

[permalink] [raw]
Subject: Re: [PATCHv4] mm: Don't offset memmap for flatmem

On 11/9/15 3:20 PM, Tony Luck wrote:
>> @@ -4984,9 +4987,9 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
>> */
>> if (pgdat == NODE_DATA(0)) {
>> mem_map = NODE_DATA(0)->node_mem_map;
>> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
>> +#if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM)
>> if (page_to_pfn(mem_map) != pgdat->node_start_pfn)
>> - mem_map -= (pgdat->node_start_pfn - ARCH_PFN_OFFSET);
>> + mem_map -= offset;
>> #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
>> }
>> #endif
>
> This piece breaks ia64. See the comment earlier in the function
> that "ia64 gets its own node_mem_map" ... so we skip the initialization
> of offset ... and arrive down here and just subtract "0" from mem_map.
>
> Attached patch fixes ia64 ... does ARM still work if this is applied?
>
> -Tony
>

Yes, this still fixes the problem for me. I see the pfn <-> page
translation working as expected.

Tested-by: Laura Abbott <[email protected]>

Thanks,
Laura