[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170518195255.GA2518@redhat.com>
Date: Thu, 18 May 2017 21:52:56 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Miroslav Benes <mbenes@...e.cz>
Cc: jpoimboe@...hat.com, jeyu@...hat.com, jikos@...nel.org,
pmladek@...e.com, live-patching@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] livepatch: send a fake signal to all blocking tasks
On 05/18, Miroslav Benes wrote:
>
> On Thu, 18 May 2017, Oleg Nesterov wrote:
>
> >
> > exit_to_usermode_loop() calls do_signal(), then klp_update_patch_state().
> > So it won't be cleared here.
>
> Ok, so maybe I misunderstand the code. I see the loop in
> exit_to_usermode_loop() for processing ALLWORK_MASK. There we call
> do_signal(). We go to get_signal(). The infinite loop there is relevant
> for us. We call dequeue_signal(). There, if I am not mistaken
> __dequeue_signal() would return 0
Yes, sorry, I didn't bother to read the code when I looked at your patch
and my memory fooled me.
> If not, we get back to exit_to_usermode_loop() and TIF_PATCH_PENDING is
> cleared. Yes, it is true that TIF_SIGPENDING is still set and we get to
> do_signal() once more. But for the last time.
Yes, slightly sub-optimal but not really wrong and you can swap
do_signal() and klp_update_patch_state().
> If the syscall is restarted, it may be different. I have to think about
> this one. But...
Afaics, there are no problems.
In short. Thanks for correcting me and sorry for noise!
Oleg.
Powered by blists - more mailing lists