Re: [KVM PATCH 2/3] eventfd: add a notifier mechanism

Davide Libenzi
2009-04-24T02:47:53Z

On Thu, 23 Apr 2009, Gregory Haskins wrote:

> > Take a look at init_waitqueue_func_entry(), in particula at that "func"
> > parameter. Then look at how __wake_up_common() does its thing.
> > You don't need to be "waiting" for our wakeup system to work. Callbacks
> > works just fine, otherwise things like epoll could not work at all.
> >
>
> Yeah, I was looking at that this afternoon after you mentioned it. That
> makes sense.
>
> As of right now the wqh is embedded in the eventfd, accessible only by
> the .read() vtable entry. In order to do this as you suggest, I imagine
> I need to slightly modify the eventfd interface to allow waiters other
> than the embedded readers to join the wait-queue. How would you like to
> see that interface look?

Actually, you need no changes in eventfd, since you can use its poll()
directly, by dropping a callback entry.
Take a look at how epoll does it in ep_insert()...

- Davide