mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 07:47:50 +00:00
sched: Fold rq-pin swizzle into __balance_callbacks()
Prepare for more users needing the rq-pin swizzle. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Pierre Gondois <pierre.gondois@arm.com> Tested-by: Juri Lelli <juri.lelli@redhat.com> Link: https://patch.msgid.link/20260114130528.GB831285@noisy.programming.kicks-ass.net
This commit is contained in:
@@ -4950,9 +4950,13 @@ struct balance_callback *splice_balance_callbacks(struct rq *rq)
|
||||
return __splice_balance_callbacks(rq, true);
|
||||
}
|
||||
|
||||
static void __balance_callbacks(struct rq *rq)
|
||||
static void __balance_callbacks(struct rq *rq, struct rq_flags *rf)
|
||||
{
|
||||
if (rf)
|
||||
rq_unpin_lock(rq, rf);
|
||||
do_balance_callbacks(rq, __splice_balance_callbacks(rq, false));
|
||||
if (rf)
|
||||
rq_repin_lock(rq, rf);
|
||||
}
|
||||
|
||||
void balance_callbacks(struct rq *rq, struct balance_callback *head)
|
||||
@@ -4991,7 +4995,7 @@ static inline void finish_lock_switch(struct rq *rq)
|
||||
* prev into current:
|
||||
*/
|
||||
spin_acquire(&__rq_lockp(rq)->dep_map, 0, 0, _THIS_IP_);
|
||||
__balance_callbacks(rq);
|
||||
__balance_callbacks(rq, NULL);
|
||||
raw_spin_rq_unlock_irq(rq);
|
||||
}
|
||||
|
||||
@@ -6867,7 +6871,7 @@ keep_resched:
|
||||
proxy_tag_curr(rq, next);
|
||||
|
||||
rq_unpin_lock(rq, &rf);
|
||||
__balance_callbacks(rq);
|
||||
__balance_callbacks(rq, NULL);
|
||||
raw_spin_rq_unlock_irq(rq);
|
||||
}
|
||||
trace_sched_exit_tp(is_switch);
|
||||
@@ -7362,9 +7366,7 @@ void rt_mutex_setprio(struct task_struct *p, struct task_struct *pi_task)
|
||||
out_unlock:
|
||||
/* Caller holds task_struct::pi_lock, IRQs are still disabled */
|
||||
|
||||
rq_unpin_lock(rq, &rf);
|
||||
__balance_callbacks(rq);
|
||||
rq_repin_lock(rq, &rf);
|
||||
__balance_callbacks(rq, &rf);
|
||||
__task_rq_unlock(rq, p, &rf);
|
||||
}
|
||||
#endif /* CONFIG_RT_MUTEXES */
|
||||
|
||||
Reference in New Issue
Block a user