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]
Date:   Sat, 16 Oct 2021 19:11:09 +0800
From:   Barry Song <21cnbao@...il.com>
To:     bristot@...hat.com, bsegall@...gle.com, dietmar.eggemann@....com,
        juri.lelli@...hat.com, mgorman@...e.de, mingo@...hat.com,
        peterz@...radead.org, rostedt@...dmis.org,
        vincent.guittot@...aro.org
Cc:     linux-kernel@...r.kernel.org, linuxarm@...wei.com,
        yangyicong@...ilicon.com, Barry Song <song.bao.hua@...ilicon.com>
Subject: [PATCH v2] sched/fair: Document the slow path and fast path in select_task_rq_fair

From: Barry Song <song.bao.hua@...ilicon.com>

All People I know including myself took a long time to figure out
that typical wakeup will always go to fast path and never go to
slow path except WF_FORK and WF_EXEC.
Vincent reminded me once in a linaro meeting and made me understand
slow path won't happen for WF_TTWU. But my other friends repeatedly
wasted a lot of time on testing this path like me before I reminded
them.
So obviously the code needs some document.

Cc: Vincent Guittot <vincent.guittot@...aro.org>
Signed-off-by: Barry Song <song.bao.hua@...ilicon.com>
---
 -v2: refine according to Steven's comments, thanks!

 kernel/sched/fair.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f6a05d9b5443..816c8ddf1b6d 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6951,6 +6951,11 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
 			break;
 		}
 
+		/*
+		 * Usually only true for WF_EXEC and WF_FORK, as sched_domains
+		 * usually do not have SD_BALANCE_WAKE set. That means wakeup
+		 * will usually go to the fast path.
+		 */
 		if (tmp->flags & sd_flag)
 			sd = tmp;
 		else if (!want_affine)
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ