1826 Commits

Author SHA1 Message Date
utziacre
9b855c59b9 sched/core: Introduce UClamp Assist
Change-Id: Iaa52df37363472ed06fe265f0e1966435bc91e76
Signed-off-by: Helium-Studio <67852324+Helium-Studio@users.noreply.github.com>
2024-08-17 18:30:58 +03:00
John Galt
1c8173c131 sched-pelt: make half life nonconfigurable
16ms only
2024-08-12 21:00:38 +03:00
EmanuelCN
b9553dd472 init: Enable SCHED_THERMAL_PRESSURE by default
Signed-off-by: Helium-Studio <67852324+Helium-Studio@users.noreply.github.com>
2024-08-12 21:00:36 +03:00
Thara Gopinath
6017c1dbc1 sched/pelt: Add support to track thermal pressure
Extrapolating on the existing framework to track rt/dl utilization using
pelt signals, add a similar mechanism to track thermal pressure. The
difference here from rt/dl utilization tracking is that, instead of
tracking time spent by a CPU running a RT/DL task through util_avg, the
average thermal pressure is tracked through load_avg. This is because
thermal pressure signal is weighted time "delta" capacity unlike util_avg
which is binary. "delta capacity" here means delta between the actual
capacity of a CPU and the decreased capacity a CPU due to a thermal event.

In order to track average thermal pressure, a new sched_avg variable
avg_thermal is introduced. Function update_thermal_load_avg can be called
to do the periodic bookkeeping (accumulate, decay and average) of the
thermal pressure.

Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20200222005213.3873-2-thara.gopinath@linaro.org
Signed-off-by: Divyanshu-Modi <divyan.m05@gmail.com>
Signed-off-by: Helium-Studio <67852324+Helium-Studio@users.noreply.github.com>
2024-08-12 21:00:34 +03:00
Vincent Guittot
434002f2f7 sched/pelt: Fix warning and clean up IRQ PELT config
Commit 11d4afd4ff667f9b6178ee8c142c36cb78bd84db upstream.

Create a config for enabling irq load tracking in the scheduler.
irq load tracking is useful only when irq or paravirtual time is
accounted but it's only possible with SMP for now.

Also use __maybe_unused to remove the compilation warning in
update_rq_clock_task() that has been introduced by:

  2e62c4743adc ("sched/fair: Remove #ifdefs from scale_rt_capacity()")

Suggested-by: Ingo Molnar <mingo@redhat.com>
Reported-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
Reported-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@alien8.de
Cc: dou_liyang@163.com
Fixes: 2e62c4743adc ("sched/fair: Remove #ifdefs from scale_rt_capacity()")
Link: http://lkml.kernel.org/r/1537867062-27285-1-git-send-email-vincent.guittot@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Helium-Studio <67852324+Helium-Studio@users.noreply.github.com>
2024-08-12 21:00:33 +03:00
kondors1995
e9b310c8d7 sched:reland to f5fd7051d6 2024-08-12 20:59:24 +03:00
kondors1995
9701f583c7 Merge branch '14.0' into 14.0-matrix 2024-06-09 12:39:33 +03:00
SK00RUPA
29a1ff2b6d Merge tag 'v4.14.345-openela' into 14.0
This is the 4.14.345 OpenELA-Extended LTS stable release
2024-06-04 17:31:52 +02:00
utziacre
a12f313413 sched/core: Introduce UClamp Assist
Change-Id: Iaa52df37363472ed06fe265f0e1966435bc91e76
Signed-off-by: Helium-Studio <67852324+Helium-Studio@users.noreply.github.com>
2024-06-02 13:24:40 +03:00
kondors1995
d4d1b4004c Revert "kernel: Restore schedtune compatibility"
This reverts commit 5d079db98a.
2024-06-02 13:21:20 +03:00
John Sperbeck
b38a90afb4 init: open /initrd.image with O_LARGEFILE
[ Upstream commit 4624b346cf67400ef46a31771011fb798dd2f999 ]

If initrd data is larger than 2Gb, we'll eventually fail to write to the
/initrd.image file when we hit that limit, unless O_LARGEFILE is set.

Link: https://lkml.kernel.org/r/20240317221522.896040-1-jsperbeck@google.com
Signed-off-by: John Sperbeck <jsperbeck@google.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 9f0dcca773117f0b240d1db97db27f0b8aac106a)
[Vegard: fix conflicts due to missing various initramfs refactoring commits]
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-05-30 09:00:43 +00:00
kondors1995
d9e0aeabc2 Merge branch '14.0' into 14.0-matrix 2024-05-11 09:51:18 +03:00
Vincent Guittot
70c514a0a3 sched/pelt: Fix warning and clean up IRQ PELT config
Commit 11d4afd4ff667f9b6178ee8c142c36cb78bd84db upstream.

Create a config for enabling irq load tracking in the scheduler.
irq load tracking is useful only when irq or paravirtual time is
accounted but it's only possible with SMP for now.

Also use __maybe_unused to remove the compilation warning in
update_rq_clock_task() that has been introduced by:

  2e62c4743adc ("sched/fair: Remove #ifdefs from scale_rt_capacity()")

Suggested-by: Ingo Molnar <mingo@redhat.com>
Reported-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
Reported-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@alien8.de
Cc: dou_liyang@163.com
Fixes: 2e62c4743adc ("sched/fair: Remove #ifdefs from scale_rt_capacity()")
Link: http://lkml.kernel.org/r/1537867062-27285-1-git-send-email-vincent.guittot@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-05-10 17:07:56 +03:00
John Galt
5fa4ac86cb sched-pelt: make half life nonconfigurable
16ms only
2024-04-25 10:39:33 +03:00
EmanuelCN
83ff56b0e0 init: Enable SCHED_THERMAL_PRESSURE by default 2024-04-25 10:39:31 +03:00
Thara Gopinath
360d1cba49 sched/pelt: Add support to track thermal pressure
Extrapolating on the existing framework to track rt/dl utilization using
pelt signals, add a similar mechanism to track thermal pressure. The
difference here from rt/dl utilization tracking is that, instead of
tracking time spent by a CPU running a RT/DL task through util_avg, the
average thermal pressure is tracked through load_avg. This is because
thermal pressure signal is weighted time "delta" capacity unlike util_avg
which is binary. "delta capacity" here means delta between the actual
capacity of a CPU and the decreased capacity a CPU due to a thermal event.

In order to track average thermal pressure, a new sched_avg variable
avg_thermal is introduced. Function update_thermal_load_avg can be called
to do the periodic bookkeeping (accumulate, decay and average) of the
thermal pressure.

Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20200222005213.3873-2-thara.gopinath@linaro.org
2024-04-25 10:39:29 +03:00
John Galt
1104f85adf sched-pelt: make half life nonconfigurable
16ms only
2024-04-23 11:48:31 +03:00
EmanuelCN
f37730e9fc init: Enable SCHED_THERMAL_PRESSURE by default 2024-04-23 11:35:30 +03:00
Thara Gopinath
a7554f783b sched/pelt: Add support to track thermal pressure
Extrapolating on the existing framework to track rt/dl utilization using
pelt signals, add a similar mechanism to track thermal pressure. The
difference here from rt/dl utilization tracking is that, instead of
tracking time spent by a CPU running a RT/DL task through util_avg, the
average thermal pressure is tracked through load_avg. This is because
thermal pressure signal is weighted time "delta" capacity unlike util_avg
which is binary. "delta capacity" here means delta between the actual
capacity of a CPU and the decreased capacity a CPU due to a thermal event.

In order to track average thermal pressure, a new sched_avg variable
avg_thermal is introduced. Function update_thermal_load_avg can be called
to do the periodic bookkeeping (accumulate, decay and average) of the
thermal pressure.

Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20200222005213.3873-2-thara.gopinath@linaro.org
2024-04-23 11:35:29 +03:00
kondors1995
af30df53ee treeweide: Revert Pixel 8 cass backports
Someting caused issues with media playback

Squashed commit of the following:

commit 9b42dfb148a86d279550e50e7374c799a03a5a6f
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:41 2024 +0300

    Revert "sched/fair: Clean up calc_cfs_shares()"

    This reverts commit 09f624912f.

commit 8acb165e9e42219646fd3e6d6c3f51a6f702a686
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:32 2024 +0300

    Revert "sched/fair: Add comment to calc_cfs_shares()"

    This reverts commit f9d3ffd696.

commit 423c42eb6eb17ad7f3f33cdab7fdf1ff0f98dc79
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:32 2024 +0300

    Revert "sched/fair: Cure calc_cfs_shares() vs. reweight_entity()"

    This reverts commit 82b9ddd10d.

commit 1093143c06279c2d89b3241ac3e5abf339f7abcd
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:31 2024 +0300

    Revert "sched/fair: Remove se->load.weight from se->avg.load_sum"

    This reverts commit 8afedeb608.

commit 4504e6b8c2119e092e831879cbd9c6adaea2713a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:31 2024 +0300

    Revert "sched: remove rt_rq utilization tracking for now"

    This reverts commit ca1bdfe9c2.

commit db5377a1b2868ffc6d3f33225353c33398e1de7b
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:30 2024 +0300

    Revert "sched/fair: Change update_load_avg() arguments"

    This reverts commit 561a960285.

commit d099da1d8854cbbdb8fca1c4eaf4f692f940a6c7
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:30 2024 +0300

    Revert "sched/fair: Move enqueue migrate handling"

    This reverts commit 4fe3a618af.

commit 9b8f11264e1bd21ecfd69b6c77e88d9893e20a98
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:29 2024 +0300

    Revert "sched/fair: Rename {en,de}queue_entity_load_avg()"

    This reverts commit 86597c5bf2.

commit 382d23f36c9c5430b0f96cbf379ded416bc1f330
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:29 2024 +0300

    Revert "sched/fair: Introduce {en,de}queue_load_avg()"

    This reverts commit 04ee68d87c.

commit 7d7c60a4d4ceb493f40703bf596ac949df31dd33
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:28 2024 +0300

    Revert "sched/fair: More accurate reweight_entity()"

    This reverts commit ec54bd1f93.

commit afcd60d3ee87de1d4f069acc713e2097d9b40be8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:28 2024 +0300

    Revert "sched/fair: Use reweight_entity() for set_user_nice()"

    This reverts commit 0d5a173dfd.

commit af78e8c698df9201648634d7dd1e4804494a765d
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:27 2024 +0300

    Revert "sched/fair: Rewrite cfs_rq->removed_*avg"

    This reverts commit 7b0d11dc5a.

commit 2a44c05e1f96b14f80ea578b386af04eb24e5aac
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:27 2024 +0300

    Revert "sched/fair: Rewrite PELT migration propagation"

    This reverts commit dc3a4b3e44.

commit a876ca5f4b2937b8adc90b3f502376d45a891d54
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:26 2024 +0300

    Revert "sched/fair: Propagate an effective runnable_load_avg"

    This reverts commit 017d4c0519.

commit 8a0c9809f3fbabc583a485af142b40f0b9945a6d
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:26 2024 +0300

    Revert "sched/fair: Implement synchonous PELT detach on load-balance migrate"

    This reverts commit c240cbcefb.

commit 8d002da6ccedb08096a371826525e0e21587f469
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:25 2024 +0300

    Revert "sched/fair: Align PELT windows between cfs_rq and its se"

    This reverts commit 2b669872a6.

commit ceb6db696fe8210e0dc9ce1643fcea314ae84d68
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:25 2024 +0300

    Revert "sched/fair: Implement more accurate async detach"

    This reverts commit a5dce93362.

commit d6afb5da3f6ccc3c426ec6cef2c4b955b0127f79
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:25 2024 +0300

    Revert "sched/fair: Calculate runnable_weight slightly differently"

    This reverts commit 49af7a9c70.

commit 302db79364ce3cdd41e9b33f48a0d5a8c9818ded
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:24 2024 +0300

    Revert "sched/fair: Update calc_group_*() comments"

    This reverts commit 245ba7cfcb.

commit 61ec8d04a966c839f3f204e99e5006a1e42c816a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:23 2024 +0300

    Revert "sched/pelt: Move PELT related code in a dedicated file"

    This reverts commit 05c4270dbb.

commit 494151c770c9afcf2f4231029bb35d337385c5f8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:23 2024 +0300

    Revert "sched/rt: Add rt_rq utilization tracking"

    This reverts commit 1efbd97f33.

commit ee00f39c0c36fc5c7d17b9fc8f7a273acd537efe
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:22 2024 +0300

    Revert "sched: fix build"

    This reverts commit bead5679af.

commit c85ab7e00b755f7b0b008d0657ecc805755248e1
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:22 2024 +0300

    Revert "sched/dl: Add dl_rq utilization tracking"

    This reverts commit 1f48d4df0e.

commit d99ffef9a8069efde7bb85869280025b60519db6
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:21 2024 +0300

    Revert "sched/irq: Add IRQ utilization tracking"

    This reverts commit d1c9480337.

commit 2be20e582bf3129e9b572f6b39cef311d0fe3d15
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:20 2024 +0300

    Revert "sched/schedutil: add `schedutil_freq_util()`"

    This reverts commit f3e8cb0f44.

commit b495ca0e67d581fc7cc7d250d26d36fdeb8181c4
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:20 2024 +0300

    Revert "FROMLIST: sched: Relocate arch_scale_cpu_capacity"

    This reverts commit 844d670403.

commit 33c4a0dc0cfb20c02cdb705770f888343d11a1a0
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:19 2024 +0300

    Revert "sched: cpufreq: add map_util_freq()"

    This reverts commit 1f9df50075.

commit d2fedfac7610b0121e6338a8c64ac7414b5b5965
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:19 2024 +0300

    Revert "sched/pelt: Add support to track thermal pressure"

    This reverts commit 17e0388043.

commit afe91b6a918674b387deeb5ec201a3b7fd720c48
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:18 2024 +0300

    Revert "sched/topology: Add callback to read per CPU thermal pressure"

    This reverts commit 69693e21cc.

commit 760f1b0c528c1d2d8fe62be335d98caa74671f51
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:17 2024 +0300

    Revert "drivers/base/arch_topology: Add infrastructure to store and update instantaneous thermal pressure"

    This reverts commit 25a4c1f1a7.

commit 38dc404537a51df485fc1001a440d66f9e5bdfe3
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:17 2024 +0300

    Revert "arm64/topology: Populate arch_scale_thermal_pressure() for arm64 platforms"

    This reverts commit 27a4d5d4ed.

commit 9c1479b093688b09dcf386f019b34203c6dc1367
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:16 2024 +0300

    Revert "arm/topology: Populate arch_scale_thermal_pressure() for ARM platforms"

    This reverts commit 97e866391b.

commit 67039c6e35777ef753590f15f07190b9296a309c
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:16 2024 +0300

    Revert "sched/fair: Enable periodic update of average thermal pressure"

    This reverts commit 7ab5e58f6e.

commit 2a53cfee36bed22116d35da58ea944d5448910d8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:15 2024 +0300

    Revert "BACKPORT: thermal: cpu_cooling: Update thermal pressure in case of a maximum frequency capping"

    This reverts commit 7d4b5af102.

commit 618bb2f007c30c047bd72ec4764f4da321041382
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:14 2024 +0300

    Revert "UPSTREAM: thermal: cpu_cooling: Update also offline CPUs per-cpu thermal_pressure"

    This reverts commit ee683c1595.

commit 57938e1686bc19a3455355bde6df5b339db46b1b
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:14 2024 +0300

    Revert "sched/fair: Enable tuning of decay period"

    This reverts commit a00583df62.

commit a06182dc6401475c7eb31aed0965d13ebc6881d1
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:13 2024 +0300

    Revert "init: Enable SCHED_THERMAL_PRESSURE by default"

    This reverts commit dcf24600af.

commit 9e5796f48feeb87d2dd5966d4bdffa2c78fd559d
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:12 2024 +0300

    Revert "sched:schedutil: Reland at @65b6f06b6a"

    This reverts commit f1a3787c1f.

commit 5a99475c6807fbd3f6a4b88fe18ef9853de5dbb8
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:12 2024 +0300

    Revert "thermal: cpu_cooling: fix backport"

    This reverts commit 84c18edb67.

commit 78ecfc16e24ee2da5b6f39a30c67d1134c60ee55
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:11 2024 +0300

    Revert "thermal/cpu-cooling, sched/core: Move the arch_set_thermal_pressure() API to generic scheduler code"

    This reverts commit b5c0f9489d.

commit 7df5eb08365aad663f6aff85e47dd87e986b4bd6
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:10 2024 +0300

    Revert "sched/cass: Fix CPU selection when no candidate CPUs are idle"

    This reverts commit 545493ec2d.

commit ee830b6597ce40cc38dee0486ba5b6628eee86a5
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:10 2024 +0300

    Revert "sched/cass: Clean up local variable scope in cass_best_cpu()"

    This reverts commit 03bd4ff101.

commit 298863d627468afad930e3483f8f594af047f149
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:09 2024 +0300

    Revert "sched/cass:checkout to kerneltoast/android_kernel_google_zuma@63f0b82d3"

    This reverts commit 5d04a85007.

commit 5caf8ee3242cc9e531093620e9d0edf34d2d9bd5
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:09 2024 +0300

    Revert "sched/cass: Perform runqueue selection for RT tasks too"

    This reverts commit 9752c4351d.

commit 99b278beedd77cf50fd59af702712b84dfdb6358
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:08 2024 +0300

    Revert "sched/cass: Fix suboptimal task placement when uclamp is used"

    This reverts commit e6b365c5b5.

commit 3b36702eb33d772c3730bdba422c84b2750d0d8e
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:07 2024 +0300

    Revert "sched/cass: Only treat sync waker CPU as idle if there's one task running"

    This reverts commit d12d7eee39.

commit 3037abe8c3c25cfc906ad34ea4155874167835cc
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:07 2024 +0300

    Revert "sched/cass: Eliminate redundant calls to smp_processor_id()"

    This reverts commit f686c22d10.

commit 8bef770149584f5336390367ce20ac8e0991e523
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:06 2024 +0300

    Revert "sched/cass:Adapt for our sources"

    This reverts commit 15e0e548dd.

commit cf47e4130be6df5b4581451dcf712c14ef545044
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:05 2024 +0300

    Revert "sched/fair: Set migration cost to zero to leverage DynamIQ Shared Unit"

    This reverts commit 553243db2f.

commit 9a02852fc864ea71b5d426b5b7aceeba8c72281c
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:05 2024 +0300

    Revert "sbalance: Allow IRQs to be moved off of excluded CPUs"

    This reverts commit cba4cee059.

commit 072fd97abf76bca1587d5a6a183125d8c2667c49
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:04 2024 +0300

    Revert "sbalance: Use a deferrable timer to avoid waking idle CPUs"

    This reverts commit 9efd9574cd.

commit d788e1caba4bf5bc5d3a81d2a96cfbd4d3b51381
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:03 2024 +0300

    Revert "sbalance: Use non-atomic cpumask_clear_cpu() variant"

    This reverts commit 11502f0b2b.

commit be608ef254b24bc0f5a807676bc2aa37a75c0c41
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:03 2024 +0300

    Revert "sbalance: Fix systemic issues caused by flawed IRQ statistics"

    This reverts commit dca8268454.

commit d99703fa29615b4a9f5b051742cd2f64ad65ef53
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:02 2024 +0300

    Revert "cpufreq: schedutil: Use the frequency below the target if they're close"

    This reverts commit 9a7a26c904.

commit 1cf28ec326ca586bd9b5a555e777c0ce49a9371c
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:02 2024 +0300

    Revert "raphael_defconfig: Reduce IRQ_SBALANCE_POLL_MSEC to default 3000"

    This reverts commit ab033d4dca.

commit 53ce1242f7c643c525b239c464ba61cfcef3f5ea
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:01 2024 +0300

    Revert "Revert "cpufreq: schedutil: Use the frequency below the target if they're close""

    This reverts commit 217db388c4.

commit 63f8122b844e194bc197c2a17a11871651017af6
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:00 2024 +0300

    Revert "Revert "cpufreq: schedutil: Extend limit tunables to prime""

    This reverts commit 056441ef45.

commit 09c2c5be085b6c10a6ab974b84404badc85ff393
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:28:00 2024 +0300

    Revert "Revert "cpufreq: schedutil: Expose limit tunables cluster-wise""

    This reverts commit d4c03145b6.

commit f3473acea98f745b142608e182b163c08110affe
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:59 2024 +0300

    Revert "raphael_defconfig:Exclude core 3 from IRQ balancing"

    This reverts commit 1b7085aae6.

commit b7ce57d5f7480430cb9e530a3a7206f2dd6456e5
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:58 2024 +0300

    Revert "cpufreq: schedutil: Use the frequency below the target if they're close"

    This reverts commit b64b535bea.

commit c99a62857fd75daafe6a6a76fdfe20242fb59d9d
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:57 2024 +0300

    Revert "cpufreq: schedutil: Set default up/down rate limits to 500/1000 us"

    This reverts commit 2dff5ad0ff.

commit f505c93a25bc5d741b52e2e219ddd86fd9022976
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:57 2024 +0300

    Revert "cpufreq: schedutil: Protect default up/down rate limits"

    This reverts commit d0164cdf9a.

commit b5b279845790b0b072e3abf3886d5430434d30f4
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:56 2024 +0300

    Revert "drm: Convert CPU-invariant uninterruptible waits to TASK_IDLE"

    This reverts commit a252ff2d01.

commit 9575adb91c2880a5dbeff1fec93aac44295f939a
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:55 2024 +0300

    Revert "pm_qos: Use SRCU notifier chains"

    This reverts commit 29d5065905.

commit 644abfbbd422a8f6aa9902839cfee155b3496c24
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:55 2024 +0300

    Revert "sched/completion: Expose wait_for_common*() to drivers"

    This reverts commit 483d30a710.

commit 1fc08c6cd803c0c24421d5d992ea4b16357aeb92
Author: kondors1995 <normandija1945@gmail.com>
Date:   Fri Apr 19 10:27:51 2024 +0300

    Revert "treewide: Fix warnings"

    This reverts commit abfb9659df.
2024-04-21 22:19:43 +03:00
EmanuelCN
dcf24600af init: Enable SCHED_THERMAL_PRESSURE by default 2024-04-06 13:00:43 +03:00
Thara Gopinath
17e0388043 sched/pelt: Add support to track thermal pressure
Extrapolating on the existing framework to track rt/dl utilization using
pelt signals, add a similar mechanism to track thermal pressure. The
difference here from rt/dl utilization tracking is that, instead of
tracking time spent by a CPU running a RT/DL task through util_avg, the
average thermal pressure is tracked through load_avg. This is because
thermal pressure signal is weighted time "delta" capacity unlike util_avg
which is binary. "delta capacity" here means delta between the actual
capacity of a CPU and the decreased capacity a CPU due to a thermal event.

In order to track average thermal pressure, a new sched_avg variable
avg_thermal is introduced. Function update_thermal_load_avg can be called
to do the periodic bookkeeping (accumulate, decay and average) of the
thermal pressure.

Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20200222005213.3873-2-thara.gopinath@linaro.org
2024-04-06 13:00:42 +03:00
John Galt
f676ed7aa6 treewide: revert over inline optimization
For upcoming changes
2024-02-07 15:49:36 +02:00
John Galt
9eb2abcdb7 treewide: revert over inline optimization
For upcoming changes
2024-01-25 12:04:54 +02:00
kondors1995
455081ec67 Revert "uclamp_assist: Refactor and implement"
This reverts commit 854125967a.
2024-01-23 15:58:26 +02:00
kondors1995
6c7dc05396 Revert "kernel: Restore schedtune compatibility"
This reverts commit 5d079db98a.
2024-01-23 15:58:26 +02:00
kondors1995
a20d8243cf Merge branch '13.0' into 13.0-DSP 2023-10-11 15:41:10 +03:00
Sultan Alsawaf
f5062c7917 sched/cass: Introduce the Capacity Aware Superset Scheduler
The Capacity Aware Superset Scheduler (CASS) optimizes runqueue selection
of CFS tasks. By using CPU capacity as a basis for comparing the relative
utilization between different CPUs, CASS fairly balances load across CPUs
of varying capacities. This results in improved multi-core performance,
especially when CPUs are overutilized because CASS doesn't clip a CPU's
utilization when it eclipses the CPU's capacity.

As a superset of capacity aware scheduling, CASS implements a hierarchy of
criteria to determine the better CPU to wake a task upon between CPUs that
have the same relative utilization. This way, single-core performance,
latency, and cache affinity are all optimized where possible.

CASS doesn't feature explicit energy awareness but its basic load balancing
principle results in decreased overall energy, often better than what is
possible with explicit energy awareness. By fairly balancing load based on
relative utilization, all CPUs are kept at their lowest P-state necessary
to satisfy the overall load at any given moment.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2023-10-11 15:31:35 +03:00
kondors1995
f6fe079d8d Merge branch '13.0' into dev/DSP 2023-08-30 21:11:25 +03:00
kondors1995
7925c10117 Merge branch 'android-4.14-stable' of https://github.com/aosp-mirror/kernel_common into dev-base 2023-08-25 09:53:00 +03:00
Thomas Gleixner
ef54e26b2e init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init()
commit 439e17576eb47f26b78c5bbc72e344d4206d2327 upstream

Invoke the X86ism mem_encrypt_init() from X86 arch_cpu_finalize_init() and
remove the weak fallback from the core code.

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230613224545.670360645@linutronix.de
Signed-off-by: Daniel Sneddon <daniel.sneddon@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-08 19:48:24 +02:00
Thomas Gleixner
b90a399294 init: Invoke arch_cpu_finalize_init() earlier
commit 9df9d2f0471b4c4702670380b8d8a45b40b23a7d upstream

X86 is reworking the boot process so that initializations which are not
required during early boot can be moved into the late boot process and out
of the fragile and restricted initial boot phase.

arch_cpu_finalize_init() is the obvious place to do such initializations,
but arch_cpu_finalize_init() is invoked too late in start_kernel() e.g. for
initializing the FPU completely. fork_init() requires that the FPU is
initialized as the size of task_struct on X86 depends on the size of the
required FPU register buffer.

Fortunately none of the init calls between calibrate_delay() and
arch_cpu_finalize_init() is relevant for the functionality of
arch_cpu_finalize_init().

Invoke it right after calibrate_delay() where everything which is relevant
for arch_cpu_finalize_init() has been set up already.

No functional change intended.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Link: https://lore.kernel.org/r/20230613224545.612182854@linutronix.de
Signed-off-by: Daniel Sneddon <daniel.sneddon@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-08 19:48:24 +02:00
Thomas Gleixner
f81147af7b init: Remove check_bugs() leftovers
commit 61235b24b9cb37c13fcad5b9596d59a1afdcec30 upstream

Everything is converted over to arch_cpu_finalize_init(). Remove the
check_bugs() leftovers including the empty stubs in asm-generic, alpha,
parisc, powerpc and xtensa.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Link: https://lore.kernel.org/r/20230613224545.553215951@linutronix.de
Signed-off-by: Daniel Sneddon <daniel.sneddon@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-08 19:48:24 +02:00
Thomas Gleixner
01d36b819b init: Provide arch_cpu_finalize_init()
commit 7725acaa4f0c04fbefb0e0d342635b967bb7d414 upstream

check_bugs() has become a dumping ground for all sorts of activities to
finalize the CPU initialization before running the rest of the init code.

Most are empty, a few do actual bug checks, some do alternative patching
and some cobble a CPU advertisement string together....

Aside of that the current implementation requires duplicated function
declaration and mostly empty header files for them.

Provide a new function arch_cpu_finalize_init(). Provide a generic
declaration if CONFIG_ARCH_HAS_CPU_FINALIZE_INIT is selected and a stub
inline otherwise.

This requires a temporary #ifdef in start_kernel() which will be removed
along with check_bugs() once the architectures are converted over.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230613224544.957805717@linutronix.de
Signed-off-by: Daniel Sneddon <daniel.sneddon@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-08 19:48:23 +02:00
kondors1995
7fcdecc172 Revert "Revert "kernel: Restore schedtune compatibility""
This reverts commit 77c0f9e019.
2023-08-04 10:47:03 +03:00
kondors1995
be9aeb6ea1 Revert "Revert "uclamp_assist: Refactor and implement""
This reverts commit a166419c04.
2023-08-04 10:47:03 +03:00
kondors1995
a166419c04 Revert "uclamp_assist: Refactor and implement"
This reverts commit 854125967a.
2023-07-31 17:38:17 +03:00
kondors1995
77c0f9e019 Revert "kernel: Restore schedtune compatibility"
This reverts commit 5d079db98a.
2023-07-31 17:37:34 +03:00
Sebastiano Barezzi
fc4641f489 init: Add CONFIG_INITRAMFS_IGNORE_SKIP_FLAG
* Ignoring an ignore flag, yikes
* Also replace skip_initramf with want_initramf (omitting last letter for Magisk since it binary patches that out of kernel, I'm not even sure why we're supporting that mess)

Co-authored-by: Erfan Abdi <erfangplus@gmail.com>
Change-Id: Ifdf726f128bc66bf860bbb71024f94f56879710f
2023-03-21 13:32:42 +02:00
Nick Terrell
905c044b37 BACKPORT: init: Add support for zstd compressed kernel
- Add the zstd and zstd22 cmds to scripts/Makefile.lib

- Add the HAVE_KERNEL_ZSTD and KERNEL_ZSTD options

Architecture specific support is still needed for decompression.

Signed-off-by: Nick Terrell <terrelln@fb.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20200730190841.2071656-4-nickrterrell@gmail.com
[cyberknight777: backport to 4.14]
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
2023-03-16 18:10:40 +02:00
Wei Wang
7511f3428c init/main.c: add sync point between each level
With PROBE_PREFER_ASYNCHRONOUS, drivers have ability to do asynchronous
probing, however this might break promise of ordering. This patch is to
add additional sync point between each init level.

Test: Boot
Bug: 63716230
Bug: 77146523
Bug: 115776306
Bug: 116061339
Change-Id: I2d2add41b29eaeecd6e68adcd09d9f5ec40fb97d
Signed-off-by: Wei Wang <wvw@google.com>
(cherry picked from commit 772b2385237f32140df38a51c644b3ad485a726e)
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
2023-02-27 13:47:29 +02:00
Elena Reshetova
1a477a2949 sched/core: Convert task_struct.usage to refcount_t
atomic_t variables are currently used to implement reference
counters with the following properties:

 - counter is initialized to 1 using atomic_set()
 - a resource is freed upon counter reaching zero
 - once counter reaches zero, its further
   increments aren't allowed
 - counter schema uses basic atomic operations
   (set, inc, inc_not_zero, dec_and_test, etc.)

Such atomic variables should be converted to a newly provided
refcount_t type and API that prevents accidental counter overflows
and underflows. This is important since overflows and underflows
can lead to use-after-free situation and be exploitable.

The variable task_struct.usage is used as pure reference counter.
Convert it to refcount_t and fix up the operations.

** Important note for maintainers:

Some functions from refcount_t API defined in lib/refcount.c
have different memory ordering guarantees than their atomic
counterparts.

The full comparison can be seen in
https://lkml.org/lkml/2017/11/15/57 and it is hopefully soon
in state to be merged to the documentation tree.

Normally the differences should not matter since refcount_t provides
enough guarantees to satisfy the refcounting use cases, but in
some rare cases it might matter.

Please double check that you don't have some undocumented
memory guarantees for this variable usage.

For the task_struct.usage it might make a difference
in following places:

 - put_task_struct(): decrement in refcount_dec_and_test() only
   provides RELEASE ordering and control dependency on success
   vs. fully ordered atomic counterpart

Suggested-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: David Windsor <dwindsor@gmail.com>
Reviewed-by: Hans Liljestrand <ishkamiel@gmail.com>
Reviewed-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: akpm@linux-foundation.org
Cc: viro@zeniv.linux.org.uk
Link: https://lkml.kernel.org/r/1547814450-18902-5-git-send-email-elena.reshetova@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2023-02-14 12:57:06 +02:00
Catalin Marinas
986f02cc0c mm: kmemleak: use the memory pool for early allocations
Currently kmemleak uses a static early_log buffer to trace all memory
allocation/freeing before the slab allocator is initialised.  Such early
log is replayed during kmemleak_init() to properly initialise the kmemleak
metadata for objects allocated up that point.  With a memory pool that
does not rely on the slab allocator, it is possible to skip this early log
entirely.

In order to remove the early logging, consider kmemleak_enabled == 1 by
default while the kmem_cache availability is checked directly on the
object_cache and scan_area_cache variables.  The RCU callback is only
invoked after object_cache has been initialised as we wouldn't have any
concurrent list traversal before this.

In order to reduce the number of callbacks before kmemleak is fully
initialised, move the kmemleak_init() call to mm_init().

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: remove WARN_ON(), per Catalin]
Link: http://lkml.kernel.org/r/20190812160642.52134-4-catalin.marinas@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Qian Cai <cai@lca.pw>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
2022-10-07 12:15:21 +03:00
darkhz
5d079db98a kernel: Restore schedtune compatibility
When SCHED_TUNE is disabled, certain elements in userspace, like
libperfmgr, may throw errors when it doesn't detect SCHEDTUNE-related nodes.
So, create a few dummy nodes to satisfy said userspace elements.
2022-09-22 17:33:18 +03:00
darkhz
854125967a uclamp_assist: Refactor and implement
This is based on:
7725cb5bc1

With the following modifications:
- Completely remove CPUSET_ASSIST dependency
- Fix potential bootloop issues on some devices
- Place the Kconfig entry appropriately
- Improve code styling and readability
2022-09-22 17:33:18 +03:00
Patrick Bellasi
6a41399960 UPSTREAM: sched/uclamp: Extend CPU's cgroup controller
The cgroup CPU bandwidth controller allows to assign a specified
(maximum) bandwidth to the tasks of a group. However this bandwidth is
defined and enforced only on a temporal base, without considering the
actual frequency a CPU is running on. Thus, the amount of computation
completed by a task within an allocated bandwidth can be very different
depending on the actual frequency the CPU is running that task.
The amount of computation can be affected also by the specific CPU a
task is running on, especially when running on asymmetric capacity
systems like Arm's big.LITTLE.

With the availability of schedutil, the scheduler is now able
to drive frequency selections based on actual task utilization.
Moreover, the utilization clamping support provides a mechanism to
bias the frequency selection operated by schedutil depending on
constraints assigned to the tasks currently RUNNABLE on a CPU.

Giving the mechanisms described above, it is now possible to extend the
cpu controller to specify the minimum (or maximum) utilization which
should be considered for tasks RUNNABLE on a cpu.
This makes it possible to better defined the actual computational
power assigned to task groups, thus improving the cgroup CPU bandwidth
controller which is currently based just on time constraints.

Extend the CPU controller with a couple of new attributes uclamp.{min,max}
which allow to enforce utilization boosting and capping for all the
tasks in a group.

Specifically:

- uclamp.min: defines the minimum utilization which should be considered
	      i.e. the RUNNABLE tasks of this group will run at least at a
	      minimum frequency which corresponds to the uclamp.min
	      utilization

- uclamp.max: defines the maximum utilization which should be considered
	      i.e. the RUNNABLE tasks of this group will run up to a
	      maximum frequency which corresponds to the uclamp.max
	      utilization

These attributes:

a) are available only for non-root nodes, both on default and legacy
   hierarchies, while system wide clamps are defined by a generic
   interface which does not depends on cgroups. This system wide
   interface enforces constraints on tasks in the root node.

b) enforce effective constraints at each level of the hierarchy which
   are a restriction of the group requests considering its parent's
   effective constraints. Root group effective constraints are defined
   by the system wide interface.
   This mechanism allows each (non-root) level of the hierarchy to:
   - request whatever clamp values it would like to get
   - effectively get only up to the maximum amount allowed by its parent

c) have higher priority than task-specific clamps, defined via
   sched_setattr(), thus allowing to control and restrict task requests.

Add two new attributes to the cpu controller to collect "requested"
clamp values. Allow that at each non-root level of the hierarchy.
Keep it simple by not caring now about "effective" values computation
and propagation along the hierarchy.

Update sysctl_sched_uclamp_handler() to use the newly introduced
uclamp_mutex so that we serialize system default updates with cgroup
relate updates.

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-2-patrick.bellasi@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit 2480c093130f64ac3a410504fa8b3db1fc4b87ce)
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: I0285c44910bf073b80d7996361e6698bc5aedfae
Signed-off-by: Quentin Perret <qperret@google.com>
2022-09-22 17:33:15 +03:00
Patrick Bellasi
116cf381f4 UPSTREAM: sched/uclamp: Add CPU's clamp buckets refcounting
Utilization clamping allows to clamp the CPU's utilization within a
[util_min, util_max] range, depending on the set of RUNNABLE tasks on
that CPU. Each task references two "clamp buckets" defining its minimum
and maximum (util_{min,max}) utilization "clamp values". A CPU's clamp
bucket is active if there is at least one RUNNABLE tasks enqueued on
that CPU and refcounting that bucket.

When a task is {en,de}queued {on,from} a rq, the set of active clamp
buckets on that CPU can change. If the set of active clamp buckets
changes for a CPU a new "aggregated" clamp value is computed for that
CPU. This is because each clamp bucket enforces a different utilization
clamp value.

Clamp values are always MAX aggregated for both util_min and util_max.
This ensures that no task can affect the performance of other
co-scheduled tasks which are more boosted (i.e. with higher util_min
clamp) or less capped (i.e. with higher util_max clamp).

A task has:
   task_struct::uclamp[clamp_id]::bucket_id
to track the "bucket index" of the CPU's clamp bucket it refcounts while
enqueued, for each clamp index (clamp_id).

A runqueue has:
   rq::uclamp[clamp_id]::bucket[bucket_id].tasks
to track how many RUNNABLE tasks on that CPU refcount each
clamp bucket (bucket_id) of a clamp index (clamp_id).
It also has a:
   rq::uclamp[clamp_id]::bucket[bucket_id].value
to track the clamp value of each clamp bucket (bucket_id) of a clamp
index (clamp_id).

The rq::uclamp::bucket[clamp_id][] array is scanned every time it's
needed to find a new MAX aggregated clamp value for a clamp_id. This
operation is required only when it's dequeued the last task of a clamp
bucket tracking the current MAX aggregated clamp value. In this case,
the CPU is either entering IDLE or going to schedule a less boosted or
more clamped task.
The expected number of different clamp values configured at build time
is small enough to fit the full unordered array into a single cache
line, for configurations of up to 7 buckets.

Add to struct rq the basic data structures required to refcount the
number of RUNNABLE tasks for each clamp bucket. Add also the max
aggregation required to update the rq's clamp value at each
enqueue/dequeue event.

Use a simple linear mapping of clamp values into clamp buckets.
Pre-compute and cache bucket_id to avoid integer divisions at
enqueue/dequeue time.

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-2-patrick.bellasi@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit 69842cba9ace84849bb9b8edcdf2cefccd97901c)
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: I2c2c23572fb82e004f815cc9c783881355df6836
Signed-off-by: Quentin Perret <qperret@google.com>
2022-09-22 17:33:14 +03:00
Nicholas Piggin
a679425959 kbuild: Allow LD_DEAD_CODE_DATA_ELIMINATION to be selectable if enabled
Architectures that are capable can select
HAVE_LD_DEAD_CODE_DATA_ELIMINATION to enable selection of that
option (as an EXPERT kernel option).

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2022-09-22 15:04:06 +03:00
pwnrazr
902bff81d9 Merge remote-tracking branch 'android-stable/android-4.14-stable' into dev-base-up
Conflicts:
	drivers/char/Kconfig
	fs/ext4/hash.c
	fs/ext4/namei.c
	lib/crypto/Makefile
2022-07-08 09:13:29 +00:00
John Galt
bbd32559d9 init: inline optimize 2022-07-04 07:30:13 +00:00