IPI sending difference between x86 and ARM
All,
is it intentional that gicv2_send_SGI() (and all of the higher layers) keep the sending CPU in the target mask, while all x86's send_IPI_mask_...() specifically exclude the local CPU? I'm asking namely in the context of cpumask_raise_softirq(), which - other than cpu_raise_softirq() - does not itself exclude the local CPU (and hence I wonder whether adding that check would have the potential of breaking ARM).
Jan
Quoted 5 lines · Jan Beulich
All,
is it intentional that
gicv2_send_SGI()(and all of the higher layers) keep the sending CPU in the target mask, while all x86's send_IPI_mask_...() specifically exclude the local CPU?
I guess you mean specifically the SGI_TARGET_LIST case? This is a pretty low level function arch specific function, I don't have a particular opinion on how it should behave in this respect, although since we have both SGI_TARGET_OTHERS and SGI_TARGET_SELF I think it seems OK to let SGI_TARGET_LIST include SELF.
I suspect it mainly matters at the next level up, when we get to the common arch interfaces, though and in general that is where we currently try and add these checks.
Quoted 4 lines
I'm asking namely in the context of
cpumask_raise_softirq(), which - other thancpu_raise_softirq()- does not itself exclude the local CPU (and hence I wonder whether adding that check would have the potential of breaking ARM).
cpumask_raise_softirq calls smp_send_event_check_mask, I think that would be the right place to handle the cross-arch semantics of whether to include self in the mask or not, as we do e.g. in smp_send_call_function_mask.
Part of the problem is that the expected behaviour of some of these arch interfaces (e.g. smp_*) is not clearly defined so we had to reverse engineer them from the x86 behaviour (which has multiple backends and function ptrs etc), it's not improbable that we got it wrong.
Anyway, if smp_send_event_check_mask is supposed to exclude the calling CPU then we should fix that on ARM in the name of consistency/sanity. In the event it causes other issues then we should fix those as they arise.
Ian.
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 10.09.14 at 12:01, <[email protected]> wrote:
Anyway, if
smp_send_event_check_maskis supposed to exclude the calling CPU then we should fix that on ARM in the name of consistency/sanity. In the event it causes other issues then we should fix those as they arise.
Actually I was instead considering to filter the local CPU in cpumask_raise_softirq(), just like cpu_raise_softirq() does. That would make changes to smp_send_event_check_mask() unnecessary.
Jan
Quoted 9 lines · Jan Beulich
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 10.09.14 at 12:01, <[email protected]> wrote:
Anyway, if
smp_send_event_check_maskis supposed to exclude the calling CPU then we should fix that on ARM in the name of consistency/sanity. In the event it causes other issues then we should fix those as they arise.Actually I was instead considering to filter the local CPU in
cpumask_raise_softirq(), just likecpu_raise_softirq()does. That would make changes tosmp_send_event_check_mask()unnecessary.
Sure, that would be fine and good too.
But independent of that I think smp_send_event_check_mask() should behave the same on x86 as ARM wrt including the current CPU.
Ian.
Quoted 12 lines
Quoted 1 line
Quoted 1 line · On 10.09.14 at 12:19, <[email protected]> wrote:
Quoted 9 lines · Jan Beulich
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 10.09.14 at 12:01, <[email protected]> wrote:
Anyway, if
smp_send_event_check_maskis supposed to exclude the calling CPU then we should fix that on ARM in the name of consistency/sanity. In the event it causes other issues then we should fix those as they arise.Actually I was instead considering to filter the local CPU in
cpumask_raise_softirq(), just likecpu_raise_softirq()does. That would make changes tosmp_send_event_check_mask()unnecessary.
Quoted 4 lines
Sure, that would be fine and good too.
But independent of that I think
smp_send_event_check_mask()should behave the same on x86 as ARM wrt including the current CPU.
But the dropping of the local CPU doesn't happen in smp_send_event_check_mask() on x86 - it's further down the call chain where this gets done. And by fixing the caller we make it so that the specific arch's behavior doesn't matter anymore.
Jan
Quoted 12 lines · Jan Beulich
Quoted 12 lines
Quoted 1 line
Quoted 1 line · On 10.09.14 at 12:19, <[email protected]> wrote:
Quoted 9 lines · Jan Beulich
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 10.09.14 at 12:01, <[email protected]> wrote:
Anyway, if
smp_send_event_check_maskis supposed to exclude the calling CPU then we should fix that on ARM in the name of consistency/sanity. In the event it causes other issues then we should fix those as they arise.Actually I was instead considering to filter the local CPU in
cpumask_raise_softirq(), just likecpu_raise_softirq()does. That would make changes tosmp_send_event_check_mask()unnecessary.
Quoted 8 lines
Quoted 4 lines
Sure, that would be fine and good too.
But independent of that I think
smp_send_event_check_mask()should behave the same on x86 as ARM wrt including the current CPU.But the dropping of the local CPU doesn't happen in
smp_send_event_check_mask()on x86 - it's further down the call chain where this gets done.
I don't think this is relevant. smp_send_event_check_mask is the arch agnostic interface and it should have some specified behaviour (which is de facto to remove the local CPU from mask).
Whether the arch chooses to implement this at the top or the bottom of the call chain from there on is up to the arch code.
Quoted 2 lines
And by fixing the caller we make
it so that the specific arch's behavior doesn't matter anymore.
Except to any other callers, present and future.
Having generic arch interfaces which differ between architectures is just unhelpful to everyone IMHO.
Ian.