Re: [RFC][PATCH] remove zone_mem_map [3/4] pfn_to_page()

Andy Whitcroft
2006-02-01T13:34:38Z

Martin J. Bligh wrote:
> KAMEZAWA Hiroyuki wrote:
>
>> Replace page_to_pfn() functions which uses zone->zone_mem_map.
>>
>> Although pfn_to_page() uses node->node_mem_map, page_to_pfn() uses
>> zone->zone_mem_map. I don't know why. This patch make page_to_pfn
>> use node->node_mem_map
>
>
> I think that might have been because it's a faster op, at least on
> some architectures, under sparsemem. Andy, can you confirm / deny?
> Some part of the mapping was embedded in the page flags.
>
> If Andy can't recall, I'll look again on Thursday when I'm back ...

Not for SPARSEMEM anyhow, we don't use any of those pointers we are
using the per section maps based on pfn. However, I would assume we
have it as an optimisation for the FLAT/DISCONTIG forms -- as we have a
quick lookup of the zone. That said we should have a quick lookup of
the node too and it looks like the proposed replacement is using that
one. So I'd say this should be about as performant.

-apw