lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241023210201.2798-1-21cnbao@gmail.com>
Date: Thu, 24 Oct 2024 10:02:01 +1300
From: Barry Song <21cnbao@...il.com>
To: akpm@...ux-foundation.org,
	linux-mm@...ck.org
Cc: linux-kernel@...r.kernel.org,
	Barry Song <v-songbaohua@...o.com>,
	Chris Li <chrisl@...nel.org>,
	Yosry Ahmed <yosryahmed@...gle.com>,
	Baolin Wang <baolin.wang@...ux.alibaba.com>,
	David Hildenbrand <david@...hat.com>,
	"Huang, Ying" <ying.huang@...el.com>,
	Kairui Song <kasong@...cent.com>,
	Ryan Roberts <ryan.roberts@....com>,
	Kanchana P Sridhar <kanchana.p.sridhar@...el.com>,
	Usama Arif <usamaarif642@...il.com>
Subject: [PATCH] mm: Fix PSWPIN counter for large folios swap-in

From: Barry Song <v-songbaohua@...o.com>

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 <chrisl@...nel.org>
Cc: Yosry Ahmed <yosryahmed@...gle.com>
Cc: Baolin Wang <baolin.wang@...ux.alibaba.com>
Cc: David Hildenbrand <david@...hat.com>
Cc: "Huang, Ying" <ying.huang@...el.com>
Cc: Kairui Song <kasong@...cent.com>
Cc: Ryan Roberts <ryan.roberts@....com>
Cc: Kanchana P Sridhar <kanchana.p.sridhar@...el.com>
Cc: Usama Arif <usamaarif642@...il.com>
Signed-off-by: Barry Song <v-songbaohua@...o.com>
---
 mm/page_io.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index a28d28b6b3ce..c69fab5060a1 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -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);
 }
 
-- 
2.39.3 (Apple Git-146)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ