Re: [PATCH v2 1/8] mm: swap: introduce pfn_swap_entry_to_folio()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2024/1/11 22:39, Matthew Wilcox wrote:
On Thu, Jan 11, 2024 at 02:37:41PM +0000, Matthew Wilcox wrote:
On Thu, Jan 11, 2024 at 07:12:32PM +0800, Kefeng Wang wrote:
Introduce a new pfn_swap_entry_to_folio(), it is similar to
pfn_swap_entry_to_page(), but return a folio, which allow us
to completely replace the struct page variables with struct
folio variables.

I have the exact same patch in my tree except I called it
pfn_swap_entry_folio().  I also noted:

     Thanks to the compound_head() hidden inside PageLocked(), this saves a
     call to compound_head() over calling page_folio(pfn_swap_entry_to_page())

Signed-off-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>

Reviewed-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>

Oh, and I converted a couple of callers ...
migration_entry_wait_on_locked and change_huge_pmd.  Those should
probably be added to this patch.


Thanks for your update, and all above conversion in your v3, and I check
more callers,  eg, hugetlb_change_protection,break_ksm_pmd_entry could
be converted too, but we could send separate patch.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux