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-prev] [day] [month] [year] [list]
Message-Id: <20240112091916.696185-2-songshuaishuai@tinylab.org>
Date: Fri, 12 Jan 2024 17:19:16 +0800
From: Song Shuai <songshuaishuai@...ylab.org>
To: mingo@...hat.com,
	peterz@...radead.org,
	juri.lelli@...hat.com,
	vincent.guittot@...aro.org,
	dietmar.eggemann@....com,
	rostedt@...dmis.org,
	bsegall@...gle.com,
	mgorman@...e.de,
	bristot@...hat.com,
	vschneid@...hat.com
Cc: linux-kernel@...r.kernel.org,
	Song Shuai <songshuaishuai@...ylab.org>
Subject: [PATCH 2/2] sched/preempt: Avoid updating for duplicate preempt mode

When echoing the current preempt mode to /sys/kernel/debug/sched/preempt,
we don't have to update SC or SK in the sched_dynamic_update() function.

Stop it at the sched_dynamic_write() function.

Signed-off-by: Song Shuai <songshuaishuai@...ylab.org>
---
 kernel/sched/debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 4580a450700e..dafcfdfae23d 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -235,7 +235,8 @@ static ssize_t sched_dynamic_write(struct file *filp, const char __user *ubuf,
 	if (mode < 0)
 		return mode;
 
-	sched_dynamic_update(mode);
+	if (preempt_dynamic_mode != mode)
+		sched_dynamic_update(mode);
 
 	*ppos += cnt;
 
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ