mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 03:27:30 -04:00
sched: Simplify ttwu_runnable()
Note that both proxy and delayed tasks have ->is_blocked set. Use this one condition to guard both paths. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://patch.msgid.link/20260526113322.714832584%40infradead.org
This commit is contained in:
@@ -3764,9 +3764,6 @@ static inline void proxy_reset_donor(struct rq *rq)
|
||||
*/
|
||||
static inline bool proxy_needs_return(struct rq *rq, struct task_struct *p)
|
||||
{
|
||||
if (!p->is_blocked)
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Typically per __set_task_cpu(), task_cpu(p) == p->wake_cpu.
|
||||
*
|
||||
@@ -3875,10 +3872,12 @@ static int ttwu_runnable(struct task_struct *p, int wake_flags)
|
||||
return 0;
|
||||
|
||||
update_rq_clock(rq);
|
||||
if (p->se.sched_delayed)
|
||||
enqueue_task(rq, p, ENQUEUE_NOCLOCK | ENQUEUE_DELAYED);
|
||||
if (proxy_needs_return(rq, p))
|
||||
return 0;
|
||||
if (p->is_blocked) {
|
||||
if (p->se.sched_delayed)
|
||||
enqueue_task(rq, p, ENQUEUE_NOCLOCK | ENQUEUE_DELAYED);
|
||||
if (proxy_needs_return(rq, p))
|
||||
return 0;
|
||||
}
|
||||
if (!task_on_cpu(rq, p)) {
|
||||
/*
|
||||
* When on_rq && !on_cpu the task is preempted, see if
|
||||
|
||||
Reference in New Issue
Block a user