linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	linux-fsdevel@vger.kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, Avi Kivity <avi@scylladb.com>,
	Davide Libenzi <davidel@xmailserver.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>
Subject: Re: [RFC] eventfd: add EFD_AUTORESET flag
Date: Wed, 12 Feb 2020 10:29:12 +0000	[thread overview]
Message-ID: <20200212102912.GA464050@stefanha-x1.localdomain> (raw)
In-Reply-To: <66566792-58a4-bf65-6723-7d2887c84160@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 577 bytes --]

On Wed, Feb 12, 2020 at 09:31:32AM +0100, Paolo Bonzini wrote:
> On 29/01/20 18:20, Stefan Hajnoczi wrote:
> > +	/* Semaphore semantics don't make sense when autoreset is enabled */
> > +	if ((flags & EFD_SEMAPHORE) && (flags & EFD_AUTORESET))
> > +		return -EINVAL;
> > +
> 
> I think they do, you just want to subtract 1 instead of setting the
> count to 0.  This way, writing 1 would be the post operation on the
> semaphore, while poll() would be the wait operation.

True!  Then EFD_AUTORESET is not a fitting name.  EFD_AUTOREAD or
EFD_POLL_READS?

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2020-02-12 10:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-29 17:20 [RFC] eventfd: add EFD_AUTORESET flag Stefan Hajnoczi
2020-02-04 15:40 ` Stefan Hajnoczi
2020-02-11  9:32   ` Stefan Hajnoczi
2020-02-12  8:31 ` Paolo Bonzini
2020-02-12 10:10   ` Avi Kivity
2020-02-12 10:29   ` Stefan Hajnoczi [this message]
2020-02-12 10:47     ` Paolo Bonzini
2020-02-12 10:54       ` Avi Kivity
2020-02-19 10:37         ` Stefan Hajnoczi
2020-02-19 10:43           ` Avi Kivity
2020-02-19 11:10             ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200212102912.GA464050@stefanha-x1.localdomain \
    --to=stefanha@gmail.com \
    --cc=avi@scylladb.com \
    --cc=davidel@xmailserver.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).