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: <172837417886.1442.7238050482563919227.tip-bot2@tip-bot2>
Date: Tue, 08 Oct 2024 07:56:18 -0000
From: "tip-bot2 for Huang Shijie" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Huang Shijie <shijie@...amperecomputing.com>,
 "Peter Zijlstra (Intel)" <peterz@...radead.org>,
 "Christoph Lameter (Ampere)" <cl@...ux.com>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject:
 [tip: sched/core] sched/fair: optimize the PLACE_LAG when se->vlag is zero

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     4423af84b29794a9bd2bd07188d8e71083e54c61
Gitweb:        https://git.kernel.org/tip/4423af84b29794a9bd2bd07188d8e71083e54c61
Author:        Huang Shijie <shijie@...amperecomputing.com>
AuthorDate:    Tue, 01 Oct 2024 15:00:21 +08:00
Committer:     Peter Zijlstra <peterz@...radead.org>
CommitterDate: Mon, 07 Oct 2024 09:28:41 +02:00

sched/fair: optimize the PLACE_LAG when se->vlag is zero

When PLACE_LAG is enabled, from the relationship:
            vl_i = (W + w_i)*vl'_i / W
we know that if vl'_i(se->vlag) is zero, the vl_i is zero too.

So if se->vlag is zero, there is no need to waste cycles to
do the calculation.

Signed-off-by: Huang Shijie <shijie@...amperecomputing.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Christoph Lameter (Ampere) <cl@...ux.com>
Link: https://lkml.kernel.org/r/20241001070021.10626-1-shijie@os.amperecomputing.com
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c9e3b8d..5a62121 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5280,7 +5280,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
 	 *
 	 * EEVDF: placement strategy #1 / #2
 	 */
-	if (sched_feat(PLACE_LAG) && cfs_rq->nr_running) {
+	if (sched_feat(PLACE_LAG) && cfs_rq->nr_running && se->vlag) {
 		struct sched_entity *curr = cfs_rq->curr;
 		unsigned long load;
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ