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 <[EMAIL PROTECTED]> > --- > 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 [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/