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 Thu, Oct 15 2020 at 16:34, Oleg Nesterov wrote:
> On 10/15, Thomas Gleixner wrote:
>> Instead of adding this to every architectures signal magic, we can
>> handle TIF_NOTIFY_SIGNAL in the core code:
>>
>> static void handle_singal_work(ti_work, regs)
>> {
>> if (ti_work & _TIF_NOTIFY_SIGNAL)
>> tracehook_notify_signal();
>>
>> arch_do_signal(ti_work, regs);
>> }
>>
>> loop {
>> if (ti_work & (SIGPENDING | NOTIFY_SIGNAL))
>> handle_signal_work(ti_work, regs);
>> }
>
> To me this looks like unnecessary complication. We need to change
> every architecture anyway, how can this helper help?

This is about the generic entry code. For the users of that it makes
absolutely no sense to have that in architecture code.

Something which every architecture needs to do in the exactly same way
goes into the common code. If not, you can spare the exercise of having
common code in the first place.

Also arch_do_signal() becomes a misnomer with this new magic.

static void handle_signal_work(ti_work, regs)
{
if (ti_work & _TIF_NOTIFY_SIGNAL)
tracehook_notify_signal();

arch_do_signal_or_restart(ti_work, regs);
}

which makes it entirely clear what this is about.

Thanks,

tglx

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