The patch titled Subject: mm: Fix PSWPIN counter for large folios swap-in has been added to the -mm mm-hotfixes-unstable branch. Its filename is mm-fix-pswpin-counter-for-large-folios-swap-in.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-fix-pswpin-counter-for-large-folios-swap-in.patch This patch will later appear in the mm-hotfixes-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Barry Song <v-songbaohua@xxxxxxxx> Subject: mm: Fix PSWPIN counter for large folios swap-in Date: Thu, 24 Oct 2024 10:02:01 +1300 Similar to PSWPOUT, we should count the number of base pages instead of large folios. Link: https://lkml.kernel.org/r/20241023210201.2798-1-21cnbao@xxxxxxxxx Fixes: 242d12c98174 ("mm: support large folios swap-in for sync io devices") Signed-off-by: Barry Song <v-songbaohua@xxxxxxxx> Acked-by: David Hildenbrand <david@xxxxxxxxxx> Cc: Chris Li <chrisl@xxxxxxxxxx> Cc: Yosry Ahmed <yosryahmed@xxxxxxxxxx> Cc: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx> Cc: "Huang, Ying" <ying.huang@xxxxxxxxx> Cc: Kairui Song <kasong@xxxxxxxxxxx> Cc: Ryan Roberts <ryan.roberts@xxxxxxx> Cc: Kanchana P Sridhar <kanchana.p.sridhar@xxxxxxxxx> Cc: Usama Arif <usamaarif642@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/mm/page_io.c~mm-fix-pswpin-counter-for-large-folios-swap-in +++ a/mm/page_io.c @@ -570,7 +570,7 @@ static void swap_read_folio_bdev_sync(st * attempt to access it in the page fault retry time check. */ get_task_struct(current); - count_vm_event(PSWPIN); + count_vm_events(PSWPIN, folio_nr_pages(folio)); submit_bio_wait(&bio); __end_swap_bio_read(&bio); put_task_struct(current); @@ -585,7 +585,7 @@ static void swap_read_folio_bdev_async(s bio->bi_iter.bi_sector = swap_folio_sector(folio); bio->bi_end_io = end_swap_bio_read; bio_add_folio_nofail(bio, folio, folio_size(folio), 0); - count_vm_event(PSWPIN); + count_vm_events(PSWPIN, folio_nr_pages(folio)); submit_bio(bio); } _ Patches currently in -mm which might be from v-songbaohua@xxxxxxxx are mm-avoid-unconditional-one-tick-sleep-when-swapcache_prepare-fails.patch mm-avoid-unconditional-one-tick-sleep-when-swapcache_prepare-fails-fix.patch mm-fix-pswpin-counter-for-large-folios-swap-in.patch