mm: Fix PSWPIN counter for large folios swap-in
Subsystems (2)
PATCH 1/1 mm: Fix PSWPIN counter for large folios swap-in
From: Barry Song <[email protected]>
Similar to PSWPOUT, we should count the number of base pages instead of large folios.
Fixes 242d12c98174 ("mm: support large folios swap-in for sync io devices")
Cc Chris Li <[email protected]>
Cc Yosry Ahmed <[email protected]>
Cc Baolin Wang <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc "Huang, Ying" <[email protected]>
Cc Kairui Song <[email protected]>
Cc Ryan Roberts <[email protected]>
Cc Kanchana P Sridhar <[email protected]>
Cc Usama Arif <[email protected]>
Signed-off-by Barry Song <[email protected]>
--- mm/page_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_io.c +2 -2
@@ -574,7 +574,7 @@ static void swap_read_folio_bdev_sync(struct folio *folio,*/ get_task_struct (current);count_memcg_folio_events (folio,PSWPIN ,folio_nr_pages (folio)); -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);
@@ -590,7 +590,7 @@ static void swap_read_folio_bdev_async(struct folio *folio, bio->bi_end_io = end_swap_bio_read;bio_add_folio_nofail (bio, folio,folio_size (folio),0 );count_memcg_folio_events (folio,PSWPIN ,folio_nr_pages (folio)); -count_vm_event (PSWPIN ); +count_vm_events (PSWPIN ,folio_nr_pages (folio));submit_bio (bio); }
Signature · 1 line
2.39.3 (Apple Git-146)
Quoted 16 lines · Barry Song
From: Barry Song <[email protected]>
Similar to PSWPOUT, we should count the number of base pages instead of large folios.
Fixes 242d12c98174 ("mm: support large folios swap-in for sync io devices")Cc Chris Li <[email protected]>Cc Yosry Ahmed <[email protected]>Cc Baolin Wang <[email protected]>Cc David Hildenbrand <[email protected]>Cc "Huang, Ying" <[email protected]>Cc Kairui Song <[email protected]>Cc Ryan Roberts <[email protected]>Cc Kanchana P Sridhar <[email protected]>Cc Usama Arif <[email protected]>Signed-off-by Barry Song <[email protected]>
Quoted 4 lines
--- mm/page_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 3 lines
Cheers, David / dhildenb
Quoted 5 lines · Barry Song
From: Barry Song <[email protected]>
Similar to PSWPOUT, we should count the number of base pages instead of large folios.
Quoted 11 lines
Fixes 242d12c98174 ("mm: support large folios swap-in for sync io devices")Cc Chris Li <[email protected]>Cc Yosry Ahmed <[email protected]>Cc Baolin Wang <[email protected]>Cc David Hildenbrand <[email protected]>Cc "Huang, Ying" <[email protected]>Cc Kairui Song <[email protected]>Cc Ryan Roberts <[email protected]>Cc Kanchana P Sridhar <[email protected]>Cc Usama Arif <[email protected]>Signed-off-by Barry Song <[email protected]>
LGTM.
Reviewed-by Baolin Wang <[email protected]>
Quoted 26 lines
--- mm/page_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)mm/page_io.c +2
-2@@ -574,7 +574,7 @@ static void swap_read_folio_bdev_sync(struct folio *folio,*/ get_task_struct (current);count_memcg_folio_events (folio,PSWPIN ,folio_nr_pages (folio)); -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);@@ -590,7 +590,7 @@ static void swap_read_folio_bdev_async(struct folio *folio, bio->bi_end_io = end_swap_bio_read;bio_add_folio_nofail (bio, folio,folio_size (folio),0 );count_memcg_folio_events (folio,PSWPIN ,folio_nr_pages (folio)); -count_vm_event (PSWPIN ); +count_vm_events (PSWPIN ,folio_nr_pages (folio));submit_bio (bio); }