Re: [PATCH 4/5] x86: wire up TIF_NOTIFY_SIGNAL

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

 



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



[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