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: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Paul Menage <paul@paulmenage.org>,
	containers@lists.linux-foundation.org,
	linux-pm@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH pm-freezer 2/4] freezer: set PF_NOFREEZE on a dying task right before TASK_DEAD
Date: Mon, 29 Aug 2011 20:02:48 +0200	[thread overview]
Message-ID: <20110829180248.GA13346@redhat.com> (raw)
In-Reply-To: <20110829140509.GC18871@mtj.dyndns.org>

On 08/29, Tejun Heo wrote:
>
> There's no try_to_freeze() call in the exit path and the only
> necessary guarantee is that freezer doesn't hang waiting for zombies.
> Set PF_NOFREEZE right before setting tsk->state to TASK_DEAD instead.

Agreed.

But I'd like to repeat, this looks "asymmetrical". do_each_thread()
can't see the (auto)reaped tasks after they do exit_notify(). So we
can only see this PF_NOFREEZE if the thread becomes a zombie.

> @@ -1044,6 +1038,10 @@ NORET_TYPE void do_exit(long code)
>
>  	preempt_disable();
>  	exit_rcu();
> +
> +	/* this task is now dead and freezer should ignore it */
> +	current->flags |= PF_NOFREEZE;
> +
>  	/* causes final put_task_struct in finish_task_switch(). */
>  	tsk->state = TASK_DEAD;

May be freezing_slow_path() can check TASK_DEAD along with PF_NOFREEZE
instead? (or tsk->exit_state != 0 to avoid the asymmetry above). Just
to keep this logic in the freezer code. I dunno.

But this all is up to you and Rafael, I am not arguing. Just random
thoughts.

Oleg.


  parent reply	other threads:[~2011-08-29 18:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 14:04 [PATCH pm-freezer 1/4] cgroup_freezer: fix freezer->state setting bug in freezer_change_state() Tejun Heo
2011-08-29 14:05 ` [PATCH pm-freezer 2/4] freezer: set PF_NOFREEZE on a dying task right before TASK_DEAD Tejun Heo
2011-08-29 14:05   ` [PATCH pm-freezer 3/4] freezer: check freezing() before leaving FROZEN state Tejun Heo
2011-08-29 14:06     ` [PATCH pm-freezer 4/4] freezer: use lock_task_sighand() in fake_signal_wake_up() Tejun Heo
2011-08-29 16:36       ` Oleg Nesterov
2011-08-29 16:35     ` [PATCH pm-freezer 3/4] freezer: check freezing() before leaving FROZEN state Oleg Nesterov
2011-08-29 17:12       ` Oleg Nesterov
2011-08-29 17:21         ` Oleg Nesterov
2011-08-29 18:02   ` Oleg Nesterov [this message]
2011-08-29 16:00 ` [PATCH pm-freezer 1/4] cgroup_freezer: fix freezer->state setting bug in freezer_change_state() Oleg Nesterov

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=20110829180248.GA13346@redhat.com \
    --to=oleg@redhat.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=paul@paulmenage.org \
    --cc=rjw@sisk.pl \
    --cc=tj@kernel.org \
    /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