From: Jan Engelhardt Date: Tue, 8 May 2007 07:28:24 +0000 (-0700) Subject: Fix kevent's childs priority greediness X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b73a7e76c1eeaa770a41554698917c3c45686a07;p=openwrt%2Fstaging%2Fblogic.git Fix kevent's childs priority greediness Fix kevent's childs priority greediness. Such tasks were always scheduled at nice level -5 and, at that time, udev stole us the CPU time with -5. Already posted at http://lkml.org/lkml/2005/1/10/85 [akpm@linux-foundation.org: add comment] Signed-off-by: Jan Engelhardt Cc: Chris Wright Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/kmod.c b/kernel/kmod.c index 11c584cd16b3..49cc4b9c1a8d 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c @@ -165,6 +165,12 @@ static int ____call_usermodehelper(void *data) /* We can run anywhere, unlike our parent keventd(). */ set_cpus_allowed(current, CPU_MASK_ALL); + /* + * Our parent is keventd, which runs with elevated scheduling priority. + * Avoid propagating that into the userspace child. + */ + set_user_nice(current, 0); + retval = -EPERM; if (current->fs->root) retval = kernel_execve(sub_info->path,