lkml.org 
[lkml]   [2020]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 4/5] x86: wire up TIF_NOTIFY_SIGNAL
Date
On Fri, Oct 16 2020 at 12:54, Oleg Nesterov wrote:
> On 10/16, Thomas Gleixner wrote:
>
> But again, I won't argue. And to remind, we do not really need to touch
> arch_do_signal() at all. We can just add
>
> if (test_thread_flag(TIF_NOTIFY_SIGNAL))
> tracehook_notify_signal();
>
> if (!task_sigpending(current))
> return 0;
>
> at the start of get_signal() and avoid the code duplication automatically.

That works as well and is smart, but it's completely non obvious while

if (ti_work & _TIF_NOTIFY_SIGNAL)
tracehook_notify_signal();

arch_do_signal_or_restart(ti_work & _TIF_SIGPENDING);

makes it entirely clear to follow the logic and it just operates on
cached ti_work.

You can still do this for the non generic entry architectures:

if (!IS_ENABLED(CONFIG_GENERIC_ENTRY) &&
(test_thread_flag(TIF_NOTIFY_SIGNAL))
tracehook_notify_signal();

to avoid the churn in arch/*.

Thanks,

tglx

\
 
 \ /
  Last update: 2020-10-16 15:07    [W:0.721 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site