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: <20241011103609.1992042-1-mengensun@tencent.com>
Date: Fri, 11 Oct 2024 18:36:10 +0800
From: alexjlzheng@...il.com
To: akpm@...ux-foundation.org
Cc: linux-mm@...ck.org,
	linux-kernel@...r.kernel.org,
	alexjlzheng@...cent.com,
	MengEn Sun <mengensun@...cent.com>
Subject: [PATCH] mm: make pcp decay work with onhz

From: MengEn Sun <mengensun@...cent.com>

when a cpu stops tick, quiet_vmstat may flush all the per cpu
statistics counter.

while, the shepherd is needed those counters to kick the
vmstat_work.

when a cpu in nohz with a lot of pcp pages, and do not do page
allocating and freeing. the pcp pages of the cpu may not be hold
for a long time

we make shepherd keep a eye on the pcp high_min and high_max

Reviewed-by: Jinliang Zheng <alexjlzheng@...cent.com>
Signed-off-by: MengEn Sun <mengensun@...cent.com>
---
 mm/vmstat.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/mm/vmstat.c b/mm/vmstat.c
index 1917c034c045..32768fb8f769 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -2024,8 +2024,13 @@ static bool need_update(int cpu)
 
 	for_each_populated_zone(zone) {
 		struct per_cpu_zonestat *pzstats = per_cpu_ptr(zone->per_cpu_zonestats, cpu);
+		struct per_cpu_pages *pcp = per_cpu_ptr(zone->per_cpu_pageset, cpu);
 		struct per_cpu_nodestat *n;
 
+		/* in onhz or nohz full make pcp decay work */
+		if (pcp->high_max > pcp->high_min)
+			return true;
+
 		/*
 		 * The fast way of checking if there are any vmstat diffs.
 		 */
-- 
2.43.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ