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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-a87498ace58e23b62a572dc7267579ede4c8495c@git.kernel.org>
Date:   Tue, 25 Jun 2019 01:34:19 -0700
From:   tip-bot for Patrick Bellasi <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     viresh.kumar@...aro.org, hpa@...or.com, pjt@...gle.com,
        vincent.guittot@...aro.org, tkjos@...gle.com,
        linux-kernel@...r.kernel.org, smuckle@...gle.com,
        peterz@...radead.org, mingo@...nel.org, joelaf@...gle.com,
        tglx@...utronix.de, dietmar.eggemann@....com, balsini@...roid.com,
        quentin.perret@....com, patrick.bellasi@....com,
        morten.rasmussen@....com, rafael.j.wysocki@...el.com,
        tj@...nel.org, juri.lelli@...hat.com, surenb@...gle.com,
        torvalds@...ux-foundation.org
Subject: [tip:sched/core] sched/uclamp: Reset uclamp values on RESET_ON_FORK

Commit-ID:  a87498ace58e23b62a572dc7267579ede4c8495c
Gitweb:     https://git.kernel.org/tip/a87498ace58e23b62a572dc7267579ede4c8495c
Author:     Patrick Bellasi <patrick.bellasi@....com>
AuthorDate: Fri, 21 Jun 2019 09:42:08 +0100
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 24 Jun 2019 19:23:47 +0200

sched/uclamp: Reset uclamp values on RESET_ON_FORK

A forked tasks gets the same clamp values of its parent however, when
the RESET_ON_FORK flag is set on parent, e.g. via:

   sys_sched_setattr()
      sched_setattr()
         __sched_setscheduler(attr::SCHED_FLAG_RESET_ON_FORK)

the new forked task is expected to start with all attributes reset to
default values.

Do that for utilization clamp values too by checking the reset request
from the existing uclamp_fork() call which already provides the required
initialization for other uclamp related bits.

Signed-off-by: Patrick Bellasi <patrick.bellasi@....com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Alessio Balsini <balsini@...roid.com>
Cc: Dietmar Eggemann <dietmar.eggemann@....com>
Cc: Joel Fernandes <joelaf@...gle.com>
Cc: Juri Lelli <juri.lelli@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Morten Rasmussen <morten.rasmussen@....com>
Cc: Paul Turner <pjt@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Quentin Perret <quentin.perret@....com>
Cc: Rafael J . Wysocki <rafael.j.wysocki@...el.com>
Cc: Steve Muckle <smuckle@...gle.com>
Cc: Suren Baghdasaryan <surenb@...gle.com>
Cc: Tejun Heo <tj@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Todd Kjos <tkjos@...gle.com>
Cc: Vincent Guittot <vincent.guittot@...aro.org>
Cc: Viresh Kumar <viresh.kumar@...aro.org>
Link: https://lkml.kernel.org/r/20190621084217.8167-8-patrick.bellasi@arm.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 kernel/sched/core.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index e9a669266fa9..ecc304ab906f 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1082,6 +1082,14 @@ static void uclamp_fork(struct task_struct *p)
 
 	for_each_clamp_id(clamp_id)
 		p->uclamp[clamp_id].active = false;
+
+	if (likely(!p->sched_reset_on_fork))
+		return;
+
+	for_each_clamp_id(clamp_id) {
+		uclamp_se_set(&p->uclamp_req[clamp_id],
+			      uclamp_none(clamp_id), false);
+	}
 }
 
 static void __init init_uclamp(void)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ