]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: don't use {test,clear}_tsk_thread_flag() for current
authorJens Axboe <axboe@kernel.dk>
Sun, 21 Mar 2021 20:16:08 +0000 (14:16 -0600)
committerJens Axboe <axboe@kernel.dk>
Sun, 21 Mar 2021 20:16:08 +0000 (14:16 -0600)
commitf6c6cacc30ec15183a1b3993a8ed2d1c33941ff1
tree062af630c59f064bf4c96253dc49c3b7e1e2225e
parentf2ccb690a5512440f6243e7908a90b93806fedcb
io_uring: don't use {test,clear}_tsk_thread_flag() for current

Linus correctly points out that this is both unnecessary and generates
much worse code on some archs as going from current to thread_info is
actually backwards - and obviously just wasteful, since the thread_info
is what we care about.

Since io_uring only operates on current for these operations, just use
test_thread_flag() instead. For io-wq, we can further simplify and use
tracehook_notify_signal() to handle the TIF_NOTIFY_SIGNAL work and clear
the flag. The latter isn't an actual bug right now, but it may very well
be in the future if we place other work items under TIF_NOTIFY_SIGNAL.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/io-uring/CAHk-=wgYhNck33YHKZ14mFB5MzTTk8gqXHcfj=RWTAXKwgQJgg@mail.gmail.com/
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io-wq.c
fs/io_uring.c