From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754451AbbHMXJP (ORCPT ); Thu, 13 Aug 2015 19:09:15 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:57207 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753289AbbHMXJN (ORCPT ); Thu, 13 Aug 2015 19:09:13 -0400 Message-ID: <1439507350.8421.13.camel@HansenPartnership.com> Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: fix init_vp_index() for reloading hv_netvsc From: James Bottomley To: "K. Y. Srinivasan" Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, ohering@suse.com, jbottomley@parallels.com, hch@infradead.org, linux-scsi@vger.kernel.org, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, Dexuan Cui Date: Thu, 13 Aug 2015 16:09:10 -0700 In-Reply-To: <1439510823-16280-1-git-send-email-kys@microsoft.com> References: <1439510823-16280-1-git-send-email-kys@microsoft.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2015-08-13 at 17:07 -0700, K. Y. Srinivasan wrote: > From: Dexuan Cui > > This fixes the recent commit 3b71107d73b16074afa7658f3f0fcf837aabfe24: Which tree is this in? upstream linus is giving me bad object on that id. > Drivers: hv: vmbus: Further improve CPU affiliation logic > > Without the fix, reloading hv_netvsc hangs the guest. The reason for looking for the commit id was to see if cc to stable was necessary, is it? James > Signed-off-by: Dexuan Cui > Signed-off-by: K. Y. Srinivasan > --- > drivers/hv/channel_mgmt.c | 17 +++++++++++++++++ > 1 files changed, 17 insertions(+), 0 deletions(-) > > diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c > index 3ab4753..8a4105c 100644 > --- a/drivers/hv/channel_mgmt.c > +++ b/drivers/hv/channel_mgmt.c > @@ -204,6 +204,8 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid) > spin_lock_irqsave(&vmbus_connection.channel_lock, flags); > list_del(&channel->listentry); > spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags); > + > + primary_channel = channel; > } else { > primary_channel = channel->primary_channel; > spin_lock_irqsave(&primary_channel->lock, flags); > @@ -211,6 +213,14 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid) > primary_channel->num_sc--; > spin_unlock_irqrestore(&primary_channel->lock, flags); > } > + > + /* > + * We need to free the bit for init_vp_index() to work in the case > + * of sub-channel, when we reload drivers like hv_netvsc. > + */ > + cpumask_clear_cpu(channel->target_cpu, > + &primary_channel->alloced_cpus_in_node); > + > free_channel(channel); > } > > @@ -457,6 +467,13 @@ static void init_vp_index(struct vmbus_channel *channel, const uuid_le *type_gui > continue; > } > > + /* > + * NOTE: in the case of sub-channel, we clear the sub-channel > + * related bit(s) in primary->alloced_cpus_in_node in > + * hv_process_channel_removal(), so when we reload drivers > + * like hv_netvsc in SMP guest, here we're able to re-allocate > + * bit from primary->alloced_cpus_in_node. > + */ > if (!cpumask_test_cpu(cur_cpu, > &primary->alloced_cpus_in_node)) { > cpumask_set_cpu(cur_cpu,