ANDROID: Sync proxy-exec logic to v19 (from v18)

Just aligning android16-6.12 tree to the changes
made in proxy-exec v19.

v18 series:
https://github.com/johnstultz-work/linux-dev/commits/proxy-exec-v18-6.12

v19 series:
https://github.com/johnstultz-work/linux-dev/commits/proxy-exec-v19-6.12

Changes since v18:
* Build fixup for PREEMPT_RT suggested by K Prateek Nayak
* Slight re-arrangement of functions to clean up later patches
* Slight tweak further simplifying update_curr_common() suggested by Peter
* Rename try_to_block_task() arguments and add additional comments
  suggested by Peter
* Push proxy_resched_idle() returning rq->idle to a later patch in the
  series, as suggested by Peter.
* Build fixup for !CONFIG_SMP and CONFIG_SCHED_PROXY_EXEC
* Fixed proxy_force_return() logic for !SMP cases

Bug: 431329485
Change-Id: I3dd8ddab236f9c1b68e2495a4023f5b474265aa6
Signed-off-by: John Stultz <jstultz@google.com>
This commit is contained in:
John Stultz
2025-07-12 03:08:19 +00:00
parent 7d6f7afb0d
commit e740e8d9ea
5 changed files with 49 additions and 26 deletions
+3 -9
View File
@@ -284,16 +284,13 @@ __ww_mutex_die(struct MUTEX *lock, struct MUTEX_WAITER *waiter,
#ifndef WW_RT
debug_mutex_wake_waiter(lock, waiter);
#endif
/* nested as we should hold current->blocked_lock already */
raw_spin_lock_nested(&waiter->task->blocked_lock, SINGLE_DEPTH_NESTING);
/*
* When waking up the task to die, be sure to set the
* blocked_on_state to BO_WAKING. Otherwise we can see
* circular blocked_on relationships that can't resolve.
*/
WARN_ON_ONCE(__get_task_blocked_on(waiter->task) != lock);
__set_blocked_on_waking(waiter->task);
raw_spin_unlock(&waiter->task->blocked_lock);
/* nested as we should hold current->blocked_lock already */
set_blocked_on_waking_nested(waiter->task, lock);
wake_q_add(wake_q, waiter->task);
}
@@ -342,15 +339,12 @@ static bool __ww_mutex_wound(struct MUTEX *lock,
* wakeup pending to re-read the wounded state.
*/
if (owner != current) {
/* nested as we should hold current->blocked_lock already */
raw_spin_lock_nested(&owner->blocked_lock, SINGLE_DEPTH_NESTING);
/*
* When waking up the task to wound, be sure to set the
* blocked_on_state to BO_WAKING. Otherwise we can see
* circular blocked_on relationships that can't resolve.
*/
__set_blocked_on_waking(owner);
raw_spin_unlock(&owner->blocked_lock);
set_blocked_on_waking_nested(owner, lock);
wake_q_add(wake_q, owner);
}
return true;