linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dexuan Cui <decui@microsoft.com>
To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	driverdev-devel@linuxdriverproject.org, olaf@aepfle.de,
	apw@canonical.com, jasowang@redhat.com, kys@microsoft.com
Subject: [PATCH] Drivers: hv: vmbus: fix init_vp_index() for reloading hv_netvsc
Date: Wed, 12 Aug 2015 06:48:46 -0700	[thread overview]
Message-ID: <1439387326-32427-1-git-send-email-decui@microsoft.com> (raw)

This fixes the recent commit:
Drivers: hv: vmbus: Further improve CPU affiliation logic

Without the fix, reloading hv_netvsc hangs the guest.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
 drivers/hv/channel_mgmt.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 2f9aead..f61bd07 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -458,6 +458,19 @@ static void init_vp_index(struct vmbus_channel *channel, const uuid_le *type_gui
 			continue;
 		}
 
+		if (cpumask_weight(&primary->alloced_cpus_in_node) ==
+		    cpumask_weight(cpumask_of_node(primary->numa_node))) {
+			/*
+			 * We have cycled through all the CPUs in the node;
+			 * reset the alloced map.
+			 * This is necessary because we never clear
+			 * primary->alloced_cpus_in_node in other places.
+			 * We need this to "break" the loop when reloading
+			 * hv_netvsc in SMP guest.
+			 */
+			cpumask_clear(&primary->alloced_cpus_in_node);
+		}
+
 		if (!cpumask_test_cpu(cur_cpu,
 				&primary->alloced_cpus_in_node)) {
 			cpumask_set_cpu(cur_cpu,
-- 
2.1.0


             reply	other threads:[~2015-08-12 12:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-12 13:48 Dexuan Cui [this message]
2015-08-12 12:29 ` [PATCH] Drivers: hv: vmbus: fix init_vp_index() for reloading hv_netvsc Dexuan Cui
2015-08-12 13:05   ` Dan Carpenter
2015-08-12 13:35     ` Dexuan Cui
2015-08-12 14:11       ` Dan Carpenter
2015-08-12 15:50         ` Dexuan Cui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439387326-32427-1-git-send-email-decui@microsoft.com \
    --to=decui@microsoft.com \
    --cc=apw@canonical.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jasowang@redhat.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olaf@aepfle.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).