lkml.org 
[lkml]   [2013]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] Drivers: hv: balloon: Online the hot-added memory "in context"
Date
Leverage the newly exported functionality to bring memory online
without involving user level code.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/hv/hv_balloon.c | 20 +++-----------------
1 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index 2d094cf..c2eec17 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -515,11 +515,6 @@ struct hv_dynmem_device {
bool host_specified_ha_region;

/*
- * State to synchronize hot-add.
- */
- struct completion ol_waitevent;
- bool ha_waiting;
- /*
* This thread handles hot-add
* requests from the host as well as notifying
* the host with regards to memory pressure in
@@ -581,9 +576,6 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size,

has->covered_end_pfn += processed_pfn;

- init_completion(&dm_device.ol_waitevent);
- dm_device.ha_waiting = true;
-
nid = memory_add_physaddr_to_nid(PFN_PHYS(start_pfn));
ret = add_memory(nid, PFN_PHYS((start_pfn)),
(HA_CHUNK << PAGE_SHIFT));
@@ -606,12 +598,10 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size,
}

/*
- * Wait for the memory block to be onlined.
- * Since the hot add has succeeded, it is ok to
- * proceed even if the pages in the hot added region
- * have not been "onlined" within the allowed time.
+ * Before proceeding to hot add the next segment,
+ * online the segment that has been hot added.
*/
- wait_for_completion_timeout(&dm_device.ol_waitevent, 5*HZ);
+ online_memory_block(start_pfn);

}

@@ -625,10 +615,6 @@ static void hv_online_page(struct page *pg)
unsigned long cur_start_pgp;
unsigned long cur_end_pgp;

- if (dm_device.ha_waiting) {
- dm_device.ha_waiting = false;
- complete(&dm_device.ol_waitevent);
- }

list_for_each(cur, &dm_device.ha_region_list) {
has = list_entry(cur, struct hv_hotadd_state, list);
--
1.7.4.1


\
 
 \ /
  Last update: 2013-07-24 23:21    [W:0.043 / U:3.096 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site