Skip to content

Commit

Permalink
Revert "kobject: don't block for each kobject_uevent".
Browse files Browse the repository at this point in the history
This reverts commit f520360.

Tetsuo Handa, running a kernel with CONFIG_DEBUG_PAGEALLOC=y and
CONFIG_UEVENT_HELPER_PATH=/sbin/hotplug, has been hitting RCU detected
CPU stalls: it's been spinning in the loop where do_execve() counts up
the args (but why wasn't fixup_exception working? dunno).

The recent change, switching kobject_uevent_env() from UMH_WAIT_EXEC
to UMH_NO_WAIT, is broken: the exec uses args on the local stack here,
and an env which is kfreed as soon as call_usermodehelper() returns.
It very much needs to wait for the exec to be done.

An alternative would be to keep the UMH_NO_WAIT, and complicate the code
to allocate and free these resources correctly? but no, as GregKH
pointed out when making the commit, CONFIG_UEVENT_HELPER_PATH="" is a
much better optimization - though some distros are still saying
/sbin/hotplug in their .config, yet with no such binary in their initrd
or their root.

Reported-by: Tetsuo Handa <[email protected]>
Signed-off-by: Hugh Dickins <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Acked-by: Arjan van de Ven <[email protected]>
Acked-by: Will Newton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Hugh Dickins authored and torvalds committed Apr 16, 2009
1 parent 35c80d5 commit 05f54c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kobject_uevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
goto exit;

retval = call_usermodehelper(argv[0], argv,
env->envp, UMH_NO_WAIT);
env->envp, UMH_WAIT_EXEC);
}

exit:
Expand Down

0 comments on commit 05f54c1

Please sign in to comment.