From: David Miller Subject: Re: [PATCH V4 7/7] Drivers: hv: vmbus: disable local interrupt when hvsock's callback is running Date: Wed, 29 Jul 2015 15:28:09 -0700 (PDT) Message-ID: <20150729.152809.1531386671239230150.davem@davemloft.net> References: <1438086930-19483-1-git-send-email-decui@microsoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: olaf@aepfle.de, gregkh@linuxfoundation.org, jasowang@redhat.com, driverdev-devel@linuxdriverproject.org, linux-kernel@vger.kernel.org, stephen@networkplumber.org, stefanha@redhat.com, netdev@vger.kernel.org, apw@canonical.com, pebolle@tiscali.nl, dan.carpenter@oracle.com To: decui@microsoft.com Return-path: In-Reply-To: <1438086930-19483-1-git-send-email-decui@microsoft.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" List-Id: netdev.vger.kernel.org From: Dexuan Cui 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 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.