[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tencent_D7FC79B0CA961A24A8651221FD8439C5EF05@qq.com>
Date: Tue, 18 Apr 2023 22:12:14 +0800
From: Wen Yang <wenyang.linux@...mail.com>
To: Hillf Danton <hdanton@...a.com>
Cc: Christoph Hellwig <hch@....de>, Fu Wei <wefu@...hat.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] eventfd: support delayed wakeup for non-semaphore eventfd
to reduce cpu utilization
在 2023/4/17 08:07, Hillf Danton 写道:
> On 16 Apr 2023 19:31:55 +0800 Wen Yang <wenyang.linux@...mail.com>
>> For the NON SEMAPHORE eventfd, if it's counter has a nonzero value,
>> then a read(2) returns 8 bytes containing that value, and the counter's
>> value is reset to zero. Therefore, in the NON SEMAPHORE scenario,
>> N event_writes vs ONE event_read is possible.
>>
>> However, the current implementation wakes up the read thread immediately
>> in eventfd_write so that the cpu utilization increases unnecessarily.
>>
>> By adding a configurable delay after eventfd_write, these unnecessary
>> wakeup operations are avoided, thereby reducing cpu utilization.
> If the EPOLLOUT wakeup in eventfd_read() breaks, feel free to specify it
> in the commit message after updating the comment below.
> /*
> * Every time that a write(2) is performed on an eventfd, the
> * value of the __u64 being written is added to "count" and a
> * wakeup is performed on "wqh". A read(2) will return the "count"
> * value to userspace, and will reset "count" to zero. The kernel
> * side eventfd_signal() also, adds to the "count" counter and
> * issue a wakeup.
> */
Thanks
We will modify it according to your suggestion and then send v2 later.
--
Best wishes,
Wen
Powered by blists - more mailing lists