This change is for general scheduler improvement.
Change-Id: Id0ed126e0d5bd18957438d4d79bce6c310791c00
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
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>
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>
* refs/heads/tmp-a20e145:
FROMGIT: usb: dwc3: Decouple USB 2.0 L1 & L2 events
ANDROID: GKI: update xiaomi symbol list
ANDROID: cfi: explicitly clear diag in __cfi_slowpath
ANDROID: GKI: update xiaomi symbol list
ANDROID: GKI: Update symbols to symbol list
Change-Id: I1d129ffa77975c38bd98f5bce5e5732b598e94ec
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
When CONFIG_CFI_PERMISSIVE is not set, ensure the third argument
passed to __cfi_check from __cfi_slowpath is NULL to avoid an invalid
memory access in __cfi_check_fail. __cfi_check_fail always traps
anyway, but the error message will be less confusing with this patch.
Note that kernels built with full LTO aren't affected as they always
clear the argument before a __cfi_slowpath call. Later kernel versions
are also not affected as they use -fno-sanitize-trap=cfi.
Bug: 196763360
Change-Id: Ifa5b4e324737a3069f7a772dd9b392042ec8407e
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
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>
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>
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>
* refs/heads/tmp-0b7eb09:
ANDROID: GKI: Update symbols to symbol list
ANDROID: abi_gki_aarch64_qcom: Add irq_domain_disconnect_hierarchy symbol
FROMGIT: irqchip/qcom-pdc: Trim unused levels of the interrupt hierarchy
FROMGIT: irqdomain: Export irq_domain_disconnect_hierarchy()
ANDROID: GKI: Add devcoredump API to symbol list
ANDROID: Update the exynos symbol list
Conflicts:
drivers/irqchip/qcom-pdc.c
Change-Id: I13c1a4ae0af00fb0f078d5421aa9a7e2d85125c1
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
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>
* keystone/mirror-android12-5.10:
ANDROID: Update the exynos symbol list
ANDROID: GKI: Add devcoredump API to symbol list
FROMGIT: irqdomain: Export irq_domain_disconnect_hierarchy()
FROMGIT: irqchip/qcom-pdc: Trim unused levels of the interrupt hierarchy
ANDROID: abi_gki_aarch64_qcom: Add irq_domain_disconnect_hierarchy symbol
ANDROID: GKI: Update symbols to symbol list
Signed-off-by: Daniel Norman <danielnorman@google.com>
Bug: 193384408
Bug: 196928089
Bug: 197318507
Bug: 197604288
Change-Id: Iba63715755d8e9006b8d2745579058cb9a5a220a
* refs/heads/tmp-234596c:
FROMLIST: PM: sleep: core: Avoid setting power.must_resume to false
UPSTREAM: kfence: fix is_kfence_address() for addresses below KFENCE_POOL_SIZE
ANDROID: xt_quota2: set usersize in xt_match registration object
ANDROID: xt_quota2: clear quota2_log message before sending
ANDROID: xt_quota2: remove trailing junk which might have a digit in it
ANDROID: GKI: Update symbols to abi_gki_aarch64_oplus
UPSTREAM: cfi: Use rcu_read_{un}lock_sched_notrace
ANDROID: Update symbol list for mtk
UPSTREAM: af_unix: fix garbage collect vs MSG_PEEK
ANDROID: GKI: Add initial symbol list for i.MX
ANDROID: GKI: Update abi_gki_aarch64_qcom for balance reclaim symbols
ANDROID: ABI: update symbols to A12-K5.10 unisoc whitelist for the first time
FROMGIT: rcu: Fix stall-warning deadlock due to non-release of rcu_node ->lock
BACKPORT: ALSA: usb-audio: fix incorrect clock source setting
ANDROID: scsi: ufs: Add more logging
Change-Id: Id6cb2e8a7542267c3079e901830dc03960ba4785
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
This change is for general scheduler improvement.
Change-Id: I6f953cd04ada8ccb36bbf1e2fe341375092b35c4
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
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>
This change is for general scheduler improvement.
Change-Id: I42edf6c6df05f0bf72e4c57ee701916860773428
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
This change is for general scheduler improvement.
Change-Id: I17cca453e5a4e6bbf4d0b55440d9f776dc2583cb
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
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>
* keystone/mirror-android12-5.10:
ANDROID: GKI: Update abi_gki_aarch64_qcom for balance reclaim symbols
ANDROID: GKI: Add initial symbol list for i.MX
UPSTREAM: af_unix: fix garbage collect vs MSG_PEEK
ANDROID: Update symbol list for mtk
UPSTREAM: cfi: Use rcu_read_{un}lock_sched_notrace
ANDROID: GKI: Update symbols to abi_gki_aarch64_oplus
ANDROID: xt_quota2: remove trailing junk which might have a digit in it
ANDROID: xt_quota2: clear quota2_log message before sending
ANDROID: xt_quota2: set usersize in xt_match registration object
Signed-off-by: Haamed Gheibi <haamed@google.com>
Bug: 175415908
Bug: 194108974
Bug: 194223154
Bug: 196046570
Bug: 196926917
Bug: 197069923
Bug: 197173550
Change-Id: Ifc3cea113a61a263356caab2e759f55bf82ac70f
This change is for general scheduler improvemnts.
Change-Id: I9c8c1a9c00534700b63834384c3553145ae8c935
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
This change is for general scheduler improvement.
Change-Id: I4ccf43485d46451837d3114de370b5ea9bc1f824
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
If rcu_read_lock_sched tracing is enabled, the tracing subsystem can
perform a jump which needs to be checked by CFI. For example, stm_ftrace
source is enabled as a module and hooks into enabled ftrace events. This
can cause an recursive loop where find_shadow_check_fn ->
rcu_read_lock_sched -> (call to stm_ftrace generates cfi slowpath) ->
find_shadow_check_fn -> rcu_read_lock_sched -> ...
To avoid the recursion, either the ftrace codes needs to be marked with
__no_cfi or CFI should not trace. Use the "_notrace" in CFI to avoid
tracing so that CFI can guard ftrace.
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Cc: stable@vger.kernel.org
Fixes: cf68fffb66d6 ("add support for Clang CFI")
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210811155914.19550-1-quic_eberman@quicinc.com
Bug: 194223154
Change-Id: I7d112496c7f503f95ba69390f6454623cf6dfed2
(cherry picked from commit 14c4c8e41511aa8fba7fb239b20b6539b5bce201)
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
* refs/heads/tmp-fb8aecf:
FROMLIST: usb: dwc3: usb: dwc3: Force stop EP0 transfers during pullup disable
ANDROID: Update symbol list for mtk
ANDROID: scheduler: export task_sched_runtime
FROMLIST: mm: slub: fix slub_debug disabling for list of slabs
FROMLIST: mm/madvise: add MADV_WILLNEED to process_madvise()
ANDROID: Update the exynos symbol list
FROMGIT: firmware: arm_scmi: Free mailbox channels if probe fails
ANDROID: GKI: gki_defconfig: Enable CONFIG_NFC
ANDROID: sched: Make uclamp changes depend on CAP_SYS_NICE
ANDROID: GKI: update xiaomi symbol list and ABI XML
ANDROID: ABI: update generic symbol list
ANDROID: consolidate.fragment: Add missing arguments from gki_defconfig
ANDROID: scsi: ufs: Enable CONFIG_SCSI_UFS_HPB
ANDROID: scsi: ufs: Make CONFIG_SCSI_UFS_HPB compatible with the GKI
Change-Id: Ie17c7b85770678d3661b4e196eb10c194791a723
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
If rcu_print_task_stall() is invoked on an rcu_node structure that does
not contain any tasks blocking the current grace period, it takes an
early exit that fails to release that rcu_node structure's lock. This
results in a self-deadlock, which is detected by lockdep.
To reproduce this bug:
tools/testing/selftests/rcutorture/bin/kvm.sh --allcpus --duration 3 --trust-make --configs "TREE03" --kconfig "CONFIG_PROVE_LOCKING=y" --bootargs "rcutorture.stall_cpu=30 rcutorture.stall_cpu_block=1 rcutorture.fwd_progress=0 rcutorture.test_boost=0"
This will also result in other complaints, including RCU's scheduler
hook complaining about blocking rather than preemption and an rcutorture
writer stall.
Only a partial RCU CPU stall warning message will be printed because of
the self-deadlock.
This commit therefore releases the lock on the rcu_print_task_stall()
function's early exit path.
Fixes: c583bcb8f5 ("rcu: Don't invoke try_invoke_on_locked_down_task() with irqs disabled")
Tested-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
BUG: 196874644
(cherry picked from commit dc87740c8a6806bd2162bfb441770e4e53be5601
https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev)
Signed-off-by: Cheng Jui Wang <cheng-jui.wang@mediatek.com>
Change-Id: I0942973e3fbac2d666d8eb9ed59b1701af13248a
For power and performance monitoring, need to known tasks' runtime for
loading estimation.
But now, other modules can't get task_scehd_runtime.
Export task_sched_runtime to let other modules get task_scehd_runtime.
Bug: 195914330
Signed-off-by: Poting Chen <poting.chen@mediatek.com>
Signed-off-by: Cheng Jui Wang <cheng-jui.wang@mediatek.com>
Change-Id: Ida5caf8ed0a32954fc0b0ed950f163c7ca493fef
* keystone/mirror-android12-5.10:
ANDROID: ABI: update generic symbol list
ANDROID: GKI: update xiaomi symbol list and ABI XML
ANDROID: sched: Make uclamp changes depend on CAP_SYS_NICE
Signed-off-by: Haamed Gheibi <haamed@google.com>
Bug: 187186685
Bug: 191417025
Bug: 195765962
Change-Id: Ia0722e76d9cc3971a7860659dc5692d11147b8c4
There is currently nothing preventing tasks from changing their per-task
clamp values in anyway that they like. The rationale is probably that
system administrators are still able to limit those clamps thanks to the
cgroup interface. However, this causes pain in a system where both
per-task and per-cgroup clamp values are expected to be under the
control of core system components (as is the case for Android).
To fix this, let's require CAP_SYS_NICE to change per-task clamp values.
There are ongoing discussions upstream about more flexible approaches
than this using the RLIMIT API -- see [1]. But the upstream discussion
has not converged yet, and this is way too late for UAPI changes in
android12-5.10 anyway, so let's apply this change which provides the
behaviour we want without actually impacting UAPIs.
[1] https://lore.kernel.org/lkml/20210623123441.592348-4-qperret@google.com/
Bug: 187186685
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I749312a77306460318ac5374cf243d00b78120dd
* refs/heads/tmp-5cdc423:
UPSTREAM: arm64: vdso: Avoid ISB after reading from cntvct_el0
ANDROID: GKI: Disable X86_MCE drivers
ANDROID: GKI: Update symbols to symbol list
ANDROID: ABI: update allowed list for exynos
FROMGIT: sched: Skip priority checks with SCHED_FLAG_KEEP_PARAMS
FROMGIT: sched: Don't report SCHED_FLAG_SUGOV in sched_getattr()
FROMGIT: sched/deadline: Fix reset_on_fork reporting of DL tasks
BACKPORT: FROMGIT: sched: Fix UCLAMP_FLAG_IDLE setting
FROMGIT: Revert "usb: dwc3: gadget: Use list_replace_init() before traversing lists"
ANDROID: ABI: Update allowed list for galaxy
ANDROID: sched: add a helper function to change PELT half-life
FROMGIT: loop: Select I/O scheduler 'none' from inside add_disk()
FROMGIT: blk-mq: Introduce the BLK_MQ_F_NO_SCHED_BY_DEFAULT flag
FROMGIT: usb: typec: tcpm: Keep other events when receiving FRS and Sourcing_vbus events
FROMGIT: usb: dwc3: gadget: Avoid runtime resume if disabling pullup
FROMGIT: usb: dwc3: gadget: Use list_replace_init() before traversing lists
FROMGIT: arm64/cpufeature: Optionally disable MTE via command-line
ANDROID: ABI: update ABI XML
ANDROID: ABI: update generic symbol list
ANDROID: PCI/PM: Use usleep_range for d3hot_delay
FROMGIT: KVM: arm64: Unregister HYP sections from kmemleak in protected mode
FROMGIT: arm64: Move .hyp.rodata outside of the _sdata.._edata range
ANDROID: GKI: update .xml file after xhci bugfix
ANDROID: usb: host: fix slab-out-of-bounds in xhci_vendor_get_ops
UPSTREAM: pipe: make pipe writes always wake up readers
ANDROID: Revert "ANDROID: fs: pipe: wakeup readers on small writes even if pipe had data"
ANDROID: GKI: Enable CONFIG_USB_EHCI_ROOT_HUB_TT
Change-Id: I6bcae3847fa43a9bd5c75b571011f9c310426979
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
This change is for general scheduler improvement.
Change-Id: I8e5fbdb142a891f79b0073b2fc0ee7e81d46c845
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
This change is for general scheduler improvemnts.
Change-Id: Iae112690c5cf125db5d197555d47244a63bfb32e
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>