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
race-free way.
This patch utilizes a new eventfd interface to rectify the problem. It also
converts the eventfd POLLHUP generation code to use the locked variant
of wakeup.
Signed-off-by: Gregory Haskins<ghaskins@xxxxxxxxxx>
CC: Davide Libenzi<davidel@xxxxxxxxxxxxxxx>
---
fs/eventfd.c | 7 --
include/linux/kvm_host.h | 5 +
virt/kvm/eventfd.c | 187 ++++++++++++++++++++++++++++++++--------------
3 files changed, 134 insertions(+), 65 deletions(-)