Re: -mm swsusp: fix highmem handling

From: Patrick Mochel
Date: Mon Aug 02 2004 - 01:14:52 EST




On Thu, 29 Jul 2004, Pavel Machek wrote:

> Swsusp was not restoring highmem properly. I did not find a nice place
> where to restore it, through, so it went to swsusp_free.

That's too late, and will be called if suspend failed, to clean up any
allocated memory. The proper place seems to be in swsusp_resume().

> I'm not sure why you are saving state before save_processor_state.
> swsusp_arch_resume will overwrite this, anyway. Is it to make something
> balanced?

Yes, so it matches the calls in swsusp_suspend() - Previously there was a
hack that did kernel_fpu_end() after calling save_processor_state(), to
pass in_atomic() checks. By restoring the state after we've snapshotted on
suspend prevents this from being a problem.

In general, if we assume that save_processor_state() does anything to the
CPU, besides just benign register saving, we have to make sure that it's
put into the same state on resume before we restore state..


Pat
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/