提交 ab3de22b 编写于 作者: K K. Y. Srinivasan 提交者: Greg Kroah-Hartman

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.htmlSigned-off-by: NK. Y. Srinivasan <kys@microsoft.com>
Reported-by: NSitsofe Wheeler <sitsofe@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 22f88475
...@@ -1226,7 +1226,7 @@ static void balloon_down(struct hv_dynmem_device *dm, ...@@ -1226,7 +1226,7 @@ static void balloon_down(struct hv_dynmem_device *dm,
for (i = 0; i < range_count; i++) { for (i = 0; i < range_count; i++) {
free_balloon_pages(dm, &range_array[i]); free_balloon_pages(dm, &range_array[i]);
post_status(&dm_device); complete(&dm_device.config_event);
} }
if (req->more_pages == 1) if (req->more_pages == 1)
...@@ -1250,19 +1250,16 @@ static void balloon_onchannelcallback(void *context); ...@@ -1250,19 +1250,16 @@ static void balloon_onchannelcallback(void *context);
static int dm_thread_func(void *dm_dev) static int dm_thread_func(void *dm_dev)
{ {
struct hv_dynmem_device *dm = dm_dev; struct hv_dynmem_device *dm = dm_dev;
int t;
while (!kthread_should_stop()) { while (!kthread_should_stop()) {
t = wait_for_completion_interruptible_timeout( wait_for_completion_interruptible_timeout(
&dm_device.config_event, 1*HZ); &dm_device.config_event, 1*HZ);
/* /*
* The host expects us to post information on the memory * The host expects us to post information on the memory
* pressure every second. * pressure every second.
*/ */
reinit_completion(&dm_device.config_event);
if (t == 0) post_status(dm);
post_status(dm);
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册