From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH 3/3] eventfd: add internal reference counting to fix notifier race conditions Date: Wed, 24 Jun 2009 12:55:54 +0930 Message-ID: <200906241255.54709.rusty@rustcorp.com.au> References: <20090619183534.31118.30934.stgit@dev.haskins.net> <4A3FC2B1.4050107@novell.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Gregory Haskins , mst@redhat.com, kvm@vger.kernel.org, Linux Kernel Mailing List , avi@redhat.com, paulmck@linux.vnet.ibm.com, Ingo Molnar To: Davide Libenzi Return-path: Received: from ozlabs.org ([203.10.76.45]:53493 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750775AbZFXDZx (ORCPT ); Tue, 23 Jun 2009 23:25:53 -0400 In-Reply-To: Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 23 Jun 2009 03:33:22 am Davide Libenzi wrote: > What you're doing there, is setting up a kernel-to-kernel (since > userspace only role is to create the eventfd) communication, using a file* > as accessory. That IMO is plain wrong. The most sensible is that userspace can use these fds; an in-kernel variant is possible too, but not primary IMHO. It's nice that userspace create the fds; it can then use the same fd for multiple event sources. But I didn't see anything wrong with the way eventfd used to work: you have a kvm ioctl to say "attach this eventfd to this guest notification" and that does the eventfd_fget. A detach ioctl does the fput (as does release of the kvm fd). If they close the eventfd and don't do the detach ioctl, it's their problem. Rusty.