Re: [PATCH net] af_unix: Avoid a wakeup if data has been not arrived

From: Eric Dumazet
Date: Wed Jan 10 2024 - 05:05:33 EST


On Wed, Jan 10, 2024 at 9:47 AM Bin Zhong <zhongbin@xxxxxxxxxxxxx> wrote:
>
> In the following scenarios, unnecessary wake-up may occur.
> When a thread sends a piece of data and then immediately
> calls recv to wait for the server's data, the server, upon
> receiving this thread's data, calls back unix_write_space
> to wake up this thread.
>
> Therefore, add the filtering conditions of EPOLLIN and
> EPOLLERR in the callback function of the waiting queue in
> the unix_stream_data_wait function to reduce unnecessary
> wake-ups.

This is net-next material, and net-next is currently closed.

Also, I would rather re-use receiver_wake_function(), no need to copy paste it.

Thanks !