Re: [PATCH 1/2] Freezer: Fix s2disk resume from initrd (rev. 2)

Pavel Machek
2007-11-23T12:21:33Z

Hi!

> > > + /*
> > > + * In case that a resume from disk is carried out by linuxrc or one of
> > > + * its children, we need to tell the freezer not to wait for us.
> > > + */
> > > + current->flags |= PF_FREEZER_SKIP;
> > > +
> > > pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
> > > if (pid > 0)
> > > - while (pid != sys_wait4(-1, NULL, 0, NULL)) {
> > > - try_to_freeze();
> > > + while (pid != sys_wait4(-1, NULL, 0, NULL))
> > > yield();
> > > - }
> > > +
> > > + current->flags &= ~PF_FREEZER_SKIP;
> >
> > New code should work (but it is uglier than the old one).
>
> Well, the old code plain doesn't work ...
>
> > What was wrong with the old one? Refrigerator should make sys_wait4() return,
>
> It doesn't, because the task as no mm and is therefore considered as a kernel
> thread and not sent a signal.
>
> This _really_ is an exceptional case.

Ok, ACK.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html