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>] [day] [month] [year] [list]
Message-ID: <20240105040159.5026-1-zegao@tencent.com>
Date: Thu,  4 Jan 2024 23:01:59 -0500
From: Ze Gao <zegao2021@...il.com>
To: Ben Segall <bsegall@...gle.com>,
	Daniel Bristot de Oliveira <bristot@...hat.com>,
	Dietmar Eggemann <dietmar.eggemann@....com>,
	Ingo Molnar <mingo@...hat.com>,
	Juri Lelli <juri.lelli@...hat.com>,
	Mel Gorman <mgorman@...e.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Valentin Schneider <vschneid@...hat.com>,
	Vincent Guittot <vincent.guittot@...aro.org>
Cc: linux-kernel@...r.kernel.org,
	Ze Gao <zegao@...cent.com>
Subject: [PATCH] sched: save to call pick_eevdf when TIF_NEED_RESCHED is set

We now can have TIF_NEED_RESCHED set from update_curr()
in check_preempt_wakeup_fair(), so check to save to call
pick_eevdf once it's set and defer the possible picking
to where schedule() is called.

Signed-off-by: Ze Gao <zegao@...cent.com>
---
 kernel/sched/fair.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index d7a3c63a2171..28b2860e1f09 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -8273,6 +8273,12 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int
 	cfs_rq = cfs_rq_of(se);
 	update_curr(cfs_rq);
 
+	/*
+	 * We can come here with TIF_NEED_RESCHED already set from update_curr,
+	 * check to save one call to pick_eevdf if it's set.
+	 */
+	if (test_tsk_need_resched(curr))
+		return;
 	/*
 	 * XXX pick_eevdf(cfs_rq) != se ?
 	 */
-- 
2.41.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ