linux/kernel/sched
Patrick Bellasi c4c03cf9bf UPSTREAM: sched/uclamp: Propagate system defaults to the root group
The clamp values are not tunable at the level of the root task group.
That's for two main reasons:

 - the root group represents "system resources" which are always
   entirely available from the cgroup standpoint.

 - when tuning/restricting "system resources" makes sense, tuning must
   be done using a system wide API which should also be available when
   control groups are not.

When a system wide restriction is available, cgroups should be aware of
its value in order to know exactly how much "system resources" are
available for the subgroups.

Utilization clamping supports already the concepts of:

 - system defaults: which define the maximum possible clamp values
   usable by tasks.

 - effective clamps: which allows a parent cgroup to constraint (maybe
   temporarily) its descendants without losing the information related
   to the values "requested" from them.

Exploit these two concepts and bind them together in such a way that,
whenever system default are tuned, the new values are propagated to
(possibly) restrict or relax the "effective" value of nested cgroups.

When cgroups are in use, force an update of all the RUNNABLE tasks.
Otherwise, keep things simple and do just a lazy update next time each
task will be enqueued.
Do that since we assume a more strict resource control is required when
cgroups are in use. This allows also to keep "effective" clamp values
updated in case we need to expose them to user-space.

Bug: 120440300
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Michal Koutny <mkoutny@suse.com>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Alessio Balsini <balsini@android.com>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Joel Fernandes <joelaf@google.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Morten Rasmussen <morten.rasmussen@arm.com>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Perret <quentin.perret@arm.com>
Cc: Rafael J . Wysocki <rafael.j.wysocki@intel.com>
Cc: Steve Muckle <smuckle@google.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Todd Kjos <tkjos@google.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lkml.kernel.org/r/20190822132811.31294-4-patrick.bellasi@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit 7274a5c1bb)
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: Ibf7ce5c46b67c79765b56b792ee22ed9595802c3
Signed-off-by: Quentin Perret <qperret@google.com>
2020-02-01 15:03:14 +00:00
..
autogroup.c ANDROID: sched/autogroup: Define autogroup_path() for !CONFIG_SCHED_DEBUG 2018-10-26 12:44:03 +01:00
autogroup.h
clock.c sched/clock: Disable interrupts when calling generic_sched_clock_init() 2018-07-30 19:33:35 +02:00
completion.c sched/Documentation: Update wake_up() & co. memory-barrier guarantees 2018-07-17 09:30:34 +02:00
core.c UPSTREAM: sched/uclamp: Propagate system defaults to the root group 2020-02-01 15:03:14 +00:00
cpuacct.c
cpudeadline.c
cpudeadline.h
cpufreq_schedutil.c BACKPORT: sched/uclamp: Add uclamp support to energy_compute() 2020-02-01 15:03:14 +00:00
cpufreq.c cpufreq: Avoid leaving stale IRQ work items during CPU offline 2019-12-31 16:36:22 +01:00
cpupri.c
cpupri.h
cputime.c This is the 4.19.82 stable release 2019-11-06 13:21:58 +01:00
deadline.c This is the 4.19.77 stable release 2019-10-06 11:27:45 +02:00
debug.c jump_label: move 'asm goto' support test to Kconfig 2019-06-04 08:02:34 +02:00
fair.c BACKPORT: sched/uclamp: Add uclamp support to energy_compute() 2020-02-01 15:03:14 +00:00
features.h ANDROID: sched: Disable find_best_target() by default 2019-03-27 15:58:02 +00:00
idle.c This is the 4.19.77 stable release 2019-10-06 11:27:45 +02:00
isolation.c
loadavg.c UPSTREAM: sched: loadavg: make calc_load_n() public 2019-03-21 16:25:27 -07:00
Makefile UPSTREAM: psi: pressure stall information for CPU, memory, and IO 2019-03-21 16:25:27 -07:00
membarrier.c sched/membarrier: Fix private expedited registration check 2019-10-11 18:21:22 +02:00
pelt.c UPSTREAM: sched/fair: Update scale invariance of PELT 2019-03-26 14:22:50 +00:00
pelt.h UPSTREAM: sched/fair: Update scale invariance of PELT 2019-03-26 14:22:50 +00:00
psi.c UPSTREAM: psi: get poll_work to run when calling poll syscall next time 2019-09-19 23:59:24 +00:00
rt.c BACKPORT: sched/cpufreq, sched/uclamp: Add clamps for FAIR and RT tasks 2020-02-01 14:39:38 +00:00
sched-pelt.h sched/fair: Fix "runnable_avg_yN_inv" not used warnings 2019-07-26 09:14:08 +02:00
sched.h UPSTREAM: sched/uclamp: Propagate parent clamps 2020-02-01 15:03:14 +00:00
stats.c proc: introduce proc_create_seq{,_data} 2018-05-16 07:23:35 +02:00
stats.h UPSTREAM: psi: make disabling/enabling easier for vendor kernels 2019-03-21 16:25:27 -07:00
stop_task.c FROMLIST: sched/fair: Use wake_q length as a hint for wake_wide 2018-10-26 12:15:52 +01:00
swait.c sched/swait: Rename to exclusive 2018-06-20 11:35:56 +02:00
topology.c This is the 4.19.87 stable release 2019-12-01 09:53:43 +01:00
tune.c ANDROID: Add hold functionality to schedtune CPU boost 2018-10-26 12:44:06 +01:00
tune.h ANDROID: sched/rt: Add schedtune accounting to rt task enqueue/dequeue 2018-10-26 12:44:06 +01:00
wait_bit.c sched/wait: Improve __var_waitqueue() code generation 2018-03-20 08:23:25 +01:00
wait.c sched/wait: assert the wait_queue_head lock is held in __wake_up_common 2018-08-22 10:52:47 -07:00