[lkml]   [2006]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [ 00/10] [Suspend2] Modules support.
On Friday 03 February 2006 15:29, Olivier Galibert wrote:
> On Fri, Feb 03, 2006 at 11:41:29AM +0100, Pavel Machek wrote:
> > > I don't even want to think about the interactions
> > > between freezing the userspace memory pages and running some processes
> > > which may malloc/mmap at the same time.
> >
> > There are none. userspace helper is mlocked, and rest of userspace is
> > stopped.
> Unless the userspace code is as tight as mission-critical RT code, I
> don't see how that can work reliably.

I use it on a daily basis. It works.

> Some problems I see:
> - What happens if the helper faults in new pages, changes its brk or
> mmaps things? Can we actually swap at that point?


> mlocking takes care of the fault in, not of the rest.
> - What happens if the helper reads files? Where will the pages with
> the file data be put? Are we saving the dcache in the image, and if
> yes which state of the dcache?

The suspending helper should not use mounted filesystems after it
calls the atomic snapshot ioctl(). The resuming helper should be run from
an initrd and all filesystems should be unmounted at that time (of course
it should not attempt to mount them).

Please read the Documentation/power/userland-swsusp.txt file in the latest -mm
and you'll get an idea of how it works.

> - What happens if the helper writes files? What state are we saving,
> before starting the helper or after?


> Will the fs be in a coherent state after resume?

Yes, it will, as long as the helpers follow some strict rules (above).

> - What about IPC? What if for instance the helper tries to contact
> HAL to get some system information?

That doesn't matter.

> And if you decide on rules on what the userspace can and can't do, how
> do you plan to enforce them? We have filesystems on the line there,
> you don't want them destroyed at resume because the latest version of
> kdome-resume-progress-bar thought it was cool to generate an picture
> of the desktop at suspend time to show at resume.
> The idea of trying to save a state that can be modified dynamically
> while you're saving in unpredictable ways makes me very, very afraid.
> At least when you're in the kernel you can have complete control over
> the machine when needed.

Not necessarily. For example, if you suspend the box and then start it with
a wrong kernel that is unable to read the image, it will mount the file
systems and you loose the saved state.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2006-02-03 18:30    [W:0.420 / U:3.688 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site