Re: [PATCH] sched/deadline: fix inactive_task_timer splat with CONFIG_PREEMPT_RT

From: Valentin Schneider
Date: Wed Jan 18 2023 - 13:29:01 EST


On 18/01/23 10:11, Paul E. McKenney wrote:
> On Wed, Jan 18, 2023 at 03:57:38PM +0000, Valentin Schneider wrote:
>> > Given that this problem occurred in PREEMPT_RT, I am assuming that the
>> > appropriate definition of "atomic context" is "cannot call schedule()".
>> > And you are in fact not permitted to call schedule() from a bh-disabled
>> > region.
>> >
>> > This also means that you cannot acquire a non-raw spinlock in a
>> > bh-disabled region of code in a PREEMPT_RT kernel, because doing
>> > so can invoke schedule.
>>
>> But per the PREEMPT_RT lock "replacement", non-raw spinlocks end up
>> invoking schedule_rtlock(), which should be safe vs BH disabled
>> (local_lock() + rcu_read_lock()):
>>
>> 6991436c2b5d ("sched/core: Provide a scheduling point for RT locks")
>>
>> Unless I'm missing something else?
>
> No, you miss nothing. Apologies for my confusion!
>
> (I could have sworn that someone else corrected me on this earlier,
> but I don't see it right off hand.)
>
> Thanx, Paul

Heh, I had a smidge of doubt myself, but since we've cleared this up:

Reviewed-by: Valentin Schneider <vschneid@xxxxxxxxxx>