eventpoll: Add per-epoll prefer busy poll option
authorJoe Damato <jdamato@fastly.com>
Tue, 13 Feb 2024 06:16:44 +0000 (06:16 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 Feb 2024 11:01:00 +0000 (11:01 +0000)
commitde57a251082211b68e8c01e0e8210a23c022ac57
treeec5e07f692cde151592ad63ea6c2b1b85e666fd0
parentc6aa2a7778d8e3ba7c6f84c8095f0b89f0617830
eventpoll: Add per-epoll prefer busy poll option

When using epoll-based busy poll, the prefer_busy_poll option is hardcoded
to false. Users may want to enable prefer_busy_poll to be used in
conjunction with gro_flush_timeout and defer_hard_irqs_count to keep device
IRQs masked.

Other busy poll methods allow enabling or disabling prefer busy poll via
SO_PREFER_BUSY_POLL, but epoll-based busy polling uses a hardcoded value.

Fix this edge case by adding support for a per-epoll context
prefer_busy_poll option. The default is false, as it was hardcoded before
this change.

Signed-off-by: Joe Damato <jdamato@fastly.com>
Acked-by: Stanislav Fomichev <sdf@google.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
fs/eventpoll.c