mbox series

[0/5] mm: finish three more folio conversion

Message ID 20240817095122.2460977-1-wangkefeng.wang@huawei.com (mailing list archive)
Headers show
Series mm: finish three more folio conversion | expand

Message

Kefeng Wang Aug. 17, 2024, 9:51 a.m. UTC
Convert to use folios then remove find_subpage(), thp_nr_pages()
and PageTransHuge(). 

---
The thp_nr_pages() remove depends on "mm: memory_hotplug: remove head
variable in do_migrate_range()"[1]

[1] https://lore.kernel.org/linux-mm/20240817084941.2375713-2-wangkefeng.wang@huawei.com/

Kefeng Wang (5):
  mm: remove find_subpage()
  pagemap: use a folio in __readahead_batch()
  mm: remove thp_nr_pages()
  mm: khugepaged: pass a folio for set_huge_pmd()
  mm: remove PageTransHuge()

 include/linux/mm.h         |  9 ---------
 include/linux/page-flags.h | 13 -------------
 include/linux/pagemap.h    | 26 ++++++--------------------
 include/linux/pgtable.h    |  2 +-
 lib/iov_iter.c             | 24 +++++++++++++-----------
 mm/khugepaged.c            | 10 ++++------
 6 files changed, 24 insertions(+), 60 deletions(-)

Comments

Matthew Wilcox Aug. 18, 2024, 8:33 p.m. UTC | #1
On Sat, Aug 17, 2024 at 05:51:17PM +0800, Kefeng Wang wrote:
> Convert to use folios then remove find_subpage(), thp_nr_pages()
> and PageTransHuge(). 

This patch series is premature.  None of these APIs are particularly
advantageous to remove (they're inline functions, so cost nothing unless
used).  All of the places which use them are scheduled for removal.
If you want to help, converting the filesystems which use the batch
interfaces to use folios instead of pages would be a good way to start.
David Hildenbrand Aug. 19, 2024, 9:59 a.m. UTC | #2
On 18.08.24 22:33, Matthew Wilcox wrote:
> On Sat, Aug 17, 2024 at 05:51:17PM +0800, Kefeng Wang wrote:
>> Convert to use folios then remove find_subpage(), thp_nr_pages()
>> and PageTransHuge().
> 
> This patch series is premature.  None of these APIs are particularly
> advantageous to remove (they're inline functions, so cost nothing unless
> used). 
I do enjoy seeing the removal of thp_nr_pages(), though :)
Kefeng Wang Aug. 19, 2024, 11:13 a.m. UTC | #3
On 2024/8/19 17:59, David Hildenbrand wrote:
> On 18.08.24 22:33, Matthew Wilcox wrote:
>> On Sat, Aug 17, 2024 at 05:51:17PM +0800, Kefeng Wang wrote:
>>> Convert to use folios then remove find_subpage(), thp_nr_pages()
>>> and PageTransHuge().
>>
>> This patch series is premature.  None of these APIs are particularly
>> advantageous to remove (they're inline functions, so cost nothing unless
>> used). 
> I do enjoy seeing the removal of thp_nr_pages(), though :)
> 

The thp_nr_pages() and PageTransHuge() removing are found when improve
memory hotplug[1], also find_subpage() has issue[2], this is where 
patches come from, since there are only few callers, I think we can
cleanup it earlier?

[1] 
https://lore.kernel.org/linux-mm/20240817084941.2375713-2-wangkefeng.wang@huawei.com/
[2] 
https://lore.kernel.org/linux-mm/646f8a48-820f-40ae-bf96-7d554bf4493a@huawei.com/T/#u
Matthew Wilcox Aug. 19, 2024, 1:20 p.m. UTC | #4
On Mon, Aug 19, 2024 at 07:13:18PM +0800, Kefeng Wang wrote:
> On 2024/8/19 17:59, David Hildenbrand wrote:
> > On 18.08.24 22:33, Matthew Wilcox wrote:
> > > On Sat, Aug 17, 2024 at 05:51:17PM +0800, Kefeng Wang wrote:
> > > > Convert to use folios then remove find_subpage(), thp_nr_pages()
> > > > and PageTransHuge().
> > > 
> > > This patch series is premature.  None of these APIs are particularly
> > > advantageous to remove (they're inline functions, so cost nothing unless
> > > used).
> > I do enjoy seeing the removal of thp_nr_pages(), though :)
> > 
> 
> The thp_nr_pages() and PageTransHuge() removing are found when improve
> memory hotplug[1], also find_subpage() has issue[2], this is where patches
> come from, since there are only few callers, I think we can
> cleanup it earlier?

No, leave them alone until we get rid of readahead_batch() and friends.
Kefeng Wang Aug. 20, 2024, 8:41 a.m. UTC | #5
On 2024/8/19 21:20, Matthew Wilcox wrote:
> On Mon, Aug 19, 2024 at 07:13:18PM +0800, Kefeng Wang wrote:
>> On 2024/8/19 17:59, David Hildenbrand wrote:
>>> On 18.08.24 22:33, Matthew Wilcox wrote:
>>>> On Sat, Aug 17, 2024 at 05:51:17PM +0800, Kefeng Wang wrote:
>>>>> Convert to use folios then remove find_subpage(), thp_nr_pages()
>>>>> and PageTransHuge().
>>>>
>>>> This patch series is premature.  None of these APIs are particularly
>>>> advantageous to remove (they're inline functions, so cost nothing unless
>>>> used).
>>> I do enjoy seeing the removal of thp_nr_pages(), though :)
>>>
>>
>> The thp_nr_pages() and PageTransHuge() removing are found when improve
>> memory hotplug[1], also find_subpage() has issue[2], this is where patches
>> come from, since there are only few callers, I think we can
>> cleanup it earlier?
> 
> No, leave them alone until we get rid of readahead_batch() and friends.
> 

It is beyond my scope about changing fuse/squashfs to remove
readahead_batch, will separate find_subpage/set_huge_pmd changes,
thanks for you suggestion.