Skip to content

Commit b54e1bf

Browse files
Barry Songakpm00
authored andcommitted
mm: fix PSWPIN counter for large folios swap-in
Similar to PSWPOUT, we should count the number of base pages instead of large folios. Link: https://lkml.kernel.org/r/[email protected] Fixes: 242d12c ("mm: support large folios swap-in for sync io devices") Signed-off-by: Barry Song <[email protected]> Acked-by: David Hildenbrand <[email protected]> Reviewed-by: Baolin Wang <[email protected]> Cc: Chris Li <[email protected]> Cc: Yosry Ahmed <[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: Andrew Morton <[email protected]>
1 parent e0fc203 commit b54e1bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/page_io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ static void swap_read_folio_bdev_sync(struct folio *folio,
570570
* attempt to access it in the page fault retry time check.
571571
*/
572572
get_task_struct(current);
573-
count_vm_event(PSWPIN);
573+
count_vm_events(PSWPIN, folio_nr_pages(folio));
574574
submit_bio_wait(&bio);
575575
__end_swap_bio_read(&bio);
576576
put_task_struct(current);
@@ -585,7 +585,7 @@ static void swap_read_folio_bdev_async(struct folio *folio,
585585
bio->bi_iter.bi_sector = swap_folio_sector(folio);
586586
bio->bi_end_io = end_swap_bio_read;
587587
bio_add_folio_nofail(bio, folio, folio_size(folio), 0);
588-
count_vm_event(PSWPIN);
588+
count_vm_events(PSWPIN, folio_nr_pages(folio));
589589
submit_bio(bio);
590590
}
591591

0 commit comments

Comments
 (0)