Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Hering <ohering@suse.de>2017-10-20 12:20:33 +0200
committerOlaf Hering <ohering@suse.de>2017-10-20 12:23:27 +0200
commit7f834ace2e551f2eac39d139ad1eca42f0d2ca3b (patch)
tree7d42273141e73573f5d87051c6cb073351afbecd
parentcda0663b5f6a424273367504e74966f088a41948 (diff)
Drivers: hv: balloon: Correctly update onlined page count
-rw-r--r--patches.suse/msft-hv-1436-Drivers-hv-balloon-Correctly-update-onlined-page-cou.patch45
-rw-r--r--series.conf1
2 files changed, 46 insertions, 0 deletions
diff --git a/patches.suse/msft-hv-1436-Drivers-hv-balloon-Correctly-update-onlined-page-cou.patch b/patches.suse/msft-hv-1436-Drivers-hv-balloon-Correctly-update-onlined-page-cou.patch
new file mode 100644
index 0000000000..5fda7de3a7
--- /dev/null
+++ b/patches.suse/msft-hv-1436-Drivers-hv-balloon-Correctly-update-onlined-page-cou.patch
@@ -0,0 +1,45 @@
+From: Alex Ng <alexng@messages.microsoft.com>
+Date: Sun, 6 Aug 2017 13:12:53 -0700
+Patch-mainline: v4.14-rc1
+Subject: Drivers: hv: balloon: Correctly update onlined page count
+Git-commit: 6df8d9aaf3afe25aacf20c69022a4c6d57b77a95
+References: fate#323887
+
+Previously, num_pages_onlined was updated using value from memory online
+notifier. This is incorrect because they assume that all hot-added pages
+are online, even though we only online the amount that's backed by the
+host. We should update num_pages_onlined only when the balloon driver
+marks a page as online.
+
+Signed-off-by: Alex Ng <alexng@messages.microsoft.com>
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Acked-by: Olaf Hering <ohering@suse.de>
+---
+ drivers/hv/hv_balloon.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
+--- a/drivers/hv/hv_balloon.c
++++ b/drivers/hv/hv_balloon.c
+@@ -584,10 +584,6 @@ static int hv_memory_notifier(struct notifier_block *nb, unsigned long val,
+
+ switch (val) {
+ case MEM_ONLINE:
+- spin_lock_irqsave(&dm_device.ha_lock, flags);
+- dm_device.num_pages_onlined += mem->nr_pages;
+- spin_unlock_irqrestore(&dm_device.ha_lock, flags);
+- /* Fall through */
+ case MEM_CANCEL_ONLINE:
+ if (dm_device.ha_waiting) {
+ dm_device.ha_waiting = false;
+@@ -644,6 +640,9 @@ static void hv_page_online_one(struct hv_hotadd_state *has, struct page *pg)
+ __online_page_set_limits(pg);
+ __online_page_increment_counters(pg);
+ __online_page_free(pg);
++
++ WARN_ON_ONCE(!spin_is_locked(&dm_device.ha_lock));
++ dm_device.num_pages_onlined++;
+ }
+
+ static void hv_bring_pgs_online(struct hv_hotadd_state *has,
diff --git a/series.conf b/series.conf
index be99054ffa..afd9ede77d 100644
--- a/series.conf
+++ b/series.conf
@@ -1686,6 +1686,7 @@
patches.suse/msft-hv-1433-netvsc-allow-controlling-send-recv-buffer-size.patch
patches.suse/msft-hv-1434-netvsc-keep-track-of-some-non-fatal-overload-conditi.patch
patches.suse/msft-hv-1435-Tools-hv-vss-Skip-freezing-filesystems-backed-by-loo.patch
+ patches.suse/msft-hv-1436-Drivers-hv-balloon-Correctly-update-onlined-page-cou.patch
patches.suse/suse-hv-guest-os-id.patch
patches.suse/suse-hv-kvp_on_msg.dbg.patch