lkml.org 
[lkml]   [2011]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.



\
 
 \ /
  Last update: 2011-03-29 20:31    [W:0.082 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site