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: <tip-b8fd8423697b9ec729c5bb91737faad84ae19985@git.kernel.org>
Date:   Sat, 14 Jan 2017 04:48:52 -0800
From:   tip-bot for Dietmar Eggemann <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     tglx@...utronix.de, dietmar.eggemann@....com, pjt@...nel.org,
        hpa@...or.com, efault@....de, samuel.thibault@...-lyon.org,
        mingo@...nel.org, torvalds@...ux-foundation.org,
        linux-kernel@...r.kernel.org, peterz@...radead.org
Subject: [tip:sched/core] sched/fair: Explain why MIN_SHARES isn't scaled in
 calc_cfs_shares()

Commit-ID:  b8fd8423697b9ec729c5bb91737faad84ae19985
Gitweb:     http://git.kernel.org/tip/b8fd8423697b9ec729c5bb91737faad84ae19985
Author:     Dietmar Eggemann <dietmar.eggemann@....com>
AuthorDate: Wed, 11 Jan 2017 11:29:47 +0000
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Sat, 14 Jan 2017 11:30:02 +0100

sched/fair: Explain why MIN_SHARES isn't scaled in calc_cfs_shares()

Signed-off-by: Dietmar Eggemann <dietmar.eggemann@....com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Mike Galbraith <efault@....de>
Cc: Paul Turner <pjt@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Samuel Thibault <samuel.thibault@...-lyon.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Link: http://lkml.kernel.org/r/e9a4d858-bcf3-36b9-e3a9-449953e34569@arm.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 kernel/sched/fair.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 2b866a2..274c747 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2657,6 +2657,18 @@ static long calc_cfs_shares(struct cfs_rq *cfs_rq, struct task_group *tg)
 	if (tg_weight)
 		shares /= tg_weight;
 
+	/*
+	 * MIN_SHARES has to be unscaled here to support per-CPU partitioning
+	 * of a group with small tg->shares value. It is a floor value which is
+	 * assigned as a minimum load.weight to the sched_entity representing
+	 * the group on a CPU.
+	 *
+	 * E.g. on 64-bit for a group with tg->shares of scale_load(15)=15*1024
+	 * on an 8-core system with 8 tasks each runnable on one CPU shares has
+	 * to be 15*1024*1/8=1920 instead of scale_load(MIN_SHARES)=2*1024. In
+	 * case no task is runnable on a CPU MIN_SHARES=2 should be returned
+	 * instead of 0.
+	 */
 	if (shares < MIN_SHARES)
 		shares = MIN_SHARES;
 	if (shares > tg->shares)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ