Re: [PATCH v2] sched: Remove a preempt-disable section in rt_mutex_setprio()
From: Steven Rostedt
Date: Wed Jun 11 2025 - 10:16:13 EST
On Wed, 11 Jun 2025 11:03:06 +0200
Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -7292,14 +7292,10 @@ void rt_mutex_setprio(struct task_struct *p, struct task_struct *pi_task)
> >
> > check_class_changed(rq, p, prev_class, oldprio);
> > out_unlock:
> > - /* Avoid rq from going away on us: */
> > - preempt_disable();
>
> Perhaps add:
>
> /* IRQs are still disabled */
>
> or something to that effect such that it is obvious from reading the
> code that dropping the lock will not enable preemption?
Hmm, wouldn't lockdep_assert_irqs_disabled() be better than a comment.
It lets people know that interrupts are disabled and when lockdep is
enabled it also makes sure they are.
-- Steve