[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110829154944.GA7531@redhat.com>
Date: Mon, 29 Aug 2011 17:49:44 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Tejun Heo <tj@...nel.org>
Cc: rjw@...k.pl, paul@...lmenage.org, linux-kernel@...r.kernel.org,
arnd@...db.de
Subject: Re: [PATCH 14/16] freezer: make freezing() test freeze conditions
in effect instead of TIF_FREEZE
On 08/19, Tejun Heo wrote:
>
> @@ -311,9 +315,11 @@ static int freezer_change_state(struct cgroup *cgroup,
>
> switch (goal_state) {
> case CGROUP_THAWED:
> + atomic_dec(&system_freezing_cnt);
> unfreeze_cgroup(cgroup, freezer);
> break;
> case CGROUP_FROZEN:
> + atomic_inc(&system_freezing_cnt);
This is harmless, but afaics is not exactly right. CGROUP_FROZEN doesn't
need system_freezing_cnt != 0, everything is already frozen and we just
provoke freezing_slow_path() without any reason. Right?
> @@ -120,13 +120,18 @@ int freeze_processes(void)
> {
> int error;
>
> + if (!pm_freezing)
> + atomic_inc(&system_freezing_cnt);
> +
> printk("Freezing user space processes ... ");
> + pm_freezing = true;
and
> @@ -146,6 +151,11 @@ void thaw_processes(void)
> {
> struct task_struct *g, *p;
>
> + if (pm_freezing)
> + atomic_dec(&system_freezing_cnt);
> + pm_freezing = false;
I simply can't understand this... Why freeze_processes/thaw_processes
check pm_freezing?
IIUC, the calls to freeze/thaw should be serialized anyway (probably
pm_mutex ?). Otherwise this check can't help anyway. Say, _if_ it
is possible to call freeze_processes() with pm_freezing == T, then
the failure path or subsequent thaw_processes() will do the unbalanced
atomic_dec().
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