From: "K. Y. Srinivasan" <kys@microsoft.com>
To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com,
jasowang@redhat.com
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Subject: [PATCH 3/3] Drivers: hv: hv_balloon: Don't post pressure status from interrupt context
Date: Tue, 2 Dec 2014 14:29:15 -0800 [thread overview]
Message-ID: <1417559355-13730-3-git-send-email-kys@microsoft.com> (raw)
In-Reply-To: <1417559355-13730-1-git-send-email-kys@microsoft.com>
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>
---
drivers/hv/hv_balloon.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index 2c610ec..afdb0d5 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -1227,7 +1227,7 @@ static void balloon_down(struct hv_dynmem_device *dm,
for (i = 0; i < range_count; i++) {
free_balloon_pages(dm, &range_array[i]);
- post_status(&dm_device);
+ complete(&dm_device.config_event);
}
if (req->more_pages == 1)
@@ -1251,19 +1251,16 @@ static void balloon_onchannelcallback(void *context);
static int dm_thread_func(void *dm_dev)
{
struct hv_dynmem_device *dm = dm_dev;
- int t;
while (!kthread_should_stop()) {
- t = wait_for_completion_interruptible_timeout(
+ wait_for_completion_interruptible_timeout(
&dm_device.config_event, 1*HZ);
/*
* The host expects us to post information on the memory
* pressure every second.
*/
-
- if (t == 0)
- post_status(dm);
-
+ reinit_completion(&dm_device.config_event);
+ post_status(dm);
}
return 0;
--
1.7.4.1
next prev parent reply other threads:[~2014-12-02 21:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-02 22:28 [PATCH 0/3] Drivers: hv: hv_balloon K. Y. Srinivasan
2014-12-02 22:29 ` [PATCH 1/3] Drivers: hv: hv_balloon: Make adjustments in computing the floor K. Y. Srinivasan
2014-12-02 21:51 ` Dan Carpenter
2014-12-02 22:03 ` KY Srinivasan
2014-12-02 22:29 ` [PATCH 2/3] Drivers: hv: hv_balloon: Fix a locking bug in the balloon driver K. Y. Srinivasan
2014-12-02 22:29 ` K. Y. Srinivasan [this message]
2014-12-07 8:04 ` [PATCH 3/3] Drivers: hv: hv_balloon: Don't post pressure status from interrupt context Sitsofe Wheeler
2014-12-08 6:04 ` KY Srinivasan
2014-12-10 20:50 ` Sitsofe Wheeler
2014-12-10 23:43 ` KY Srinivasan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1417559355-13730-3-git-send-email-kys@microsoft.com \
--to=kys@microsoft.com \
--cc=apw@canonical.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=olaf@aepfle.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox