[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061119020926.GD15873@elf.ucw.cz>
Date: Sun, 19 Nov 2006 03:09:26 +0100
From: Pavel Machek <pavel@....cz>
To: "Rafael J. Wysocki" <rjw@...k.pl>
Cc: Andrew Morton <akpm@...l.org>, LKML <linux-kernel@...r.kernel.org>,
Nigel Cunningham <ncunningham@...uxmail.org>
Subject: Re: [PATCH 2/4] swsusp: Untangle freeze_processes
Hi!
> Move the loop from freeze_processes() to a separate function and call it
> independently for user space processes and kernel threads so that the order of
> freezing tasks is clearly visible.
>
> Signed-off-by: Rafael J. Wysocki <rjw@...k.pl>
> ---
> kernel/power/process.c | 88 ++++++++++++++++++++++++++++++++-----------------
> 1 file changed, 58 insertions(+), 30 deletions(-)
>
> do_each_thread(g, p) {
> + if (is_user_space(p)) {
> + if(!freeze_user_space)
> + continue;
> + } else {
> + if(freeze_user_space)
> + continue;
> + }
Needs space between if and (, but lets use if (is_user_space() !=
freeze_user_space) trick here, too.
> +/**
> + * freeze_processes - tell processes to enter the refrigerator
> + *
> + * Returns 0 on success, or the number of processes that didn't freeze,
> + * although they were told to.
> + */
Above you point out to the broken calling convention. Perhaps this is
great time to fix it, too? Hmm, or maybe not. Patch looks good,
otherwise.
Pavel
> +int freeze_processes(void)
> +{
> + unsigned int nr_unfrozen;
> +
> + printk("Stopping tasks ... ");
> + nr_unfrozen = try_to_freeze_tasks(FREEZER_USER_SPACE);
> + if (nr_unfrozen)
> + return nr_unfrozen;
> +
> + sys_sync();
> + nr_unfrozen = try_to_freeze_tasks(FREEZER_KERNEL_THREADS);
> + if (nr_unfrozen)
> + return nr_unfrozen;
> +
> printk("done.\n");
> BUG_ON(in_atomic());
> return 0;
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
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