All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Gregory Haskins <ghaskins@novell.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	davidel@xmailserver.org, paulmck@linux.vnet.ibm.com,
	akpm@linux-foundation.org
Subject: Re: [KVM PATCH v2 0/2] irqfd: use POLLHUP notification for close()
Date: Sun, 14 Jun 2009 15:51:46 +0300	[thread overview]
Message-ID: <4A34F262.6000206@redhat.com> (raw)
In-Reply-To: <4A34EF41.3020301@novell.com>

Gregory Haskins wrote:
> Michael S. Tsirkin wrote:
>   
>> [ Resending with correct address for Davide. Pls don't reply
>>   to the original one, you'll get bounces. ]
>>
>> On Thu, Jun 04, 2009 at 08:48:02AM -0400, Gregory Haskins wrote:
>>   
>>     
>>> (Applies to kvm.git/master:25deed73)
>>>
>>> Please see the header for 2/2 for a description.  This patch series has been
>>> fully tested and appears to be working correctly.
>>>
>>> [Review notes:
>>>       *) Paul has looked at the SRCU design and, to my knowledge, didn't find
>>>          any holes.
>>>       *) Michael, Avi, and myself agree that while the removal of the DEASSIGN
>>>          vector is not desirable, the fix on close() is more important in
>>>          the short-term.  We can always add DEASSIGN support again in the
>>> 	 future with a CAP bit.
>>> ]
>>>     
>>>       
>> So, I've been thinking about this, and this approach has another
>> problem: it depends on pollhup on close which is AFAIK an
>> eventfd-specific feature.
>>     
>
> Thats ok with me, as we are already married to eventfd for other reasons
> (see eventfd_fget()).
>
>   
>>  This will prevent us from supporting polling
>> other useful file types, such as sockets and pipes, down the road, with
>> this interface.
>>   
>>     
> I am thinking that we would add explicit support in the future if there
> are other fd types that might want to also inject interrupts.  For
> instance, perhaps POLLHUP is added to pipes if/when they are patched as
> a valid transport for irqfd.   Or perhaps irqfd is abstracted such that
> eventfd_fget/POLLHUP are eventfd specific assign/deassign implementation
> details.
>
> Another option is that we s/irqfd/irq-eventfd to leave room for other
> interfaces like irq-pollfd, irq-socketfd, etc.  IOW, there is no reason
> to make the current irqfd code "one-fd-interface to rule them all" per
> se.  The real abstraction is the kvm_set_irq() + gsi interface anyway. 
> The current irqfd code is a thin shim in front of that.  Perhaps each fd
> type would be better served with code to specifically handle each type,
> for its hard to predict what the requirements for translating, say, a
> pipe-write into a gsi-inject will be apriori.
>
>   

I don't see a reason to avoid a monogamous relationship with eventfd as 
it exactly captures the essence of an raising an interrupt: events are 
coalesced and it doesn't block.  Since irqfd will rarely work by itself 
(need a separate data channel), having things like a tcp socket inject 
an interrupt are, while exotic, fairly useless.

>> I didn't realise these implications when I suggested deassign on close.
>> To me, it now looks like we are better off reverting this patch.
>> We can later add 'deassign on close' support with CAP bit after all :)
>>
>> Avi, Gregory, what's your take?
>>
>>   
>>     
> I like the design with the single-call close in place, so my vote is to
> keep it as it is now.
>   

We could work around it by allocating a gsi private to the eventfd, and 
when we want to mask the gsi, simply drop all its routes.  Hacky.

-- 
error compiling committee.c: too many arguments to function


      reply	other threads:[~2009-06-14 12:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-04 12:48 [KVM PATCH v2 0/2] irqfd: use POLLHUP notification for close() Gregory Haskins
2009-06-04 12:48 ` [KVM PATCH v2 1/2] Allow waiters to be notified about the eventfd file* going away, and give Gregory Haskins
2009-06-04 12:48 ` [KVM PATCH v2 2/2] kvm: use POLLHUP to close an irqfd instead of an explicit ioctl Gregory Haskins
2009-06-14 11:49   ` Michael S. Tsirkin
2009-06-14 12:53     ` Gregory Haskins
2009-06-14 13:28       ` Michael S. Tsirkin
2009-06-15  3:39         ` Gregory Haskins
2009-06-15  9:46           ` Michael S. Tsirkin
2009-06-15 12:08             ` Gregory Haskins
2009-06-15 12:54               ` Michael S. Tsirkin
2009-06-18  5:16                 ` Rusty Russell
2009-06-18  6:49                   ` Michael S. Tsirkin
2009-06-18 12:00                     ` Gregory Haskins
2009-06-18 12:22                       ` Michael S. Tsirkin
2009-06-18 14:03                         ` Gregory Haskins
2009-06-18 14:35                           ` Michael S. Tsirkin
2009-06-18 16:29                             ` Gregory Haskins
2009-06-19 15:37                               ` Michael S. Tsirkin
2009-06-19 16:07                                 ` Gregory Haskins
2009-06-15  3:48         ` Gregory Haskins
2009-06-04 14:02 ` [KVM PATCH v2 0/2] irqfd: use POLLHUP notification for close() Avi Kivity
2009-06-12  3:58 ` Michael S. Tsirkin
2009-06-12  4:08 ` Michael S. Tsirkin
2009-06-14 12:38   ` Gregory Haskins
2009-06-14 12:51     ` Avi Kivity [this message]

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=4A34F262.6000206@redhat.com \
    --to=avi@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=davidel@xmailserver.org \
    --cc=ghaskins@novell.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=paulmck@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.