[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110829180248.GA13346@redhat.com>
Date: Mon, 29 Aug 2011 20:02:48 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Tejun Heo <tj@...nel.org>
Cc: "Rafael J. Wysocki" <rjw@...k.pl>,
Paul Menage <paul@...lmenage.org>,
containers@...ts.linux-foundation.org,
linux-pm@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH pm-freezer 2/4] freezer: set PF_NOFREEZE on a dying
task right before TASK_DEAD
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists