On Tue, May 12, 2020 at 9:50 AM Thomas Gleixner <[email protected]> wrote:
>
> Thomas Gleixner <[email protected]> writes:
> > Andy Lutomirski <[email protected]> writes:
> >> WARN_ON_ONCE(!on_thread_stack() && (regs->flags & X86_FLAGS_IF) &&
> >> preempt_count() == 0);
> >>
> >> IOW, the actual condition we want is that, if the idtenter_entry/exit
> >> code might schedule or if a cond_local_irq_enable() path might
> >> schedule, we had better be on the correct stack.
> >>
> >> Sorry for causing confusion.
> >
> > Nothing to be sorry about. I could have thought about it myself :)
> > Let me try again.
>
> Move it into the actual preemption condition. Most natural place.

Nice!  This way the logic is clear and the warning will fire even if
no actual preemption occurs.

Acked-by: Andy Lutomirski <[email protected]>

Reply via email to