lkml.org 
[lkml]   [2006]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@sisk.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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-11-19 03:13    [W:0.104 / U:0.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site