From: Gregory Haskins <ghaskins@novell.com>
To: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, mst@redhat.com, avi@redhat.com,
davidel@xmailserver.org
Subject: [KVM PATCH v9 2/5] eventfd: use locked POLLHUP
Date: Thu, 02 Jul 2009 11:38:06 -0400 [thread overview]
Message-ID: <20090702153806.20186.76377.stgit@dev.haskins.net> (raw)
In-Reply-To: <20090702153454.20186.99191.stgit@dev.haskins.net>
eventfd currently emits a POLLHUP wakeup on f_ops->release() to generate a
"release" callback. This lets eventfd clients know if the eventfd is about
to go away and is very useful particularly for in-kernel clients. However,
as it stands today it is not possible to use this feature of eventfd in a
race-free way. This patch changes the POLLHUP code to use the locked variant
to rectify this problem.
Signed-off-by: Gregory Haskins <ghaskins@novell.com>
CC: Davide Libenzi <davidel@xmailserver.org>
---
fs/eventfd.c | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/fs/eventfd.c b/fs/eventfd.c
index d9849a1..31d12de 100644
--- a/fs/eventfd.c
+++ b/fs/eventfd.c
@@ -105,12 +105,7 @@ static int eventfd_release(struct inode *inode, struct file *file)
{
struct eventfd_ctx *ctx = file->private_data;
- /*
- * No need to hold the lock here, since we are on the file cleanup
- * path and the ones still attached to the wait queue will be
- * serialized by wake_up_locked_poll().
- */
- wake_up_locked_poll(&ctx->wqh, POLLHUP);
+ wake_up_poll(&ctx->wqh, POLLHUP);
eventfd_ctx_put(ctx);
return 0;
}
next prev parent reply other threads:[~2009-07-02 15:38 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-02 15:37 [KVM PATCH v9 0/5] irqfd fixes and enhancements Gregory Haskins
2009-07-02 15:38 ` [KVM PATCH v9 1/5] kvm: prepare irqfd for having interrupts disabled during eventfd->release Gregory Haskins
2009-07-02 15:38 ` Gregory Haskins [this message]
2009-07-02 16:43 ` [KVM PATCH v9 2/5] eventfd: use locked POLLHUP Davide Libenzi
2009-07-02 15:38 ` [KVM PATCH v9 3/5] KVM: Fix races in irqfd using new eventfd_kref_get interface Gregory Haskins
2009-07-02 15:38 ` [KVM PATCH v9 4/5] KVM: add irqfd DEASSIGN feature Gregory Haskins
2009-07-02 15:38 ` [KVM PATCH v9 5/5] KVM: create irqfd-cleanup-wq on demand Gregory Haskins
2009-07-06 15:58 ` Michael S. Tsirkin
2009-07-06 16:03 ` Gregory Haskins
2009-07-06 16:14 ` Michael S. Tsirkin
2009-07-06 16:32 ` Gregory Haskins
2009-07-06 16:50 ` Michael S. Tsirkin
2009-07-06 18:28 ` Gregory Haskins
2009-07-07 5:17 ` Avi Kivity
2009-07-07 11:26 ` Gregory Haskins
2009-07-02 15:50 ` [KVM PATCH v9 0/5] irqfd fixes and enhancements Avi Kivity
2009-07-05 9:28 ` Avi Kivity
2009-07-05 10:16 ` Michael S. Tsirkin
2009-07-05 10:20 ` Michael S. Tsirkin
2009-07-05 10:38 ` Michael S. Tsirkin
2009-07-05 10:42 ` Avi Kivity
2009-07-05 21:21 ` Gregory Haskins
2009-07-06 14:56 ` Gregory Haskins
2009-07-06 16:13 ` Michael S. Tsirkin
2009-07-06 16:41 ` Gregory Haskins
2009-07-06 16:49 ` Michael S. Tsirkin
2009-07-06 18:48 ` Gregory Haskins
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=20090702153806.20186.76377.stgit@dev.haskins.net \
--to=ghaskins@novell.com \
--cc=avi@redhat.com \
--cc=davidel@xmailserver.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
/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