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: <20240620121020.869707-1-ruanjinjie@huawei.com>
Date: Thu, 20 Jun 2024 20:10:20 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
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>, <linux-kernel@...r.kernel.org>
CC: <ruanjinjie@...wei.com>
Subject: [PATCH] sched/preempt: Bypass setting same mode for sched_dynamic_update()

If the preempt mode to set is same with current preempt mode, there is no
need to update all the `cond_resched`, `might_resched`, `preempt_schedule`,
`preempt_schedule_notrace` and `irqentry_exit_cond_resched` state.

Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
---
 kernel/sched/core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index bcf2c4cc0522..eb409901c64c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8777,6 +8777,9 @@ static bool klp_override;
 
 static void __sched_dynamic_update(int mode)
 {
+	if (mode == preempt_dynamic_mode)
+		return;
+
 	/*
 	 * Avoid {NONE,VOLUNTARY} -> FULL transitions from ever ending up in
 	 * the ZERO state, which is invalid.
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ