Re: [PATCH] eventfd: support delayed wakeup for non-semaphore eventfd to reduce cpu utilization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/16/23 5:31?AM, wenyang.linux@xxxxxxxxxxx wrote:
> From: Wen Yang <wenyang.linux@xxxxxxxxxxx>
> 
> 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.

What's the real world use case of this, and what would the expected
delay be there? With using a delayed work item for this, there's
certainly a pretty wide grey zone in terms of delay where this would
perform considerably worse than not doing any delayed wakeups at all.

-- 
Jens Axboe




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux