Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754573AbbG2W2M (ORCPT ); Wed, 29 Jul 2015 18:28:12 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:34591 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754544AbbG2W2K (ORCPT ); Wed, 29 Jul 2015 18:28:10 -0400 Date: Wed, 29 Jul 2015 15:28:09 -0700 (PDT) Message-Id: <20150729.152809.1531386671239230150.davem@davemloft.net> To: decui@microsoft.com Cc: gregkh@linuxfoundation.org, stephen@networkplumber.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, driverdev-devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com, kys@microsoft.com, pebolle@tiscali.nl, stefanha@redhat.com, vkuznets@redhat.com, dan.carpenter@oracle.com Subject: Re: [PATCH V4 7/7] Drivers: hv: vmbus: disable local interrupt when hvsock's callback is running From: David Miller In-Reply-To: <1438086930-19483-1-git-send-email-decui@microsoft.com> References: <1438086930-19483-1-git-send-email-decui@microsoft.com> X-Mailer: Mew version 6.6 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 29 Jul 2015 15:28:10 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1137 Lines: 26 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/