Re: [PATCH V3 2/2] arm64/mm: Reorganize pfn_valid()

2021-03-08 Thread Catalin Marinas
On Fri, Mar 05, 2021 at 10:54:58AM +0530, Anshuman Khandual wrote: > There are multiple instances of pfn_to_section_nr() and __pfn_to_section() > when CONFIG_SPARSEMEM is enabled. This can be optimized if memory section > is fetched earlier. This replaces the open coded PFN and ADDR conversion >

[PATCH V3 2/2] arm64/mm: Reorganize pfn_valid()

2021-03-04 Thread Anshuman Khandual
There are multiple instances of pfn_to_section_nr() and __pfn_to_section() when CONFIG_SPARSEMEM is enabled. This can be optimized if memory section is fetched earlier. This replaces the open coded PFN and ADDR conversion with PFN_PHYS() and PHYS_PFN() helpers. While there, also add a comment.