[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a5299230-4e86-43d1-7f99-cc1f455a39c7@scylladb.com>
Date: Wed, 12 Feb 2020 12:10:45 +0200
From: Avi Kivity <avi@...lladb.com>
To: Paolo Bonzini <pbonzini@...hat.com>,
Stefan Hajnoczi <stefanha@...hat.com>,
linux-fsdevel@...r.kernel.org
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
Davide Libenzi <davidel@...ilserver.org>,
Alexander Viro <viro@...iv.linux.org.uk>
Subject: Re: [RFC] eventfd: add EFD_AUTORESET flag
On 12/02/2020 10.31, 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.
poll() is usually idempotent. Both resetting to zero and subtracting one
goes against the grain.
Better to use uring async read. This way you get the value just as you
do with with poll+read, and the syscall cost is amortized away by uring.
Powered by blists - more mailing lists