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: <20240112091916.696185-1-songshuaishuai@tinylab.org>
Date: Fri, 12 Jan 2024 17:19:15 +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 1/2] sched/preempt: Remove preceding unnecessary enables in __sched_dynamic_update

The preempt mode transitions are based on SC's static_call_update()
and SK's static_key_enable/disable() APIs.

Once these static calls and static keys are initialized, APIs can
work well regardless of the states of them (detailly speaking, the
instructions in SC's call site/trampoline or SK's jump_entry::code).

There is no need to enable these points all at the beginning,
updating them directly is enough.

Signed-off-by: Song Shuai <songshuaishuai@...ylab.org>
---
 kernel/sched/core.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index a708d225c28e..6931da32f6a6 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8732,17 +8732,6 @@ static bool klp_override;
 
 static void __sched_dynamic_update(int mode)
 {
-	/*
-	 * Avoid {NONE,VOLUNTARY} -> FULL transitions from ever ending up in
-	 * the ZERO state, which is invalid.
-	 */
-	if (!klp_override)
-		preempt_dynamic_enable(cond_resched);
-	preempt_dynamic_enable(might_resched);
-	preempt_dynamic_enable(preempt_schedule);
-	preempt_dynamic_enable(preempt_schedule_notrace);
-	preempt_dynamic_enable(irqentry_exit_cond_resched);
-
 	switch (mode) {
 	case preempt_dynamic_none:
 		if (!klp_override)
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ