From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gregory Haskins Subject: Re: [KVM PATCH 2/3] eventfd: add a notifier mechanism Date: Fri, 24 Apr 2009 12:29:35 -0400 Message-ID: <49F1E8EF.6030601@novell.com> References: <20090423150910.14094.73708.stgit@dev.haskins.net> <20090423151436.14094.35875.stgit@dev.haskins.net> <49F09B78.7000403@novell.com> <49F0E7B4.90702@novell.com> <49F13C0B.6040408@novell.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigB36AA7CD530D27997EFAE3D7" Cc: kvm@vger.kernel.org, Linux Kernel Mailing List , avi@redhat.com To: Davide Libenzi Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB36AA7CD530D27997EFAE3D7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Davide Libenzi wrote: > On Fri, 24 Apr 2009, Gregory Haskins wrote: > > =20 >> Davide Libenzi wrote: >> =20 >>> On Thu, 23 Apr 2009, Gregory Haskins wrote: >>> >>> =20 >>> =20 >>>>> Take a look at init_waitqueue_func_entry(), in particula at that "f= unc"=20 >>>>> parameter. Then look at how __wake_up_common() does its thing. >>>>> You don't need to be "waiting" for our wakeup system to work. Callb= acks=20 >>>>> works just fine, otherwise things like epoll could not work at all.= >>>>> =20 >>>>> =20 >>>>> =20 >>>> 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 ima= gine >>>> I need to slightly modify the eventfd interface to allow waiters oth= er >>>> than the embedded readers to join the wait-queue. How would you lik= e to >>>> see that interface look? >>>> =20 >>>> =20 >>> Actually, you need no changes in eventfd, since you can use its poll(= )=20 >>> directly, by dropping a callback entry. >>> Take a look at how epoll does it in ep_insert()... >>> =20 >>> =20 >> Ah! I just tried your suggestion and it was simple and it works. Tha= t >> is brilliant. >> >> I will post a follow-up v2 that drops patch 2/3. Thanks, Davide. >> =20 > > I assume you're in control of the file/fd lifetime, so that the file*=20 > cannot vanish while you've your wait_queue dropped inside its=20 > wait_queue_head, isn't it? > =20 I've addressed this issue by holding the file via eventfd_fget(), but your review to make sure I got it right would be appreciated. -Greg --------------enigB36AA7CD530D27997EFAE3D7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAknx6O8ACgkQlOSOBdgZUxlRyACZASRgDiNP8RYUmBLEQPVFESo9 hA8AnRHDwv6DNeHeIgZ5FS+0QV1u5UOM =866M -----END PGP SIGNATURE----- --------------enigB36AA7CD530D27997EFAE3D7--