Subject: [PATCH v7 3/3] arm64: Add do_softirq_own_stack() and enable irq_stacks

From: [email-masked] (James Morse)
Date: Tue, 08 Dec 2015 10:11:58 +0000

On 04/12/15 13:12, Catalin Marinas wrote:
> One thing I'm not clear about is whether __do_softirq can be preempted
> when executed in process context, it could mess up our stack
> assumptions.

Previously I thought not, because in __do_softirq():
> __local_bh_disable_ip(_RET_IP_, SOFTIRQ_OFFSET);

Increases the softirq part of preempt_count, before:
> local_irq_enable()

so preempt_count is always non-zero when we have interrupts (re)enabled
on the irq_stack...

... but its a little murkier than I first thought,
__cond_resched_softirq() looks like it will re-schedule a task if it is
processing softirqs, while softirqs are disabled.

net/core/sock.c:__release_sock is the only caller, I haven't yet worked
out if this can happen while on the irq stack.

James