[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070226113220.GC164@tv-sign.ru>
Date: Mon, 26 Feb 2007 14:32:20 +0300
From: Oleg Nesterov <oleg@...sign.ru>
To: "Rafael J. Wysocki" <rjw@...k.pl>
Cc: Andrew Morton <akpm@...l.org>, Pavel Machek <pavel@....cz>,
LKML <linux-kernel@...r.kernel.org>,
Aneesh Kumar <aneesh.kumar@...il.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Srivatsa Vaddagiri <vatsa@...ibm.com>
Subject: Re: [PATCH -mm 2/6] Freezer: Fix memory ordering in refrigerator
On 02/26, Rafael J. Wysocki wrote:
>
> From: Oleg Nesterov <oleg@...sign.ru>
>
> refrigerator() can miss a wakeup, "wait event" loop needs a proper memory
> ordering.
>
> Signed-off-by: Oleg Nesterov <oleg@...sign.ru>
> Signed-off-by: Rafael J. Wysocki <rjw@...k.pl>
> Acked-by: Pavel Machek <pavel@....cz>
> ---
> kernel/power/process.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> Index: linux-2.6.20-mm2/kernel/power/process.c
> ===================================================================
> --- linux-2.6.20-mm2.orig/kernel/power/process.c
> +++ linux-2.6.20-mm2/kernel/power/process.c
> @@ -47,8 +47,10 @@ void refrigerator(void)
> recalc_sigpending(); /* We sent fake signal, clean it up */
> spin_unlock_irq(¤t->sighand->siglock);
>
> - while (frozen(current)) {
> - current->state = TASK_UNINTERRUPTIBLE;
> + for (;;) {
> + set_current_state(TASK_UNINTERRUPTIBLE);
> + if (!frozen(current))
> + break;
> schedule();
> }
> pr_debug("%s left refrigerator\n", current->comm);
This one is already in -mm tree.
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