lkml.org 
[lkml]   [2020]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/3] task_work: use TIF_TASKWORK if available
Date
On Fri, Oct 02 2020 at 17:14, Oleg Nesterov wrote:
> Heh. To be honest I don't really like 1-2 ;)

I do not like any of this :)

> So I think that if we are going to add TIF_TASKWORK we should generalize
> this logic and turn it into TIF_NOTIFY_SIGNAL. Similar to TIF_NOTIFY_RESUME
> but implies signal_pending().
>
> IOW, something like
>
> void set_notify_signal(task)
> {
> if (!test_and_set_tsk_thread_flag(task, TIF_NOTIFY_SIGNAL)) {
> if (!wake_up_state(task, TASK_INTERRUPTIBLE))
> kick_process(t);
> }
> }
>
> // called by exit_to_user_mode_loop() if ti_work & _TIF_NOTIFY_SIGNAL
> void tracehook_notify_signal(regs)
> {
> clear_thread_flag(TIF_NOTIFY_SIGNAL);
> smp_mb__after_atomic();
> if (unlikely(current->task_works))
> task_work_run();
> }
>
> This way task_work_run() doesn't need to clear TIF_NOTIFY_SIGNAL and it can
> have more users.

I think it's fundamentaly wrong that we have several places and several
flags which handle task_work_run() instead of having exactly one place
and one flag.

Thanks,

tglx

\
 
 \ /
  Last update: 2020-10-02 17:31    [W:0.082 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site