[PATCH 0/3] Allow in-kernel consumers to drain events from eventfd

From: David Woodhouse
Date: Tue Oct 27 2020 - 09:55:36 EST


Paolo pointed out that the KVM eventfd doesn't drain the events from the
irqfd as it handles them, and just lets them accumulate. This is also
true for the VFIO virqfd used for handling acks for level-triggered IRQs.

Export eventfd_ctx_do_read() and make the wakeup functions call it as they
handle their respective events.

David Woodhouse (3):
eventfd: Export eventfd_ctx_do_read()
vfio/virqfd: Drain events from eventfd in virqfd_wakeup()
kvm/eventfd: Drain events from eventfd in irqfd_wakeup()

drivers/vfio/virqfd.c | 3 +++
fs/eventfd.c | 5 ++++-
include/linux/eventfd.h | 6 ++++++
virt/kvm/eventfd.c | 3 +++
4 files changed, 16 insertions(+), 1 deletion(-)