Re: [PATCH -next] mm, page_alloc: avoid page_to_pfn() in move_freepages()

2021-03-29 Thread Vlastimil Babka
On 3/23/21 2:12 PM, Liu Shixin wrote: > From: Kefeng Wang > > The start_pfn and end_pfn are already available in move_freepages_block(), > there is no need to go back and forth between page and pfn in move_freepages > and move_freepages_block, and pfn_valid_within() should validate pfn first >

Re: [PATCH -next] mm, page_alloc: avoid page_to_pfn() in move_freepages()

2021-03-26 Thread Liu Shixin
Sorry to reply to you after a so long time and thanks for your advice. It does seem that your proposed change will make the code cleaner and more efficient. I repeated move_freepages_block() 200 times on the VM and counted jiffies. The average value before and after the change was

Re: [PATCH -next] mm, page_alloc: avoid page_to_pfn() in move_freepages()

2021-03-23 Thread Matthew Wilcox
On Tue, Mar 23, 2021 at 09:12:15PM +0800, Liu Shixin wrote: > From: Kefeng Wang > > The start_pfn and end_pfn are already available in move_freepages_block(), > there is no need to go back and forth between page and pfn in move_freepages > and move_freepages_block, and pfn_valid_within() should

[PATCH -next] mm, page_alloc: avoid page_to_pfn() in move_freepages()

2021-03-23 Thread Liu Shixin
From: Kefeng Wang The start_pfn and end_pfn are already available in move_freepages_block(), there is no need to go back and forth between page and pfn in move_freepages and move_freepages_block, and pfn_valid_within() should validate pfn first before touching the page. Signed-off-by: Kefeng