mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-14 05:09:36 +02:00
ANDROID: vendor_hooks: add hook in alloc_and_link_pwqs()
This hook is used to apply specific flags and attrs to workqueue_struct. Bug: 348321531 Change-Id: I877eae65a8d02719e216ab2df6e627e360e11078 Signed-off-by: Yang Yang <yang.yang@vivo.com>
This commit is contained in:
parent
55b691a3a1
commit
f437bda7c4
|
@ -124,6 +124,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_idle_enter);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_idle_exit);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_idle_exit);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mpam_set);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mpam_set);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_wq_lockup_pool);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_wq_lockup_pool);
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_alloc_and_link_pwqs);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ipi_stop);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ipi_stop);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sysrq_crash);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sysrq_crash);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_printk_hotplug);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_printk_hotplug);
|
||||||
|
|
|
@ -14,6 +14,10 @@ DECLARE_HOOK(android_vh_wq_lockup_pool,
|
||||||
TP_PROTO(int cpu, unsigned long pool_ts),
|
TP_PROTO(int cpu, unsigned long pool_ts),
|
||||||
TP_ARGS(cpu, pool_ts));
|
TP_ARGS(cpu, pool_ts));
|
||||||
|
|
||||||
|
DECLARE_HOOK(android_rvh_alloc_and_link_pwqs,
|
||||||
|
TP_PROTO(struct workqueue_struct *wq, int *ret, bool *skip),
|
||||||
|
TP_ARGS(wq, ret, skip));
|
||||||
|
|
||||||
#endif /* _TRACE_HOOK_WQLOCKUP_H */
|
#endif /* _TRACE_HOOK_WQLOCKUP_H */
|
||||||
/* This part must be outside protection */
|
/* This part must be outside protection */
|
||||||
#include <trace/define_trace.h>
|
#include <trace/define_trace.h>
|
||||||
|
|
|
@ -4578,6 +4578,7 @@ static int alloc_and_link_pwqs(struct workqueue_struct *wq)
|
||||||
{
|
{
|
||||||
bool highpri = wq->flags & WQ_HIGHPRI;
|
bool highpri = wq->flags & WQ_HIGHPRI;
|
||||||
int cpu, ret;
|
int cpu, ret;
|
||||||
|
bool skip = false;
|
||||||
|
|
||||||
wq->cpu_pwq = alloc_percpu(struct pool_workqueue *);
|
wq->cpu_pwq = alloc_percpu(struct pool_workqueue *);
|
||||||
if (!wq->cpu_pwq)
|
if (!wq->cpu_pwq)
|
||||||
|
@ -4604,6 +4605,10 @@ static int alloc_and_link_pwqs(struct workqueue_struct *wq)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trace_android_rvh_alloc_and_link_pwqs(wq, &ret, &skip);
|
||||||
|
if (skip)
|
||||||
|
goto oem_skip;
|
||||||
|
|
||||||
cpus_read_lock();
|
cpus_read_lock();
|
||||||
if (wq->flags & __WQ_ORDERED) {
|
if (wq->flags & __WQ_ORDERED) {
|
||||||
ret = apply_workqueue_attrs(wq, ordered_wq_attrs[highpri]);
|
ret = apply_workqueue_attrs(wq, ordered_wq_attrs[highpri]);
|
||||||
|
@ -4616,6 +4621,7 @@ static int alloc_and_link_pwqs(struct workqueue_struct *wq)
|
||||||
}
|
}
|
||||||
cpus_read_unlock();
|
cpus_read_unlock();
|
||||||
|
|
||||||
|
oem_skip:
|
||||||
/* for unbound pwq, flush the pwq_release_worker ensures that the
|
/* for unbound pwq, flush the pwq_release_worker ensures that the
|
||||||
* pwq_release_workfn() completes before calling kfree(wq).
|
* pwq_release_workfn() completes before calling kfree(wq).
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user