aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hv
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2015-01-10 02:54:31 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-25 12:17:57 -0500
commitab3de22bb4a3d4bda2d0ec8bebcb76a40f1cbf9b (patch)
treeb99c39b0ed982afd54c91745c5e18b8e19ddd57c /drivers/hv
parent22f88475b62ac826acae2f77c3e1bd9543e87b2a (diff)
Drivers: hv: hv_balloon: Don't post pressure status from interrupt context
We currently release memory (balloon down) in the interrupt context and we also post memory status while releasing memory. Rather than posting the status in the interrupt context, wakeup the status posting thread to post the status. This will address the inconsistent lock state that Sitsofe Wheeler <sitsofe@gmail.com> reported: http://lkml.iu.edu/hypermail/linux/kernel/1411.1/00075.html Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reported-by: Sitsofe Wheeler <sitsofe@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/hv_balloon.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index 8e30415b0eb7..ff169386b2c7 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -1226,7 +1226,7 @@ static void balloon_down(struct hv_dynmem_device *dm,
1226 1226
1227 for (i = 0; i < range_count; i++) { 1227 for (i = 0; i < range_count; i++) {
1228 free_balloon_pages(dm, &range_array[i]); 1228 free_balloon_pages(dm, &range_array[i]);
1229 post_status(&dm_device); 1229 complete(&dm_device.config_event);
1230 } 1230 }
1231 1231
1232 if (req->more_pages == 1) 1232 if (req->more_pages == 1)
@@ -1250,19 +1250,16 @@ static void balloon_onchannelcallback(void *context);
1250static int dm_thread_func(void *dm_dev) 1250static int dm_thread_func(void *dm_dev)
1251{ 1251{
1252 struct hv_dynmem_device *dm = dm_dev; 1252 struct hv_dynmem_device *dm = dm_dev;
1253 int t;
1254 1253
1255 while (!kthread_should_stop()) { 1254 while (!kthread_should_stop()) {
1256 t = wait_for_completion_interruptible_timeout( 1255 wait_for_completion_interruptible_timeout(
1257 &dm_device.config_event, 1*HZ); 1256 &dm_device.config_event, 1*HZ);
1258 /* 1257 /*
1259 * The host expects us to post information on the memory 1258 * The host expects us to post information on the memory
1260 * pressure every second. 1259 * pressure every second.
1261 */ 1260 */
1262 1261 reinit_completion(&dm_device.config_event);
1263 if (t == 0) 1262 post_status(dm);
1264 post_status(dm);
1265
1266 } 1263 }
1267 1264
1268 return 0; 1265 return 0;