Re: [RC][PATCH -mm] PM: Prevent frozen user mode helpers from failing the freezing of tasks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

> > > > > Special thanks to Uli Luckas <[email protected]> for reviewing the previous
> > > > > versions of this patch and for very useful comments.
> > > > ...
> > > > > Reviewed-by: Pavel Machek <[email protected]>
> > > > 
> > > > Eh, not sure this header is worth anything. Sometimes I'm lazy and
> > > > stop when I see first problem.
> > > > 
> > > > >  	switch (action) {
> > > > >  	case PM_HIBERNATION_PREPARE:
> > > > >  	case PM_SUSPEND_PREPARE:
> > > > >  		usermodehelper_disabled = 1;
> > > > > -		return NOTIFY_OK;
> > > > > +		retval = wait_event_timeout(running_helpers_waitq,
> > > > > +					atomic_read(&running_helpers) == 0,
> > > > 
> > > > Are you sure here? What happens when atomic variable changes between
> > > > the atomic_read and the function call?
> > > 
> > > Er, this is a macro. :-)
> > > 
> > > In fact we rely only on atomic_read(&running_helpers) being still zero after
> > > helper_finished() has woken us up, but I think that's acceptable.
> > > 
> > > IOW, if the wait_event_timeout() returns with retval different from zero, this
> > > means that atomic_read(&running_helpers) returned zero at one point after
> > > we'd set usermodehelper_disabled, which is enough.  OTOH, if it doesn't
> > 
> > Ok, can you write short comment explaining that? /* We have set
> > usermodehelper_disabled, so any new usermode helpers are not a problem
> > */.
> 
> OK, please have a look at the updated patch below.

ACK, and thanks for your patience.
									Pavel

-- 
(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/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux