From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 0/2] eventfd: new EFD_STATE flag Date: Mon, 11 Jan 2010 11:01:27 +0200 Message-ID: <20100111090127.GB7549@redhat.com> References: <20100106205526.GJ4001@redhat.com> <20100106222920.GB29200@redhat.com> <20100106234521.GA30515@redhat.com> <20100107064503.GA10379@redhat.com> <20100107103600.GD599@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Davide Libenzi , Avi Kivity , kvm@vger.kernel.org To: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:3891 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752562Ab0AKJB3 (ORCPT ); Mon, 11 Jan 2010 04:01:29 -0500 Content-Disposition: inline In-Reply-To: <20100107103600.GD599@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Jan 07, 2010 at 12:36:01PM +0200, Michael S. Tsirkin wrote: > Or if I do it the other way: > remove_wait_queue(irqfd->wqh, &irqfd->wait); > -> > eventfd_read_ctx(irqfd->eventfd, &ucnt); > > now, if device signals eventfd at point marked by ->, > it will not be sent but counter will be cleared, > so we will loose a message. > May be I am missing something here, but why doing it like that is a problem? Event delivery races with interrupt masking so making masking succeed before event delivery is OK. Event generation is asynchronous anyway and could have happened jiffy latter anyway. -- Gleb.