Re: [PATCH 1/3] signal: Make signal_wake_up() take @sig_typeinstead of @resume

From: Oleg Nesterov
Date: Tue Mar 29 2011 - 14:28:52 EST


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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/