Commit Graph

1104329 Commits

Author SHA1 Message Date
Sai Harshini Nimmala
20ec0b66fb include/linux/cpu: Remove get_online_cpus and put_online_cpus wrapper
Upstream has done away with get_online_cpus and put_online_cpus wrappers
around cpu_read_lock() and cpu_read_unlock().
Reflect these changes downstream.

Change-Id: Ie7ae59b6faba93ea43ce1ba3a4b043ae87e1337f
Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
2022-06-28 18:53:14 -07:00
Sai Harshini Nimmala
5555cfa205 sched/walt: Remove vendor hook for resume_cpus
Upstream does not carry pause feature. Remove related references.

Change-Id: I7ac0352a761fa78af3918a5b3a61424df0d22a2f
Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
2022-06-28 18:53:13 -07:00
Sai Harshini Nimmala
f9c2cd8a95 Revert "sched:walt: register tracehooks for race with pause"
Aandoned upstream, reflecting it in kernel/msm-5.10.

Change-Id: I0c1ebd96372803519b180641707562034996479b
Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
2022-06-28 18:53:12 -07:00
Stephen Dickey
6d9fb971b7 sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: Id758a4a0a836fe30b9f63b8f00c017247cf3b84c
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-06-28 18:53:11 -07:00
Sai Harshini Nimmala
7054cae73f sched/walt: Clear scale_frequency_data during init
Change the FIE to use frequency scaling information provided by
cpufreq driver as opposed to the higher priority arch specific counters.

This is done by resetting the struct scale_freq_data for each CPU which
holds the callback information specific to the HW counters, thus forcing
the FIE to revert to default, the cpufreq driver.

Change-Id: I23f508f9859be6a35155e5d000caf1c0b19f5584
Signed-off-by: Sai Harshini Nimmala <snimmala@codeaurora.org>
2022-06-28 18:53:10 -07:00
Stephen Dickey
9c062eae64 pause: port the users of pause
Port the users of pause from the 5.10 kernel to ensure code is up to date.

Change-Id: Ibe52cc37e0dca425f2f472b9cf254a2453bd9c47
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
2022-06-28 18:53:10 -07:00
Abhijeet Dharmapurikar
beb88676bf sched/walt: complain if num clusters is high
num_sched_clusters has to be less than MAX_CLUSTERS, complain otherwise.

Change-Id: I0648585139d31dc948cf73aae7d093757a5762cc
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2022-06-28 18:53:09 -07:00
Sai Harshini Nimmala
031f8e8239 sched/walt: Change rq lock variable as per upstream
The rq lock variable in struct rq is changed upstream.
Reflect changes downstream.

Change-Id: I8711d42dbe10f769b8568895993b92a6bcbcd69e
Signed-off-by: Sai Harshini Nimmala <snimmala@codeaurora.org>
2022-06-28 18:53:08 -07:00
Sai Harshini Nimmala
b634ecd65b sched/walt: Remove redefinition of 'task_of' function
'task_of' function is defined in sched.h
Remove redefinition in walt_cfs.c

Change-Id: I07dd511fae0a74a03ebf2ae47f2b227404866972
Signed-off-by: Sai Harshini Nimmala <snimmala@codeaurora.org>
2022-06-28 18:53:07 -07:00
Sai Harshini Nimmala
d3e1802b11 sched_walt: Change from MAX_USER_RT_PRIO to MAX_RT_PRIO
Upstream has done away with the MAX_USER_RT_PRIO macro.
Reflect these changes downstream.

Change-Id: I836bcae569af2e98db5cfc1330d04c80c5e68563
Signed-off-by: Sai Harshini Nimmala <snimmala@codeaurora.org>
2022-06-28 18:53:06 -07:00
Sai Harshini Nimmala
03ee181e27 sched/walt: Change task state variable
Upstream changed task's state variable in struct task_struct
to non-volatile.
Reflect these changes downstream.

Change-Id: Icc9736e6b5f6fb5b7d02fde6d3117a9131d98b50
Signed-off-by: Sai Harshini Nimmala <snimmala@codeaurora.org>
2022-06-28 18:53:06 -07:00
Lingutla Chandrasekhar
822a7c683b sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: Ic5929726768f6a9ca2a5823e2795eeb5e172d93a
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2022-06-28 18:53:05 -07:00
Abhijeet Dharmapurikar
e611070ee2 sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I9cd7715f390d52163b7280ebb6e9f04bdfc38d4c
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2022-06-28 18:53:04 -07:00
Shaleen Agrawal
e2d43d820a sched/walt: Remove newline in traces
This change is for general scheduler improvement.

Change-Id: I2873e2f0cb5a8e1d2349644c796bf188275882b6
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2022-06-28 18:53:04 -07:00
Shaleen Agrawal
24a2347422 sched: walt: Create pipeline "low latency" tasks
This change is for general scheduler improvement.

Change-Id: I94d790387a8d528fdfd954a8db2c8783eb090644
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2022-06-28 18:53:03 -07:00
Shaleen Agrawal
1900694cd0 sched/walt: fix target load crossover
This change is for general scheduler improvement.

Change-Id: I28ccf141ccd52c0b8afc4548f83dd4e69b954670
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2022-06-28 18:53:02 -07:00
Rishabh Bhatnagar
e35de28c32 sched: walt: Add target load tunables
Add target load threshold and target load shift tunables for each
policy. This allows us to scale cpu frequency in a configurable
way for each cluster.

Change-Id: I2c41ce6ef8b5a91f0b55be6af075db70695efd98
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
2022-06-28 18:53:01 -07:00
Sai Harshini Nimmala
d404d19933 sched/walt: Fix caching freq earlier than down rate limit check
Raw frequency was being cached earlier than the down rate limit check
causing the calculated frequency to be cached even in a situation where
the up/down rate limit check failed a frequency update. The following
changes have been made wrt to the above observation:
1. The up/down rate limit check has been moved further up
the frequency update path, where frequency is resolved and
cached_raw_freq is utilized to ensure that all possible frequency
checks are consolidated to one location.
2. Reset cached_raw_freq in the event of down rate limit check failing,
thus forcing the frequency update path to resolve a new frequency
value instead of using an invalid cached_raw_frequency and
ensuring that the latest frequency is applied.

Change-Id: I449ca6552aeb5f30be9d29ac472c0ba421f25da4
Signed-off-by: Sai Harshini Nimmala <snimmala@codeaurora.org>
2022-06-28 18:53:01 -07:00
Abhijeet Dharmapurikar
544665ace6 sched/walt: improve task_util trace and variable names
This change is for general scheduler improvement.

Change-Id: Ia9be6164f683a5fa29aa5d1ce13633e1cc6016ba
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2022-06-28 18:53:00 -07:00
Shaleen Agrawal
52daa01731 sched: walt: Don't crash unless crash mode enabled
When crashing is not enabled, let WALT attempt to correct behavior.

Change-Id: Ica1c6a8aff465c5747db9acd0e16d99a7c2c4128
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2022-06-28 18:52:59 -07:00
Shaleen Agrawal
a97a7d3514 sched: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I6ba6408bd9934bde681452280c3be56cd8bc96e8
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2022-06-28 18:52:58 -07:00
Abhijeet Dharmapurikar
71f74b8b42 sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: Ib0003f97269920cb29f125da2ced34417a5a2229
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2022-06-28 18:52:58 -07:00
Shaleen Agrawal
a5116004fb sched: walt: Imrpove the scheduler
This change is for general scheduler improvement.

Change-Id: I000f0d6aa486da31cf805f2aa1d21a821f6ebfdc
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2022-06-28 18:52:57 -07:00
Shaleen Agrawal
b6b9ecaecb sched: Improve the Scheduler
This change is for general scheduler improvement.

Change-Id: Id6818d7f79e8babb316aff3568cb65397df53c6f
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2022-06-28 18:52:56 -07:00
Abhijeet Dharmapurikar
0808e3fa4d sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: Ie81267e970c55da4f5f5f2a6ffb9b7f64e48503c
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2022-06-28 18:52:55 -07:00
Abhijeet Dharmapurikar
3da4f50cf4 sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: Ia289e3ac635e22e66ae14c7cb2d171b4ad6bbf60
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2022-06-28 18:52:55 -07:00
Abhijeet Dharmapurikar
4a2c606e12 sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I7e2f06b0f93d6c3c2cc439f895083f4b7cb96212
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2022-06-28 18:52:54 -07:00
Shaleen Agrawal
60e7fe8dba sched: walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I509129b041185e8f6b83eb586b7ce542889ebe5d
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2022-06-28 18:52:53 -07:00
Shaleen Agrawal
d61bdd0b0f sched: walt: Improve the Scheduler
This change is for general scheduler improvement.

Change-Id: I78a13f15f7b95d7b6583222fbc68b828e651b802
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2022-06-28 18:52:52 -07:00
Rishabh Bhatnagar
00c0dd9fc1 sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: Id0ed126e0d5bd18957438d4d79bce6c310791c00
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
2022-06-28 18:52:52 -07:00
Shaleen Agrawal
beca103128 sched: walt: Do dequeue task accounting after dequeue
Until recently, we used to do all the dequeue task accounting business
after the call the dequeue task call was done. However, due to an
upstream change in the position of the trace hook, we modified our value
adds to account for doing this work prior to dequeue task. However,
there were unforeseen consequences as a result. As there is
now an "after" dequeue hook available, it is more intuitive to do this
work after dequeue task has taken place, and furthermore, this keeps the
work in line with the manner in which it is done on prior chipsets
ensuring stability.

Change-Id: Iaa274ed39780316fd2d462ad22d4d8b1772def45
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2022-06-28 18:52:51 -07:00
Shaleen Agrawal
c4b8044564 sched: walt: Use CRA for sum util
Energy is defined as the cost * load. Currently, the cost is derived
from prs and sum_util is also the sum of prs. This is unoptimal, as
prs denotes frequency, but not load. Therefore, it is
better to use CRA to denote the load instead.

Change-Id: I503f0895951390ad111be24daab6cc76c289821b
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2022-06-28 18:52:50 -07:00
Stephen Dickey
37d8832dee sched/walt: eval_need code and trace cleanup
Improve the naming and types of variables in eval_need,
reduce computation and adjust the tracepoint to reflect
the new names of variables.

Change-Id: Ifc19bc802bbc8382577b0e4ed4b4c9be77ffe99e
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
2022-06-28 18:52:50 -07:00
Stephen Dickey
8fd0c42d94 sched/walt: Improve the scheduler
This change is for a general scheduler improvement.

Change-Id: I68b72c7b557edfff685b58ec78525b806f0a7142
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
2022-06-28 18:52:49 -07:00
Tengfei Fan
dc224f824d sched/walt: update the value of active_cpus
Because of online cpu not make sure active, but active
make sure online, so when want to get active_cpus, make
it and cpu_active_mask.

Change-Id: Ie73b85506252edfad1f1258c9e059b0167dfe4a5
Signed-off-by: Tengfei Fan <tengfeif@codeaurora.org>
2022-06-28 18:52:48 -07:00
Rishabh Bhatnagar
57cfe14de2 sched: walt: Increase nr_threshold to 40 percent
Increase the nr_threshold percentage to 40 from 15.

Change-Id: I32ce7246fc4cd32d4c8110bef63971c9a2dceb55
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
2022-06-28 18:52:47 -07:00
Amir Vajid
4717a64824 sched: walt: add sched_switch_ctrs_cfg event
Create an event to periodically dump the configuration
of the pmu counter registers. This can be used in
conjunction with the existing sched_switch_with_ctrs
event to confirm which counter is configured in each
register.

Change-Id: Iaf11279e94d4af3f8aff522282585e680acd5f4d
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2022-06-28 18:52:47 -07:00
Lingutla Chandrasekhar
0e90c114dd sched: walt: Account rt scale to cpu_capacity
While updating cpu_rq->cpu_capacity, we are ignoring rt pressure, and
using same as cpu_capacity_orig, which might lead to unfair scheduler
decisions.

Fix it by accouting rt scale to cpu_capacity.

Change-Id: Icead0af0d8a309cc5f93438a4d4d7e7e7c93653c
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2022-06-28 18:52:46 -07:00
Rishabh Bhatnagar
7d1e74f709 sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I6f953cd04ada8ccb36bbf1e2fe341375092b35c4
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
2022-06-28 18:52:45 -07:00
Stephen Dickey
b7b0355db1 sched/walt: Improve the scheduler
Improve core_ctl tracing such that the necessary flags for
debugging eval_need are present in the trace, and so that
all returns go through the same tracepoint, unlocking, and
return functionality.

Change-Id: I61d5ab86ba7650bea77e4416b0ffa9a07869bbf3
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
2022-06-28 18:52:44 -07:00
Abhijeet Dharmapurikar
318d73bd4d sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I42edf6c6df05f0bf72e4c57ee701916860773428
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2022-06-28 18:52:44 -07:00
Abhijeet Dharmapurikar
c81145e1f4 sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I17cca453e5a4e6bbf4d0b55440d9f776dc2583cb
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2022-06-28 18:52:43 -07:00
Maria Yu
9847c28cfd sched/walt: Check if necessary for sched_boost modify
Check if necessary to do exit and next_boost enter
oprations instead of doing it regardlessly.
Core control boost refcounts has been wrong if doing
current sched_boost exit and next_boost enter by mistake.

Change-Id: Ie40ebf0be0e1b99291d07d160ebef5964d44ba16
Signed-off-by: Maria Yu <aiquny@codeaurora.org>
2022-06-28 18:52:42 -07:00
Sai Harshini Nimmala
925dd42831 sched/walt: Improve the scheduler
This change is for general scheduler improvemnts.

Change-Id: I9c8c1a9c00534700b63834384c3553145ae8c935
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
Signed-off-by: Sai Harshini Nimmala <snimmala@codeaurora.org>
2022-06-28 18:52:41 -07:00
Abhijeet Dharmapurikar
03504cab3c sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I4ccf43485d46451837d3114de370b5ea9bc1f824
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2022-06-28 18:52:40 -07:00
Stephen Dickey
36183d4ec4 sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I8e5fbdb142a891f79b0073b2fc0ee7e81d46c845
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
2022-06-28 18:52:40 -07:00
Satya Durga Srinivasu Prabhala
a907a3cd42 sched/walt/walt_cfs: Improve the scheduler
This change is for general scheduler improvemnts.

Change-Id: Iae112690c5cf125db5d197555d47244a63bfb32e
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2022-06-28 18:52:39 -07:00
Stephen Dickey
04859b6838 sched/walt: reduce severity of walt pause warning
It is normal case to see hotplug become disabled and when
this happens, pause_cpus and resume_cpus will fail. To
walt_pause this is an issue as the requested action cannot
be performed, but not from a system perspective.

Reduce the severity of the walt_pause error upon failure
of pause_cpus() and resume_cpus() to debug only. Corrective
action is taken, so the warning doesn't need to be on the
console.

Change-Id: I5667a1efe46c07379e31bcfd9ff1cfeedd5be64c
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
2022-06-28 18:52:38 -07:00
Stephen Dickey
f6a9379748 sched/walt: reduce severity of core_ctl warning
When there is a failure with the call to pause_cpus() or
resume_cpus() core_ctl will receive that error and retry
on a window boundary. Currently this results in a
printk_deferred message going to the console very frequently
for a normal use case (hotplug disabled).

Change these console messages to pr_debug() to eliminate
the messages unless DEBUG is defined, and loglevel is increased.

Change-Id: I99bd04cd71dbc0b365df07dea3776a11afa6b7d5
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
2022-06-28 18:52:38 -07:00
Stephen Dickey
1efede7023 sched/walt: convert existing walt debug to use macro
Walt debug code needs to go through the macro used to control
whether or not a crash will happen on error. Additionally,
update code so that when crashing is not supported, walt
will attempt to correct the error.

Change-Id: I2c9efb38e395db90b9fbfbf310329d2775ee7fae
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
2022-06-28 18:52:37 -07:00