Re: [patch V6 07/37] x86/entry: Provide helpers for execute on irqstack
From: Thomas Gleixner
Date: Mon May 18 2020 - 19:53:28 EST
Andy Lutomirski <luto@xxxxxxxxxx> writes:
> Actually, I revoke my ack. Can you make one of two changes:
>
> Option A: Add an assertion to run_on_irqstack to verify that irq_count
> was -1 at the beginning? I suppose this also means you could just
> explicitly write 0 instead of adding and subtracting.
>
> Option B: Make run_on_irqstack() just call the function on the current
> stack if we're already on the irq stack.
>
> Right now, it's too easy to mess up and not verify the right
> precondition before calling run_on_irqstack().
>
> If you choose A, perhaps add a helper to do the if(irq_needs_irqstack)
> dance so that users can just do:
>
> run_on_irqstack_if_needed(...);
>
> instead of checking everything themselves.
I'll have a look tomorrow morning with brain awake.