Messages in this thread | | | Date | Tue, 29 Mar 2011 20:27:41 +0200 | From | Oleg Nesterov <> | Subject | Re: [PATCH 1/3] signal: Make signal_wake_up() take @sig_type instead of @resume |
| |
On 03/29, Tejun Heo wrote: > > -void signal_wake_up(struct task_struct *t, int resume) > +void signal_wake_up(struct task_struct *t, int sig_type) > { > - unsigned int mask; > + unsigned int uninitialized_var(mask); > > set_tsk_thread_flag(t, TIF_SIGPENDING); > > - /* > - * For SIGKILL, we want to wake it up in the stopped/traced/killable > - * case. We don't check t->state here because there is a race with it > - * executing another processor and just now entering stopped state. > - * By using wake_up_state, we ensure the process will wake up and > - * handle its death signal. > - */ > - mask = TASK_INTERRUPTIBLE; > - if (resume) > - mask |= TASK_WAKEKILL; > + switch (sig_type) { > + case 0: > + mask = TASK_INTERRUPTIBLE; > + break; > + > + case SIGKILL: > + /* > + * For SIGKILL, we want to wake it up in the stopped / > + * traced / killable case. We don't check t->state here > + * because there is a race with it executing another > + * processor and just now entering stopped state. By using > + * wake_up_state, we ensure the process will wake up and > + * handle its death signal. > + */ > + mask |= TASK_INTERRUPTIBLE | TASK_WAKEKILL; > + break;
Interesting... Yes, I was thinking about changing signal_wake_up() too, my intent was to pass TASK_* mask directly.
But your approach looks more clean. So, to me 1-2 look as the nice cleanups in any case.
But let me think more about 3/3. I still think we do not want this. But I need the fresh head to undestand what I actually have in mind. Perhaps nothing, just the wrong feeling.
Oleg.
| |