mbox series

[v3,0/2] poll_refs armoring

Message ID cover.1668963050.git.asml.silence@gmail.com (mailing list archive)
Headers show
Series poll_refs armoring | expand

Message

Pavel Begunkov Nov. 20, 2022, 4:57 p.m. UTC
Make poll_refs more robust and protected from overflows. The mechanism
description is in 2/2. 1/2 helps to make the second patch a little bit
cleaner by tunnelling all edge cases from arming to a tw.

A good way to test is to set IO_POLL_REF_BIAS to 0 and 1. 0 will make
the slowpath to be hit every single time, and 1 triggers it in case of
races.

v2: clear the retry flag before vfs_poll()
v3: fix not handling arm_poll* refs release edge cases with patch 1/2

Pavel Begunkov (2):
  io_uring: cmpxchg for poll arm refs release
  io_uring: make poll refs more robust

 io_uring/poll.c | 44 ++++++++++++++++++++++++++++++++++++++------
 1 file changed, 38 insertions(+), 6 deletions(-)

Comments

Jens Axboe Nov. 21, 2022, 5:10 p.m. UTC | #1
On Sun, 20 Nov 2022 16:57:40 +0000, Pavel Begunkov wrote:
> Make poll_refs more robust and protected from overflows. The mechanism
> description is in 2/2. 1/2 helps to make the second patch a little bit
> cleaner by tunnelling all edge cases from arming to a tw.
> 
> A good way to test is to set IO_POLL_REF_BIAS to 0 and 1. 0 will make
> the slowpath to be hit every single time, and 1 triggers it in case of
> races.
> 
> [...]

Applied, thanks!

[1/2] io_uring: cmpxchg for poll arm refs release
      (no commit info)
[2/2] io_uring: make poll refs more robust
      (no commit info)

Best regards,