]> git.itanic.dy.fi Git - linux-stable/commit
io_uring: remove unconditional looping in local task_work handling
authorJens Axboe <axboe@kernel.dk>
Wed, 31 Jan 2024 17:50:08 +0000 (10:50 -0700)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:16:26 +0000 (18:16 -0400)
commita352d5a59f4f8812d83bfc50d48bd3a517be1791
treeb8d866000c813f6f707106cca7aad21eec7c7472
parent7d430002358dcbba5a32ed7d283ca7e8f64ccdfc
io_uring: remove unconditional looping in local task_work handling

[ Upstream commit 9fe3eaea4a3530ca34a8d8ff00b1848c528789ca ]

If we have a ton of notifications coming in, we can be looping in here
for a long time. This can be problematic for various reasons, mostly
because we can starve userspace. If the application is waiting on N
events, then only re-run if we need more events.

Fixes: c0e0d6ba25f1 ("io_uring: add IORING_SETUP_DEFER_TASKRUN")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
io_uring/io_uring.c