From: Pavel Machek <pavel@ucw.cz>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: LKML <linux-kernel@vger.kernel.org>,
Nigel Cunningham <nigel@nigel.suspend2.net>,
Uli Luckas <u.luckas@road.de>,
pm list <linux-pm@lists.linux-foundation.org>
Subject: Re: [RC][PATCH -mm] PM: Prevent frozen user mode helpers from failing the freezing of tasks
Date: Sun, 24 Jun 2007 19:05:14 +0200 [thread overview]
Message-ID: <20070624170514.GA21757@elf.ucw.cz> (raw)
In-Reply-To: <200706222347.55717.rjw@sisk.pl>
Hi!
> > > Special thanks to Uli Luckas <u.luckas@road.de> for reviewing the previous
> > > versions of this patch and for very useful comments.
> > ...
> > > Reviewed-by: Pavel Machek <pavel@ucw.cz>
> >
> > 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
*/.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2007-06-24 17:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-22 14:47 Rafael J. Wysocki
2007-06-22 21:07 ` Pavel Machek
2007-06-22 21:47 ` Rafael J. Wysocki
2007-06-24 17:05 ` Pavel Machek [this message]
2007-06-24 20:26 ` Rafael J. Wysocki
2007-06-24 20:21 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070624170514.GA21757@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=nigel@nigel.suspend2.net \
--cc=rjw@sisk.pl \
--cc=u.luckas@road.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®