Re: [PATCH 6.8 015/715] io_uring: remove unconditional looping in local task_work handling

Jens Axboe
2024-04-06T02:10:10Z

On 4/4/24 1:06 AM, Jiri Slaby wrote:
> On 02. 04. 24, 15:41, Jens Axboe wrote:
>> On 4/2/24 2:12 AM, Jiri Slaby wrote:
>>> On 24. 03. 24, 23:23, Sasha Levin wrote:
>>>> From: Jens Axboe <axboe@kernel.dk>
>>>>
>>>> [ 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.
>>>
>>> This commit breaks test/recv-multishot.c from liburing:
>>> early error: res 4
>>> test stream=1 wait_each=0 recvmsg=0 early_error=0 defer=1 failed
>>>
>>> The behaviour is the same in 6.9-rc2 (which contains the commit too).
>>>
>>> Reverting the commit on the top of 6.8.2 makes it pass again.
>>>
>>> Should the test be updated or is the commit wrong?
>>
>> The commit is fine, it's the test that is buggy. Sometimes test cases
>> make odd assumptions that are just wrong but happen to work, for some
>> definition of work. Eg it would work fine on an idle system, but not
>> necessarily if not. For this one, the fix is in liburing:
>>
>> https://git.kernel.dk/cgit/liburing/commit/test/recv-multishot.c?id=a1d5e4b863a60af93d0cab9d4bbf578733337a90
>
> Thanks, that worked.
>
> Any plans to release 2.6 with the above?
>
> Note that for 2.4->2.5 update I also needed to take 9dc95a03e4a76 from
> post-2.5.

Yep, 2.6 should be released very soon.

--
Jens Axboe