Re: [KVM PATCH v2 2/2] kvm: add support for irqfd via eventfd-notification interface

Gregory Haskins
2009-04-27T10:58:40Z

[-- Attachment #1: Type: text/plain, Size: 1287 bytes --]

Gregory Haskins wrote:
> Avi Kivity wrote:
>
>>
>> One day we'll have lockless injection and we'll want to drop this. I
>> guess if we create the fd ourselves we can make it work, but I don't
>> see how we can do this with eventfd.
>>
>>
>
> Hmm...this is a good point. There probably is no way to use eventfd
> "off the shelf" in a way that doesn't cause this callback to be in a
> critical section. Should we just worry about switching away from
> eventfd when this occurs, or should I implement a custom anon-fd now?
>

Something else to consider: eventfd supports calling eventfd_signal()
from interrupt context, so
even if the callback were not invoked from a preempt/irq off CS due to
the wqh->lock, the context may still be a CS anyway. Now, userspace and
vbus based injection do not need to worry about this, but I wonder if
this is a desirable attribute for some other source (device-assignment
perhaps)?

If so, is there a way to design the lockless-injection code such that
its still friendly to irq-context, or is this a mode that we would never
want to support anyway? I think this would be a good thing to have at
least to maintain compatibility with the existing eventfd interface,
which has its own advantages.

-Greg

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 266 bytes --]