public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Tejun Heo <tj@kernel.org>
Cc: jan.kratochvil@redhat.com, vda.linux@googlemail.com,
	linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, indan@nul.nu, roland@hack.frob.com
Subject: Re: [PATCH 1/3] signal: Make signal_wake_up() take @sig_type instead of @resume
Date: Tue, 29 Mar 2011 20:27:41 +0200	[thread overview]
Message-ID: <20110329182741.GA9927@redhat.com> (raw)
In-Reply-To: <20110329144603.GA29865@htj.dyndns.org>

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.


      parent reply	other threads:[~2011-03-29 18:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29 14:46 [PATCH 1/3] signal: Make signal_wake_up() take @sig_type instead of @resume Tejun Heo
2011-03-29 14:46 ` [PATCH 2/3] signal, ptrace: Add SIGTRAP signal_wake_up() Tejun Heo
2011-03-29 14:47   ` [PATCH 3/3] signal, ptrace: Fix delayed CONTINUED notification when ptraced Tejun Heo
2011-03-30 19:29     ` Oleg Nesterov
2011-03-31  7:29       ` Tejun Heo
2011-03-31 15:15         ` Oleg Nesterov
2011-03-31 16:34           ` Tejun Heo
2011-03-31 16:35             ` Tejun Heo
2011-03-31 17:29             ` Oleg Nesterov
2011-04-01 18:11               ` [PATCH 0/4] Was: " Oleg Nesterov
2011-04-01 18:11                 ` [PATCH 1/4] signal: prepare_signal(SIGCONT) shouldn't play with TIF_SIGPENDING Oleg Nesterov
2011-04-01 18:12                 ` [PATCH 2/4] signal: do_signal_stop: remove the unneeded task_clear_group_stop_pending() Oleg Nesterov
2011-04-01 18:12                 ` [PATCH 3/4] signal: turn SIGNAL_STOP_DEQUEUED into GROUP_STOP_DEQUEUED Oleg Nesterov
2011-04-01 18:13                 ` [PATCH 4/4] ptrace: ptrace_check_attach() should not do s/STOPPED/TRACED/ Oleg Nesterov
2011-04-04  0:11                 ` [PATCH 0/4] Was: signal, ptrace: Fix delayed CONTINUED notification when ptraced Tejun Heo
2011-03-29 18:27 ` Oleg Nesterov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110329182741.GA9927@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=indan@nul.nu \
    --cc=jan.kratochvil@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@hack.frob.com \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=vda.linux@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox