Re: [PATCH AUTOSEL 6.14 26/31] um: Rewrite the sigio workaround based on epoll and tgkill

From: Tiwei Bie
Date: Tue Apr 08 2025 - 00:52:14 EST


On 2025/4/8 02:10, Sasha Levin wrote:
> From: Tiwei Bie <tiwei.btw@xxxxxxxxxxxx>
>
> [ Upstream commit 33c9da5dfb18c2ff5a88d01aca2cf253cd0ac3bc ]
>
> The existing sigio workaround implementation removes FDs from the
> poll when events are triggered, requiring users to re-add them via
> add_sigio_fd() after processing. This introduces a potential race
> condition between FD removal in write_sigio_thread() and next_poll
> update in __add_sigio_fd(), and is inefficient due to frequent FD
> removal and re-addition. Rewrite the implementation based on epoll
> and tgkill for improved efficiency and reliability.
>
> Signed-off-by: Tiwei Bie <tiwei.btw@xxxxxxxxxxxx>
> Link: https://patch.msgid.link/20250315161910.4082396-2-tiwei.btw@xxxxxxxxxxxx
> Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
> ---
> arch/um/drivers/random.c | 2 +-
> arch/um/drivers/rtc_user.c | 2 +-
> arch/um/include/shared/os.h | 2 +-
> arch/um/include/shared/sigio.h | 1 -
> arch/um/kernel/sigio.c | 26 ---
> arch/um/os-Linux/sigio.c | 330 +++++----------------------------
> 6 files changed, 47 insertions(+), 316 deletions(-)

Please drop this patch. Thanks! Details can be found here:

https://lore.kernel.org/linux-um/ffa0b6af-523d-4e3e-9952-92f5b04b82b3@xxxxxxxxxxxx/

Regards,
Tiwei