[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <99b7ebb1-0cf8-7605-bf2f-08e7abc9cf43@kernel.dk>
Date: Thu, 8 Oct 2020 07:38:05 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Oleg Nesterov <oleg@...hat.com>
Cc: linux-kernel@...r.kernel.org, io-uring@...r.kernel.org,
peterz@...radead.org, tglx@...utronix.de
Subject: Re: [PATCH 2/6] kernel: add task_sigpending() helper
On 10/8/20 7:24 AM, Oleg Nesterov wrote:
> On 10/05, Jens Axboe wrote:
>>
>> @@ -4447,7 +4447,7 @@ SYSCALL_DEFINE0(pause)
>> __set_current_state(TASK_INTERRUPTIBLE);
>> schedule();
>> }
>> - return -ERESTARTNOHAND;
>> + return task_sigpending(current) ? -ERESTARTNOHAND : -ERESTARTSYS;
>> }
>>
>> #endif
>> @@ -4462,7 +4462,7 @@ static int sigsuspend(sigset_t *set)
>> schedule();
>> }
>> set_restore_sigmask();
>> - return -ERESTARTNOHAND;
>> + return task_sigpending(current) ? -ERESTARTNOHAND : -ERESTARTSYS;
>> }
>
> Both changes are equally wrong. Why do you think sigsuspend() should ever
> return -ERESTARTSYS ?
>
> If get_signal() deques a signal, handle_signal() will restart this syscall
> if ERESTARTSYS, this is wrong.
The intent was that if we get woken up and signal_pending() is true, then
we want to restart it if we're just doing TIF_SIGNAL_NOTIFY. But I guess
it can't be 100% reliable, even if TIF_SIGPENDING isn't set at this point,
but it is by the time a signal is attempted dequeued.
I'll drop these too, thanks Oleg.
--
Jens Axboe
Powered by blists - more mailing lists