In some cases we would like to bypass oom panic and give the system more
time to cleanup memory. Add vendor hook to allow skipping the oom panic.
Bug: 186875166
Change-Id: I64e74b2c013d6f18d74504777c6559d9ae07e008
Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
Signed-off-by: Sudarshan Rajagopalan <quic_sudaraja@quicinc.com>
This reverts commit bf2290a48a (Revert "ANDROID: vendor_hooks: set
debugging data when rt_mutex is working")
The original patch has been reverted to resolve merge issues.
This patch adds again the vendor hooks for the original purpose.
Bug: 216016261
Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I00162d88e2a446e9ece4804def098fcdc63fceb9
(cherry picked from commit d497887b00ac3e5e380123cac4a303d009b570ee)
This reverts commit 31c9ccb138 (Revert "ANDROID: vendor_hooks: add
waiting information for blocked tasks")
And also revert portions of 396a501b1743 (Revert "ANDROID: rwsem: Add
vendor hook to the rw-semaphore")
The original patch has been reverted to resolve merge issues.
This patch adds again the vendor hooks for the original purpose.
Bug: 216016261
Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I04ed7b055eee40f7975bd5d74fb73dd080cd76bf
(cherry picked from commit c23da05eac0d35441695caff0b7d0220f92ca8a0)
Allow module to control behavior of get_nohz_timer_target.
Bug: 205164003
Change-Id: I38cb201ebf06db7bbce0d6cb68dbbe3729355be8
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
To support the replacement of pause, is_cpu_allowed is the best
place to hook into the code to restrict CPUs for a module based
implementation. This restricts select_fallback_rq, select_task_rq,
and __migate_task, to ensure the cpu is allowed.
Include a hook in is_cpu_allowed to allow the module to control
which cpu is allowed during a migration event.
Bug: 205164003
Change-Id: I665e4d39318079bdb99bd248969ecb9eb528f9df
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
Add vendor hook for affinity setting to GIC irqchip driver.
GIC irqchip driver support only single CPU for affinity setting.
But GIC HW can support multi target IRQ action, any available CPU can
service IRQ when requested irq arised. This feature is very useful
for some fast irq action required device.
So Add vendor hook to support multi target affinity setting.
Bug: 210559155
Change-Id: If44b2244bb623bf8d4755109a6dca32ac35df795
Signed-off-by: Hajun Sung <hajun.sung@samsung.com>
Add android_rvh_find_new_ilb to select a next ilb cpu for vendors.
Bug: 190228983
Change-Id: Iba1a0cd9cdc22dcf628dd33f8d838fe513a4818f
Signed-off-by: Choonghoon Park <choong.park@samsung.com>
A vendor hook is added in post_init_entity_util_avg before
a new cfs task's util is attached to cfs_rq's util so that
vendors can gather and modify se's information to modify
scheduling behavior and DVFS as they want.
trace_android_rvh_new_task_stats is not a proper hook because
it is called after the task's util is attached to cfs_rq's util,
which means updating cfs_rq's sched_avg and DVFS request are done.
Bug: 184219858
Signed-off-by: Choonghoon Park <choong.park@samsung.com>
Change-Id: I2deaa93297f8464895978496c9838cdffaa35b7f
Vendor scheduler may not want to rebalance between domains in some case.
New vendor hook is added for vendor to decide whether rebalance domains.
Bug: 176952463
Change-Id: Ie2edbd4b11679786096dd0170496904ae180583c
Signed-off-by: Park Bumgyu <bumgyu.park@samsung.com>
When a task yields, it relinquishes the cpu and
scheduler is tasked to find another task.
However our vendor scheduler logic implementation
could return the same task leading to a loop where
the yielded task gets to run back, so add hook point
in do_sched_yield() for vendor can do some work
before task is scheduled.
Bug: 205804537
Change-Id: I6528c3f4b0ee360559ef9c97cb1eb2b2d1357870
Signed-off-by: Tengfei Fan <quic_tengfan@quicinc.com>
Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
This reverts commit df18d99dab.
And also revert portions of 9ad8ff902e ("ANDROID: vendor_hooks: add
waiting information for blocked tasks")
In the 5.15.6 kernel release, the rwsem code was reworked such that the
existing Android trace hooks became incorrect and were causing major
merge issues. Revert the hooks and if they are still needed, they can
be added back later.
Bug: 161400830
Bug: 162776704
Cc: Sangmoon Kim <sangmoon.kim@samsung.com>
Cc: JianMin Liu <jian-min.liu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ifb3d2ed0bdc73b70718820fbf31e775fedb387c5
Initial kernel bootup logs get overwritten after running
for a long time, and there can be debugging scenario where
we need initial ~100s bootup logs for debugging.
'android_vh_initial_logbuf' vendor hook is helping in
achieving this purpose.
Bug: 199236943
Change-Id: I706824aeb566c09ecaf4b5900973d6cee8a2f35b
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
(cherry picked from commit 34fde61f72)
Signed-off-by: Yogesh Lal <ylal@codeaurora.org>
Vendor architectures may contain CPUs running on the same clock line
which contain different capacities. Add a tracehook in this path to
allow vendor modules to skip implicit check to prevent crashes.
Bug: 206602617
Change-Id: Ica01a214689607b8d79b370c20bc9a8c44ca2117
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
Restricted vendor hook to modify the cpu selected in rto_next_cpu,
which is needed for the implementation of CPU Pause.
Bug: 205164003
Change-Id: I0dc675e54f7f116d538840262fbb0ba6d28246f4
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
It is necessary to update the valid mask to implement CPU Pause
from a vendor module. Introduce a hook to allow this.
Bug: 205164003
Change-Id: Ic99b74d17f361453b044e115a54698e566db13b6
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
Through this vendor hook, we can get the timing to check
current running task for the validation of its credential
and bpf operations.
Bug: 191291287
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: Ie4ed8df7ad66df2486fc7e52a26d9191fc0c176e
(cherry picked from commit 38abaebab7)
Through this vendor hook, we can get the timing to check
current running task for the validation of its credential
and open operation.
Bug: 191291287
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: Ia644ceb02dbc230ee1d25cad3630c2c3f908e41a
(cherry picked from commit a7a3b31d58)
Through this vendor hook, we can get the timing to check
current running task for the validation of its credential
and related operations.
Bug: 191291287
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: If20bd8bb8311ad10a374033734fbdc7ef61a7704
(cherry picked from commit a5543c9cd7)
Add restricted vendor hook for selinux_state, so we can
know if the selinux_state is initialized
Bug: 186363840
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: Ideed051a1d53ed1bce7d7915e38366264a7d77eb
Add vendor hook for module init, so we can get memory type and
use it to do memory type check for architecture
dependent page table setting.
Bug: 181639260
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: I95b70d7a57994f2548fddfb2290d4c9136f58785
Add restricted vendor hook for creds, so we get the cred
information to monitor cred lifetime.
Bug: 181639260
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: I8f254464e07f9c88336995152479ce91deb13c75
Add restricted vendor hook for avc, so we can get avc_node
information to monitor avc lifetime.
Bug: 181639260
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: Idbebeca926c2cb407264f2872b032e1f18462697
Need to update to restricted hook since the module code registering for
this hook needs to take the task lock and walk over the linked
libraries.
Bug: 194431527
Change-Id: I7093b66f95c3b9c473386ade60d8897426ddbb13
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
When performing memory reclaim, support treating anonymous and
file backed pages equally. Swapping anonymous pages out to memory
can be efficient enough to justify treating anonymous and file backed
pages equally.
Create a vendor hook inside of get_scan_count so that equal reclaim of
anon and file pages can be enabled inside of the trace hook based on
certain conditions.
Bug: 175415908
Change-Id: Idac2f1468371549d20dd3e5652c7382dc3d7d9cf
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
In Android GKI, CONFIG_FAIR_GROUP_SCHED is enabled [1] to help
prioritize important work. Given that CPU shares of root cgroup
can't be changed, leaving the tasks inside root cgroup will give
them higher share compared to the other tasks inside important
cgroups. This is mitigated by moving all tasks inside root cgroup to
a different cgroup after Android is booted. However, there are many
kernel tasks stuck in the root cgroup after the boot.
It is possible to relax kernel threads and kworkers migrations under
certain scenarios. However the patch [2] posted at upstream is not
accepted. Hence add a restricted vendor hook to notify modules when a
kernel thread is requested for cgroup migration. The modules can relax
the restrictions forced by the kernel and allow the cgroup migration.
[1] f08f049de1
[2] https://lore.kernel.org/lkml/1617714261-18111-1-git-send-email-pkondeti@codeaurora.org
Bug: 184594949
Change-Id: I445a170ba797c8bece3b4b59b7a42cdd85438f1f
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
A restricted vendor hook for cpufreq transition. The hook is
invoked per policy after changing the policy->cur and passes
policy as an argument.
Bug: 181889516
Change-Id: I6f89850779fdd63e178e227c293f42b7f66fd78d
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
Add vendor hook for iommu_dma_alloc_iova and iommu_dma_free_iova
to allow vendor enhancement.
Bug: 187861158
Change-Id: I2ebe8b24318bd5292edc66a94d7109332d478212
Signed-off-by: Guangming Cao <Guangming.Cao@mediatek.com>
(cherry picked from commit 15acc8fac6)
Add a vendor hook for modules to know when the topology
code has determined the max capacity of cpus.
Bug: 200103201
Change-Id: Ia3e22479059d2e57500cbdd46504aa4773af6e4a
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Ashay Jaiswal <quic_ashayj@quicinc.com>
Add a restricted vendor hook to notify that a cpu controller
cgroup is online.
Bug: 200103201
Change-Id: I7d37f38c24ce146eabb4716a959aee703d71926e
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
Signed-off-by: Ashay Jaiswal <quic_ashayj@quicinc.com>
At present, EAS gets disabled when on ASYM Capacity systems
if all BIG or Little CPUs gets hot-plugged. Instead of disabling
EAS by default, add trace hook and let vendor decide if EAS should
be disabled or not.
Bug: 200103201
Change-Id: I583272cc89d44f3e3a4b1c43e3f75d731092ebf6
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Signed-off-by: Ashay Jaiswal <quic_ashayj@quicinc.com>
There are few vendor hooks available for binder wakeup related
functionality. As they both essentially do the same thing, we can
consolidate them into one.
Bug: 200103201
Change-Id: I44b472e7564eecbe8236ad2eb88b0433195f14d8
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
This reverts commit 627a494ef3.
Reverting commit to add the vendor hooks back, this is to facilitate
various scheduler value adds.
Bug: 200103201
Change-Id: Ifbd7d235f863e01848c22b8185c4ec94da8c862c
Signed-off-by: Ashay Jaiswal <quic_ashayj@quicinc.com>
This reverts portions of commit 9ad8ff902e
The mutex code is rewritten in 5.15-rc1, so hooks like this are no
longer in the correct location, if even needed at all. So remove them
for now, if vendors still need them, they can add them back in.
Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ib85c108e5bb306faea4fef5e0ca3b617a7f8f5c6
This reverts commit e289faa9f1.
The mutex code is rewritten in 5.15-rc1, so hooks like this are no
longer in the correct location, if even needed at all. So remove them
for now, if vendors still need them, they can add them back in.
Cc: JINHO LIM <jordan.lim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Idceef90a86c8794008e2f013d6ff958142661572
In order to debug critical domain and device power issues, it may be
necessary to disallow certain idle states at runtime. Enable a vendor
hook to check if a domain idle state is allowed for powering down the
domain.
Bug: 175718935
Bug: 195914333
Change-Id: I403c0c7d272439fb338bbf54a346861559385047
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Since we're expecting timers more precisely in short period, add
a vendor hook to calc_index when adding timers. Then we can modify
the index this timer used to make it accurate.
Bug: 178758017
Signed-off-by: Huang Yiwei <hyiwei@codeaurora.org>
Change-Id: Ie0e6493ae7ad53b0cc57eb1bbcf8a0a11f652828
android_vh_ptype_head:
To add a debugging chain to ptype list
android_vh_kfree_skb
To sniff the dropped packet at kernel network
Bug: 163716381
Signed-off-by: Bae Soukjin <soukjin.bae@samsung.com>
Change-Id: Ide80bf0a129da31a1824d4a33026ac42be327361
(cherry picked from commit d88b2969cf)
(cherry picked from commit a8021ba684)
Add vendor hook for arch_setup_dma_ops to allow vendor enhancement. This
hook can be used to setup vendor-specific DMA ops for certain IOMMU
clients based on their IOMMU configuration.
Bug: 179291683
Change-Id: Ie847a14d6536eb151cbd0a93452f6895ee451930
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Signed-off-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
(cherry picked from commit 575ad9a263)
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Add a vendor hook when a set of tasks change the cgroups in
the controller for performance tuning.
Bug: 187972571
Signed-off-by: Jing-Ting Wu <Jing-Ting.Wu@mediatek.com>
Change-Id: If0ea3d089e077a4650507c69b6e60952d102fa1d
We already applied the 'vendor hook' for Dtask Debugging Information
in below issue.
(https://issuetracker.google.com/issues/162776704)
There are vendor hook call in mutex and rw_semaphore, but not for rt_mutex
Please refer to description in details as below,
1. Description
This feature writes rt mutex lock waiting information
on the task_struct structure. We can check mutex information and
mutex owner through the kernel log and custom analysis tools.
Like the previous feature in mutex and rw semaphore,
added data can be checked by ramdump analysis.
2. Vendor Hook Position
1) VENDOR_DATA
- struct task_struct in sched.h
VENDOR_DATA_ARRAY(2)
[0] : type // RTmutex (Mutex, Rwsem, ...)
[1] : pointer // address of lock
2) VENDOR_HOOKs
- __rt_mutex_slowlock() in kernel/locking/rtmutex.c
3. Example
- SysRq-w in kernel log
...
[ 54.164463] [3: kworker/u16:3: 253] kworker/3:2 D12736 418 2 0x00000228
[ 54.164497] [3: kworker/u16:3: 253] RTmutex: 0xffffffc051fa3ae8: owner[sh :9003]
[ 54.167812] [3: kworker/u16:3: 253] sh D12848 9003 6900 0x04000200
[ 54.167824] [3: kworker/u16:3: 253] RTmutex: 0xffffffc051fa3b08: owner[kworker/3:2 :418]
...
Bug: 186567468
Signed-off-by: JINHO LIM <jordan.lim@samsung.com>
Change-Id: I93f9753be0b2c1fa1a6eaea09379d54c31d1ebcf
This adds some missing hooks for ufs commands, including request,
query, uic, task manager commands, and interrupt events for vendor.
Those can be used for vendor module to understand command history.
Bug: 172305874
Bug: 176940922
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ie447860290f4fbc1e03ad8ae5f50bd02121756cb