RE: [PATCH] epoll: ensure ep_poll() doesn't miss wakeup events

From: David Laight
Date: Sun May 03 2020 - 09:05:31 EST


From: Jason Baron
> Sent: 01 May 2020 20:16
>
> Now that the ep_events_available() check is done in a lockless way, and
> we no longer perform wakeups from ep_scan_ready_list(), we need to ensure
> that either ep->rdllist has items or the overflow list is active. Prior to:
> commit 339ddb53d373 ("fs/epoll: remove unnecessary wakeups of nested
> epoll"), we did wake_up(&ep->wq) after manipulating the ep->rdllist and the
> overflow list. Thus, any waiters would observe the correct state. However,
> with that wake_up() now removed we need to be more careful to ensure that
> condition.

I'm wondering how much all this affects the (probably) more common
case of a process reading events from a lot of sockets in 'level'
mode.

Even the change to a rwlock() may have had an adverse effect
on such programs.

In 'level' mode it doesn't make any sense to have multiple
readers of the event queue.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)