linux-uconsole/include/linux/sched
Patrick Bellasi 613eecebf9 UPSTREAM: sched/uclamp: Add system default clamps
Tasks without a user-defined clamp value are considered not clamped
and by default their utilization can have any value in the
[0..SCHED_CAPACITY_SCALE] range.

Tasks with a user-defined clamp value are allowed to request any value
in that range, and the required clamp is unconditionally enforced.
However, a "System Management Software" could be interested in limiting
the range of clamp values allowed for all tasks.

Add a privileged interface to define a system default configuration via:

  /proc/sys/kernel/sched_uclamp_util_{min,max}

which works as an unconditional clamp range restriction for all tasks.

With the default configuration, the full SCHED_CAPACITY_SCALE range of
values is allowed for each clamp index. Otherwise, the task-specific
clamp is capped by the corresponding system default value.

Do that by tracking, for each task, the "effective" clamp value and
bucket the task has been refcounted in at enqueue time. This
allows to lazy aggregate "requested" and "system default" values at
enqueue time and simplifies refcounting updates at dequeue time.

The cached bucket ids are used to avoid (relatively) more expensive
integer divisions every time a task is enqueued.

An active flag is used to report when the "effective" value is valid and
thus the task is actually refcounted in the corresponding rq's bucket.

Bug: 120440300
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.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: Tejun Heo <tj@kernel.org>
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/20190621084217.8167-5-patrick.bellasi@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit e8f14172c6)
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: I4f014c5ec9c312aaad606518f6e205fd0cfbcaa2
Signed-off-by: Quentin Perret <qperret@google.com>
2020-02-01 14:39:37 +00:00
..
autogroup.h
clock.h
coredump.h
cpufreq.h This is the 4.19.92 stable release 2019-12-31 17:11:54 +01:00
cputime.h
deadline.h
debug.h
hotplug.h
idle.h
init.h
isolation.h
jobctl.h
loadavg.h UPSTREAM: sched: loadavg: make calc_load_n() public 2019-03-21 16:25:27 -07:00
mm.h sched/membarrier: Call sync_core only before usermode for same mm 2019-10-11 18:21:21 +02:00
nohz.h
numa_balancing.h sched/fair: Don't free p->numa_faults with concurrent readers 2019-08-04 09:30:56 +02:00
prio.h
rt.h
signal.h ptrace: take into account saved_sigmask in PTRACE{GET,SET}SIGMASK 2019-05-04 09:20:22 +02:00
smt.h
stat.h
sysctl.h UPSTREAM: sched/uclamp: Add system default clamps 2020-02-01 14:39:37 +00:00
task.h fork: fix some -Wmissing-prototypes warnings 2019-12-05 09:21:04 +01:00
task_stack.h
topology.h UPSTREAM: sched/uclamp: Add CPU's clamp buckets refcounting 2020-02-01 14:39:37 +00:00
user.h
wake_q.h
xacct.h