Re: [Suspend2][ 15/20] [Suspend2] Attempt to freeze processes.

From: Nigel Cunningham
Date: Tue Jun 27 2006 - 19:37:39 EST


Hi.

On Tuesday 27 June 2006 23:45, Pavel Machek wrote:
> Hi!
>
> > Call the freezer code to get processes frozen, and abort suspending if
> > that fails. May be called multiple times as we thaw kernel space (only)
> > if we need to free memory to meet constraints.
>
> Current code seems to free memory without need to thaw/re-freeze
> kernel threads. Have you found bugs in that, or is this unneccessary?

Did you read my other email? Try it with a swap file on a journalled
filesystem, in a situation where freeing memory will force the swap file to
be used.

Regards,

Nigel

> > +static int attempt_to_freeze(void)
> > +{
> > + int result;
> > +
> > + /* Stop processes before checking again */
> > + thaw_processes(FREEZER_ALL_THREADS);
> > + suspend_prepare_status(CLEAR_BAR, "Freezing processes");
> > + result = freeze_processes();
> > +
> > + if (result) {
> > + set_result_state(SUSPEND_ABORTED);
> > + set_result_state(SUSPEND_FREEZING_FAILED);
> > + } else
> > + are_frozen = 1;
> > +
> > + return result;
> > +}
> > +

--
See http://www.suspend2.net for Howtos, FAQs, mailing
lists, wiki and bugzilla info.

Attachment: pgp00000.pgp
Description: PGP signature