[lkml]   [2007]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RC][PATCH -mm] PM: Prevent frozen user mode helpers from failing the freezing of tasks

> From: Rafael J. Wysocki <>
> At present, if a user mode helper is running while usermodehelper_pm_callback()
> is executed, the helper may be frozen and the completion in
> call_usermodehelper_exec() won't be completed until user space processes are
> thawed. As a result, the freezing of kernel threads may fail, which is not
> desirable.
> Prevent this from happening by introducing a counter of running user mode
> helpers and allowing usermodehelper_pm_callback() to succeed for
> action = PM_HIBERNATION_PREPARE or action = PM_SUSPEND_PREPARE only if there
> are no helpers running. [Namely, usermodehelper_pm_callback() waits for at most
> RUNNING_HELPERS_TIMEOUT for the number of running helpers to become zero and
> fails if that doesn't happen.]
> Special thanks to Uli Luckas <> for reviewing the previous
> versions of this patch and for very useful comments.
> Reviewed-by: Pavel Machek <>

Eh, not sure this header is worth anything. Sometimes I'm lazy and
stop when I see first problem.

> switch (action) {
> 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?
(cesky, pictures)
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: 2007-06-22 23:11    [W:0.072 / U:0.072 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site