aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hv
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2016-08-24 19:23:11 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-31 07:05:41 -0400
commita132c54cbcb8c239a64370b9cd9468908398bc6e (patch)
tree244c5047a7c8dd2dfa64c047f8d2ca10e240f270 /drivers/hv
parentcb7a5724c7e1bfb5766ad1c3beba14cc715991cf (diff)
Drivers: hv: balloon: don't wait for ol_waitevent when memhp_auto_online is enabled
With the recently introduced in-kernel memory onlining (MEMORY_HOTPLUG_DEFAULT_ONLINE) these is no point in waiting for pages to come online in the driver and we can get rid of the waiting. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/hv_balloon.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index 18766f616b8d..34413261d189 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -673,7 +673,7 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size,
673 has->covered_end_pfn += processed_pfn; 673 has->covered_end_pfn += processed_pfn;
674 674
675 init_completion(&dm_device.ol_waitevent); 675 init_completion(&dm_device.ol_waitevent);
676 dm_device.ha_waiting = true; 676 dm_device.ha_waiting = !memhp_auto_online;
677 677
678 mutex_unlock(&dm_device.ha_region_mutex); 678 mutex_unlock(&dm_device.ha_region_mutex);
679 nid = memory_add_physaddr_to_nid(PFN_PHYS(start_pfn)); 679 nid = memory_add_physaddr_to_nid(PFN_PHYS(start_pfn));
@@ -699,12 +699,15 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size,
699 } 699 }
700 700
701 /* 701 /*
702 * Wait for the memory block to be onlined. 702 * Wait for the memory block to be onlined when memory onlining
703 * Since the hot add has succeeded, it is ok to 703 * is done outside of kernel (memhp_auto_online). Since the hot
704 * proceed even if the pages in the hot added region 704 * add has succeeded, it is ok to proceed even if the pages in
705 * have not been "onlined" within the allowed time. 705 * the hot added region have not been "onlined" within the
706 * allowed time.
706 */ 707 */
707 wait_for_completion_timeout(&dm_device.ol_waitevent, 5*HZ); 708 if (dm_device.ha_waiting)
709 wait_for_completion_timeout(&dm_device.ol_waitevent,
710 5*HZ);
708 mutex_lock(&dm_device.ha_region_mutex); 711 mutex_lock(&dm_device.ha_region_mutex);
709 post_status(&dm_device); 712 post_status(&dm_device);
710 } 713 }