ANDROID: vendor_hooks: Add vendor_hook in futex to fix the OEM scheduling priority bug
Add vendor_hook in futex to fix the bug where OEM passes scheduling
priority to the futex owner but fails to restore it.
1) OEM vendors pass the priority to the futex owner in
trace_android_vh_futex_wait_start() and are supposed to restore it in
trace_android_vh_futex_wait_end(). However, due to the missing
trace_android_vh_futex_wait_end hook, the priority cannot be restored.
2) In kernel 6.6/6.1, futex_wait() uses goto out, so only one
trace_android_vh_futex_wait_end() is required. In kernel 6.12, there
are two return statements in the middle of futex_wait(), so
trace_android_vh_futex_wait_end hooks must also be added at these
return positions.
Bug: 429315946
Fixes: 4f417c9c41 ("ANDROID: vendor_hooks: Add hooks for oem futex optimization")
Change-Id: Id2e2d28603509c2cadc3511e16e24c96c98c5b75
Signed-off-by: Fuchun Liao <lfc@oppo.com>
This commit is contained in:
committed by
Treehugger Robot
parent
6eb6f346ac
commit
740d42d181
@@ -705,8 +705,10 @@ int futex_wait(u32 __user *uaddr, unsigned int flags, u32 val, ktime_t *abs_time
|
||||
ret = __futex_wait(uaddr, flags, val, to, bitset);
|
||||
|
||||
/* No timeout, nothing to clean up. */
|
||||
if (!to)
|
||||
if (!to) {
|
||||
trace_android_vh_futex_wait_end(flags, bitset);
|
||||
return ret;
|
||||
}
|
||||
|
||||
hrtimer_cancel(&to->timer);
|
||||
destroy_hrtimer_on_stack(&to->timer);
|
||||
@@ -719,6 +721,7 @@ int futex_wait(u32 __user *uaddr, unsigned int flags, u32 val, ktime_t *abs_time
|
||||
restart->futex.bitset = bitset;
|
||||
restart->futex.flags = flags | FLAGS_HAS_TIMEOUT;
|
||||
|
||||
trace_android_vh_futex_wait_end(flags, bitset);
|
||||
return set_restart_fn(restart, futex_wait_restart);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user