Re: [KVM PATCH v5 3/4] KVM: Fix races in irqfd using new eventfd_kref_get interface

2009-06-28 Thread Michael S. Tsirkin
On Thu, Jun 25, 2009 at 09:28:27AM -0400, Gregory Haskins wrote: @@ -65,25 +134,39 @@ irqfd_wakeup(wait_queue_t *wait, unsigned mode, int sync, void *key) unsigned long flags = (unsigned long)key; /* - * Assume we will be called with interrupts disabled + * Called

Re: [KVM PATCH v5 3/4] KVM: Fix races in irqfd using new eventfd_kref_get interface

2009-06-28 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Thu, Jun 25, 2009 at 09:28:27AM -0400, Gregory Haskins wrote: @@ -65,25 +134,39 @@ irqfd_wakeup(wait_queue_t *wait, unsigned mode, int sync, void *key) unsigned long flags = (unsigned long)key; /* - * Assume we will be called with interrupts

Re: [KVM PATCH v5 3/4] KVM: Fix races in irqfd using new eventfd_kref_get interface

2009-06-28 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Thu, Jun 25, 2009 at 09:28:27AM -0400, Gregory Haskins wrote: 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

Re: [KVM PATCH v5 3/4] KVM: Fix races in irqfd using new eventfd_kref_get interface

2009-06-28 Thread Michael S. Tsirkin
On Sun, Jun 28, 2009 at 08:53:22AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Thu, Jun 25, 2009 at 09:28:27AM -0400, Gregory Haskins wrote: eventfd currently emits a POLLHUP wakeup on f_ops-release() to generate a release callback. This lets eventfd clients know if the

Re: [KVM PATCH v5 3/4] KVM: Fix races in irqfd using new eventfd_kref_get interface

2009-06-28 Thread Michael S. Tsirkin
On Sun, Jun 28, 2009 at 03:56:12PM +0300, Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 08:53:22AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Thu, Jun 25, 2009 at 09:28:27AM -0400, Gregory Haskins wrote: eventfd currently emits a POLLHUP wakeup on f_ops-release()

Re: [KVM PATCH v5 3/4] KVM: Fix races in irqfd using new eventfd_kref_get interface

2009-06-28 Thread Michael S. Tsirkin
On Sun, Jun 28, 2009 at 08:50:28AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Thu, Jun 25, 2009 at 09:28:27AM -0400, Gregory Haskins wrote: @@ -65,25 +134,39 @@ irqfd_wakeup(wait_queue_t *wait, unsigned mode, int sync, void *key) unsigned long flags = (unsigned

Re: [KVM PATCH v5 3/4] KVM: Fix races in irqfd using new eventfd_kref_get interface

2009-06-28 Thread Michael S. Tsirkin
On Sun, Jun 28, 2009 at 03:57:30PM +0300, Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 03:56:12PM +0300, Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 08:53:22AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Thu, Jun 25, 2009 at 09:28:27AM -0400, Gregory Haskins

Re: [KVM PATCH v5 3/4] KVM: Fix races in irqfd using new eventfd_kref_get interface

2009-06-28 Thread Avi Kivity
On 06/28/2009 04:18 PM, Michael S. Tsirkin wrote: that could be the case, as we have, for example: static struct file_operations kvm_vm_fops = { .release= kvm_vm_release, .unlocked_ioctl = kvm_vm_ioctl, .compat_ioctl = kvm_vm_ioctl, .mmap

Re: [KVM PATCH v5 3/4] KVM: Fix races in irqfd using new eventfd_kref_get interface

2009-06-28 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 08:53:22AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Thu, Jun 25, 2009 at 09:28:27AM -0400, Gregory Haskins wrote: eventfd currently emits a POLLHUP wakeup on f_ops-release() to generate a release

Re: [KVM PATCH v5 3/4] KVM: Fix races in irqfd using new eventfd_kref_get interface

2009-06-28 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 03:57:30PM +0300, Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 03:56:12PM +0300, Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 08:53:22AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Thu, Jun

Re: [KVM PATCH v5 3/4] KVM: Fix races in irqfd using new eventfd_kref_get interface

2009-06-28 Thread Michael S. Tsirkin
On Sun, Jun 28, 2009 at 12:28:19PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 03:57:30PM +0300, Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 03:56:12PM +0300, Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 08:53:22AM -0400, Gregory

Re: [KVM PATCH v5 3/4] KVM: Fix races in irqfd using new eventfd_kref_get interface

2009-06-28 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 12:28:19PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 03:57:30PM +0300, Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 03:56:12PM +0300, Michael S. Tsirkin wrote: On

Re: [KVM PATCH v5 3/4] KVM: Fix races in irqfd using new eventfd_kref_get interface

2009-06-28 Thread Michael S. Tsirkin
On Sun, Jun 28, 2009 at 03:54:42PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 12:28:19PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 03:57:30PM +0300, Michael S. Tsirkin wrote: On Sun, Jun

Re: [KVM PATCH v5 3/4] KVM: Fix races in irqfd using new eventfd_kref_get interface

2009-06-28 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 03:54:42PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 12:28:19PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Sun, Jun 28, 2009 at 03:57:30PM +0300,

[KVM PATCH v5 3/4] KVM: Fix races in irqfd using new eventfd_kref_get interface

2009-06-25 Thread Gregory Haskins
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, until recently it is not possible to use this feature of eventfd in a