Re: [PATCH V4 7/7] Drivers: hv: vmbus: disable local interrupt when hvsock's callback is running

From: David Miller
Date: Wed Jul 29 2015 - 18:28:17 EST


From: Dexuan Cui <decui@xxxxxxxxxxxxx>
Date: Tue, 28 Jul 2015 05:35:30 -0700

> In the SMP guest case, when the per-channel callback hvsock_events() is
> running on virtual CPU A, if the guest tries to close the connection on
> virtual CPU B: we invoke vmbus_close() -> vmbus_close_internal(),
> then we can have trouble: on B, vmbus_close_internal() will send IPI
> reset_channel_cb() to A, trying to set channel->onchannel_callbackto NULL;
> on A, if the IPI handler happens between
> "if (channel->onchannel_callback != NULL)" and invoking
> channel->onchannel_callback, we'll invoke a function pointer of NULL.
>
> This is why the patch is necessary.
>
> Signed-off-by: Dexuan Cui <decui@xxxxxxxxxxxxx>

Sorry, I do not accept that you must use conditional locking and/or
IRQ disabling.

Boil it down to what is necessary for the least common denominator,
and use that unconditionally.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/