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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 13 May 2024 03:26:09 +0000
From: xu xin <xu.xin.sc@...il.com>
To: chengming.zhou@...ux.dev
Cc: aarcange@...hat.com,
	akpm@...ux-foundation.org,
	david@...hat.com,
	hughd@...gle.com,
	linux-kernel@...r.kernel.org,
	linux-mm@...ck.org,
	shr@...kernel.io,
	xu.xin16@....com.cn,
	yang.yang29@....com.cn,
	si.hao@....com.cn,
	zhouchengming@...edance.com
Subject: [PATCH v2 1/2] mm/ksm: fix ksm_pages_scanned accounting

>Fixes: b348b5fe2b5f ("mm/ksm: add pages scanned metric")
>Acked-by: David Hildenbrand <david@...hat.com>
>Signed-off-by: Chengming Zhou <chengming.zhou@...ux.dev>
>---
> mm/ksm.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
>diff --git a/mm/ksm.c b/mm/ksm.c
>index e1034bf1c937..0f9c491552ff 100644
>--- a/mm/ksm.c
>+++ b/mm/ksm.c
>@@ -2753,18 +2753,16 @@ static void ksm_do_scan(unsigned int scan_npages)
> {
> 	struct ksm_rmap_item *rmap_item;
> 	struct page *page;
>-	unsigned int npages = scan_npages;
> 
>-	while (npages-- && likely(!freezing(current))) {
>+	while (scan_npages-- && likely(!freezing(current))) {
> 		cond_resched();
> 		rmap_item = scan_get_next_rmap_item(&page);
> 		if (!rmap_item)
> 			return;
> 		cmp_and_merge_page(page, rmap_item);
> 		put_page(page);
>+		ksm_pages_scanned++;
> 	}
>-
>-	ksm_pages_scanned += scan_npages - npages;
> }
> 
> static int ksmd_should_run(void)

Looks good to me.

Reviewed-by: xu xin <xu.xin16@....com.cn>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ