Commit Graph

1115943 Commits

Author SHA1 Message Date
qctecmdr
4d36671e16 Merge "kernel/sched/walt: check migration disabled in allowed_ptr_locked" 2022-09-27 16:06:05 -07:00
qctecmdr
7b69ee398d Merge "kernel/sched/walt: validate runqueue entries" 2022-09-26 10:13:55 -07:00
qctecmdr
85e22bfdf0 Merge "arm64: configs: Enable CRM driver for pineapple_GKI" 2022-09-26 10:13:55 -07:00
qctecmdr
fe57ff9c8b Merge "coresight: funnel: add support for multiple output ports" 2022-09-26 10:13:54 -07:00
qctecmdr
0a48e814f4 Merge "defconfig: pineapple: Enable QDSS configs for pineapple" 2022-09-26 10:13:54 -07:00
qctecmdr
80f3cc0ceb Merge "soc: qcom: llcc: Further update config data for pineapple SoC" 2022-09-23 16:07:49 -07:00
qctecmdr
4ba8b56fbb Merge "soc: qcom: Rollback when failed to register new region" 2022-09-23 16:07:47 -07:00
qctecmdr
8ebce67790 Merge "soc: qcom: Decrease num_regions after remove region" 2022-09-23 16:07:47 -07:00
qctecmdr
136fde660c Merge "soc: qcom: Fix md_get_region failure when using minidump in SVM" 2022-09-23 16:07:45 -07:00
qctecmdr
052f6f4175 Merge "soc: qcom: Block register minidump region with same name" 2022-09-23 16:07:45 -07:00
qctecmdr
f337b0a0ee Merge "gunyah: secure_vm_loader: Don't release the memory when VM load fail" 2022-09-23 16:07:44 -07:00
qctecmdr
7a1b455714 Merge "gunyah: secure_vm_loader: Fix the hyp inject instruction/data abort" 2022-09-23 16:07:44 -07:00
qctecmdr
a2e0221707 Merge "soc: qcom: qcom_stats: Add ioctl support for stats" 2022-09-23 16:07:44 -07:00
qctecmdr
caf3c388c3 Merge "abi_gki_aarch64_qcom: Add msleep_interruptible" 2022-09-23 16:07:42 -07:00
qctecmdr
2cc87b66ce Merge "msm: ipa: add snapshot of IPA USB header file" 2022-09-23 14:30:17 -07:00
qctecmdr
d665060fae Merge "sched/walt: Early Detect Boost Optimizations" 2022-09-23 14:30:15 -07:00
Tao Zhang
9f74beac0a coresight: funnel: add support for multiple output ports
Funnel devices are now capable of supporting multiple-inputs and
multiple-outputs configuration with in built hardware filtering
for TPDM devices. Add software support to this function. Output
ports is selected according to the source of the trace path.

Change-Id: I491293e0b1948f3747d34eb79e7845617ace4244
Signed-off-by: Tingwei Zhang <tingwei@codeaurora.org>
Signed-off-by: Mao Jinlong <jinlmao@codeaurora.org>
Signed-off-by: Tao Zhang <taozha@codeaurora.org>
Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
2022-09-23 04:32:00 -07:00
Cong Zhang
b6d428f6a8 soc: qcom: Rollback when failed to register new region
Remove region from local minidump table when failed to register new
region with RM call.

Change-Id: I85bbf62e90cd423be7d3475a5f6526062b22c8c9
Signed-off-by: Cong Zhang <quic_congzhan@quicinc.com>
2022-09-22 19:53:38 -07:00
Cong Zhang
032d6b0f4b soc: qcom: Fix md_get_region failure when using minidump in SVM
Find the correct minidump table in md_get_region.

Change-Id: Ib42db09f4ee3b629834cf78795ceb0c26a877bdd
Signed-off-by: Cong Zhang <quic_congzhan@quicinc.com>
2022-09-22 19:53:32 -07:00
Cong Zhang
80389226be soc: qcom: Decrease num_regions after remove region
Decrease num_regions of minidump table after remove region.

Change-Id: I8be2cc2b1f29328fb0e308431893dea1b15cd084
Signed-off-by: Cong Zhang <quic_congzhan@quicinc.com>
2022-09-22 19:53:25 -07:00
Cong Zhang
f7845a840c soc: qcom: Block register minidump region with same name
If user register minidump region with same name, return -EEXIST error
code.

Change-Id: I612a7a4f77fdd80d3b677b2b2b4e4d1221c3395f
Signed-off-by: Cong Zhang <quic_congzhan@quicinc.com>
2022-09-22 19:53:09 -07:00
Mao Jinlong
e1ed2a9b89 defconfig: pineapple: Enable QDSS configs for pineapple
Enable QDSS configs to support STM/TPDM/Remote ETM/CTI functions.

Change-Id: I297b0820794849d3dc27af30b646780f4370d1d7
Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
2022-09-22 19:29:32 -07:00
Tao Zhang
edcceebfd9 coresight: Add the coresight qmi head file
Add the coresight qmi head file since the remote etm need it
support.

Change-Id: I282abfab76be5149dca2496bb9583951f760f17e
Signed-off-by: Tao Zhang <quic_taozha@quicinc.com>
Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
2022-09-22 19:29:16 -07:00
Guru Das Srinagesh
d9c33d9e5a abi_gki_aarch64_qcom: Add msleep_interruptible
Add msleep_interruptible to list of symbols.

Change-Id: I348f22cca19c1086c04068ba1ea539b18705d84b
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
2022-09-22 17:43:51 -07:00
Maulik Shah
321af67c34 soc: qcom: qcom_stats: Add ioctl support for stats
Add ioctl support by which userspace can know the various stats.

Change-Id: I916232f7eeb0efd7ca5a8d99afff547fdb9ad594
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-09-23 00:13:53 +05:30
Maulik Shah
4213c4b3b4 arm64: configs: Enable CRM driver for pineapple_GKI
Enable CRM driver.

Change-Id: I87ed4674b63f54cd35b8940a94113083e835b2ae
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-09-22 22:30:52 +05:30
Maulik Shah
b5797d6b33 soc: qcom: Add CESTA Resource Manager driver
Add CESTA Resource Manager (CRM) driver.

Change-Id: I82c905fbb2838cae72337677cf076f245b2f3865
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-09-22 22:30:44 +05:30
Stephen Dickey
a602accc3c kernel/sched/walt: check migration disabled in allowed_ptr_locked
migrate_disable is called to prevent moving a task to a different
cpu. In the process it will update the task's cpus_ptr to a
temporary mask to restrict the task to run only on the current
cpu. It has only one cpu set in this new mask. migrate_disable
must always be paired with a migrate_enable call.

When migrate_enable is called it will attempt to manipulate the
allowed ptrs mask just prior to actually enabling migration on
a task. This means __set_cpus_allowed_ptr is called. This calls
a tracehook:

  migrate_enable
  __set_cpus_allowed_ptr
  __set_cpus_allowed_ptr_locked
  trace_android_rvh_set_cpus_allowed_ptr_locked
  android_rvh_set_cpus_allowed_ptr_locked

The purpose of handling this hook in walt, is to prevent the
assignment of a task to a halted cpu. When migrate_enable
restores the affinity to p->cpus_mask and p->cpus_mask consists
of a single cpu and that single cpu is halted, WALT will cause
__set_cpus_allowed_ptr to reject and return early. IOW
p->cpus_ptr is not set to p->cpus_mask.

If the p->cpus_ptr is not restored to point to the p->cpus_mask,
a subsequent migrate_disable/migrate_enable can happen, and
is allowed to happen with the runque lock taken. Since the
p->cpus_ptr is not pointing to the p->cpus_mask, migrate_enable
will incorrectly call __set_cpus_allowed_ptr. This in turn
will take the runque lock again resulting in a spinlock
recursion.

Address this by updating the hook code, checking the
migrate_disabled flag for the task, and allowing the existing
cpu to be used even if that cpu is halted. To achieve this
utilize a different hook that is present in the code already:
trace_android_rvh_set_cpus_allowed_by_task().

Change-Id: I42204332d708c6bc96f5de52eb9739d17cfdc0a3
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-21 15:36:29 -07:00
Tengfei Fan
30c5ecaa7f sched/walt: make TASK_BOOST_STRICT_MAX task have high chance for running on prime core
TASK_BOOST_STRICT_MAX task can cause performance influence if it haven't
running on prime core, so do this for these tasks have high chance for
running on prime core.

Change-Id: I249dbe1c201934ea3c4610e93b1b71b24fb20d80
Signed-off-by: Tengfei Fan <quic_tengfan@quicinc.com>
2022-09-21 15:36:29 -07:00
Shaleen Agrawal
4349ffdf24 kernel/sched/walt/energy-model: inflate cost for 1.6Ghz by 3x
Certain frequencies in min-cap cpus draw excessive power and
are more costly to the device's performance than indicated by
the energy model.

For silver frequencies above a threshold, inflate the cost by
a percentage to create a steep power curve, favoring golds at
lower frequencies. For example, to raise the cost for
frequencies above 1.6GHz by 3x:

      echo 300 > /proc/sys/walt/sched_em_inflate_pct
      echo 220 > /proc/sys/walt/sched_em_inflate_thres

Change-Id: Ia10a818ab2f217ffa3039667f52566d9894e5047
Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-21 15:36:28 -07:00
Ashay Jaiswal
92c1eb4e2f sched: walt: remove vendor hook "trace_binder_transaction_received"
"trace_binder_transaction_received" vendor hook is used to clear binder low
latency MVP priority, but for some usecase it is observed that usespace
application is initiating read ioctl quickly and as part of ioctl handling
binder driver initiates transaction received vendor hook and binder low
latency MVP priority is cleared for the binder thread.
Handle above condition by allowing binder thread to maintain and run with
MVP priority for it's allocated MVP timeslice.

The Low latency flag of the task is reset only when the binder transactions
is initiated again on the same thread and task initiating the transaction
doesn't comply with the low latency criterion.

Change-Id: Ie068adc64796432b7d41b0256a25a04caac518b1
Signed-off-by: Ashay Jaiswal <quic_ashayj@quicinc.com>
2022-09-21 15:36:28 -07:00
Shaleen Agrawal
c9410f348b sched/walt: Add tracepoint to display select_task_rt fastpath
Add tracepoint to help debug rt task placement decisions.

Change-Id: I95170b2b45adf3a614ba49d237c8ed6ca6e145aa
Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-21 15:36:28 -07:00
Stephen Dickey
97bfb7d38f kernel/sched/walt: change formatting for not_preferred output
Core control takes a numeric input for the not_preferred field
to identify which cpus can be paused. 1 means can pause, 0 means
the cpu cannot pause.

The output is in order of the number of the cpu. For example

  # cat /sys/devices/system/cpu/cpu3/core_ctl/not_preferred
  1 0 1 0

This means that cpu 3 and cpu 5 are not_preferred and can be
paused.

Change-Id: Ia4b982352bba7e463d59579ece13ccfcb09b0baf
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-21 15:36:27 -07:00
Stephen Dickey
774bb80375 sched/walt: add lowlatency support for key binder transactions
The current change protects only binder transactions
targeted towards an RT process. This change attempts to
consider all binder transaction interacting with an RT task.

Change-Id: I35cbb695f6709170afa075b1b50d009b17b1b508
Signed-off-by: Kishore Sri venkata Ganesh Bolisetty <quic_bsrivenk@quicinc.com>
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-21 15:36:27 -07:00
Stephen Dickey
d3e9a484ac kernel/sched/walt: kernel space adaptive_low/high_freq values
Add kernel-space adaptive_low_freq and adaptive_high_freq to the
waltgov cpufreq policies, such that kernel space code or vendor
kernel space code can manipulate these values directly.

Set the actual in-use adaptive freq values to the max of the
user space value and the kernel space value.

Change-Id: I59deca1cd60bcd8bd63170e6e1bced63456b41d6
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-21 15:36:26 -07:00
Abhijeet Dharmapurikar
3de224c444 sched/walt: fix packing worthy gold tasks running on silvers
The current code identifies the first 32bit cpu as the packing cpu when
the load conditions are met. However, it skips checking if that 32bit
cpu is actually halted. In case it were halted, the
select_task_rq()->is_cpu_allowed() fails, causing the task to run on a
fallback cpu which invariably ends up being a silver cpu.

Fix this by finding the first unhalted cpu for packing. If its a 32bit
task further find a 32bit supporting cpu.
Either case always ensure that an unhalted cpu is used for packing.

Change-Id: I459c70fe3793a26c4b06bb80f8660003b1875c85
Signed-off-by: Abhijeet Dharmapurikar <quic_adharmap@quicinc.com>
2022-09-21 15:36:26 -07:00
Abhijeet Dharmapurikar
3abcd9269f sched/walt: disable cpu packing when current freq is high
This in addition to other criteria already present in the code.

Change-Id: Ief3a21eb159bed8eb724427c0acca327a3cbb272
Signed-off-by: Abhijeet Dharmapurikar <quic_adharmap@quicinc.com>
2022-09-21 15:36:25 -07:00
Shaleen Agrawal
e3e14e56fb sched/walt: Ensure frequency bump to fmax under walt rotation
Previously, frequencies would jump to fmax when walt rotation was
enabled. This was done through the early detection path. But, as a
consequence of early detection boost optimizations, frequencies
regressed under walt rotation.

Change-Id: I40f91ba873a9cc179fcfb23291dc4839e857428a
Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
2022-09-21 15:36:25 -07:00
Shaleen Agrawal
b30e1d54a5 sched: walt: enable early migrate for topapp
Create nodes to enable top-app tasks to upmigrate faster to gold cores.

Change-Id: If06ddf23b13d6277e66cf5dffa537a75e7902089
Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
2022-09-21 15:36:24 -07:00
Stephen Dickey
d5e0c218f3 kernel/sched/walt: validate runqueue entries
Instead of traversing the entire process list
to determine if there are any tasks left on
this cpu's rq, track any tasks that get
re-enqueued during the balance_callbacks
operation.

Change-Id: Iff8322172b17c98c2c6b2a8f75653f557cebcbb6
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-21 15:36:23 -07:00
Stephen Dickey
f6c65099e9 kernel/sched/walt/halt: drain needs __balance_callbacks
drain_rq_cpu_stop as written, can and will add a call
to the balance_callbacks queue. This is possible with
the below calling sequence

  drain_rq_cpu_stop
  migrate_tasks
  pick_migrate_task
  pick_next_task
  pick_next_task-rt (first==true)
  set_next_task_rt
  rt_queue_push_tasks
  queue_balance_calllback (if rq has pushable tasks)
  --> entry added to balance_callbacks queue.

drain_rq_cpu_stop will release the rq lock and enable
interrupts without performing a balance callback. If
an interrupt which will attempt to acquire the rq
lock happens before this context switches out, the
balance callback will not have happened, and an
attempt to reaquire the rq lock will WARN.

Correct the warn by handling the callbacks prior to
releasing the locks and re-enabling interrupts.

Change-Id: I36f7b20cfaedac556a5a2418a299551bc2c34eb3
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
2022-09-21 15:36:23 -07:00
Shaleen Agrawal
1d077fe1d4 sched/walt: Early Detect Boost Optimizations
Currently, if an ED task is detected on a cluster, the entire cluster's
frequency is raised to fmax. However, since ED tasks are only classified
under boosted scenarios anyways, this degree of boost may not be
necessary. This patch introduces a tunable, sched_ed_boost, which can be
used to boost the highest load on the cluster with an ED task by x%, x
being the set tunable.

Change-Id: I90ce6e7435b89ed27d307a164fdd7b8f6c8f5c9e
Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
2022-09-21 15:36:22 -07:00
Shaleen Agrawal
aca97f0a06 sched/walt: Ensure capacities are updated when policy max changes
If the cluster fmax is changed, ensure the cpu capacity is updated
instantly.

Change-Id: I1328c8b5e74e176b1e55091314cb65a4ef5f783d
Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
2022-09-21 15:36:22 -07:00
Abhijeet Dharmapurikar
f1b09a77f5 sched/walt: move predictive freq to wakeup enqueue
This will update the freq as soon the rqlock is dropped and also avoids
us from acquiring a rq lock as enqueue is called with rq lock held.

Change-Id: I24b91309b753f61a38d1eb8e26af451544fa3f52
Signed-off-by: Abhijeet Dharmapurikar <quic_adharmap@quicinc.com>
2022-09-21 15:36:21 -07:00
Abhijeet Dharmapurikar
90ec01ea12 walt_cfs: MVP: rearrange priorities
Update to prefer low_latency and pipeline as having higher priority than
others.

Change-Id: Ib5ba973d483cf923f886a906a158907335ccab9b
Signed-off-by: Abhijeet Dharmapurikar <quic_adharmap@quicinc.com>
2022-09-21 15:36:20 -07:00
Abhijeet Dharmapurikar
f970f604f2 sched/walt: use sched_idle_enough to skip packing
When sysctl_sched_idle_enough is not set, the current code still finds a
pakcing cpu only to reject it later. Fix this i.e. don't even bother
finding a packing cpu when idle_enough is zero.

Change-Id: I5cdce5e06072eee75593aa1e36953a2946e20efa
Signed-off-by: Abhijeet Dharmapurikar <quic_adharmap@quicinc.com>
2022-09-21 15:36:07 -07:00
Guru Das Srinagesh
05dea7050c soc: qcom: llcc: Further update config data for pineapple SoC
Update system cache hardware settings for pineapple SoC.

Change-Id: I2a829749a11f879df548837c0cfcaa027d967b1f
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
2022-09-21 14:29:20 -07:00
qctecmdr
db78883a87 Merge "arm64: defconfig: Enable SLIMBUS configs on Pineapple" 2022-09-21 06:35:27 -07:00
Chandana Kishori Chiluveru
1229ef03d3 arm64: defconfig: Enable SLIMBUS configs on Pineapple
Enable Slimbus drivers as module in defconfig on Pineapple.

Change-Id: I1acf9e75a283e0094bdc74d9c5593896980ebe05
Signed-off-by: Chandana Kishori Chiluveru <quic_cchiluve@quicinc.com>
2022-09-21 11:51:52 +05:30
qctecmdr
6d0045aaf5 Merge "sched/walt: fix busy time accounting for tasks moving between groups" 2022-09-20 21:50:30 -07:00