Re: [GIT PULL] io_uring fixes for 5.12-rc3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 12, 2021 at 1:17 PM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> I'm _guessing_ it's just that now those threads are user threads, and
> then the freezing logic expects them to freeze/thaw using a signal
> machinery or something like that. And that doesn't work when there is
> no signal handling for those threads.

IOW, I think it's this logic in freeze_task():

        if (!(p->flags & PF_KTHREAD))
                fake_signal_wake_up(p);
        else
                wake_up_state(p, TASK_INTERRUPTIBLE);

where that "not a PF_KTHREAD" test will trigger for the io_uring
threads, and it does that fake_signal_wake_up(), and then
signal_wake_up() does that

        set_tsk_thread_flag(t, TIF_SIGPENDING);

but the io_uring thread has no way to react to it.

So now the io_uring thread will see "I have pending signals" (even if
there is no actual pending signal - it's just a way to get normal
processes to get out of TASK_INTERRUPTIBLE and return to user space
handling).

And the pending fake signal will never go away, because there is no
"return to user space" handling.

So I think the fix is to simply make freeze_task() not do that fake
signal thing for IO-uring threads either.

            Linus



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux