From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932162AbXDBFkk (ORCPT ); Mon, 2 Apr 2007 01:40:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932065AbXDBFkk (ORCPT ); Mon, 2 Apr 2007 01:40:40 -0400 Received: from smtp.osdl.org ([65.172.181.24]:36347 "EHLO smtp.osdl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753300AbXDBFki (ORCPT ); Mon, 2 Apr 2007 01:40:38 -0400 Date: Sun, 1 Apr 2007 22:39:35 -0700 From: Andrew Morton To: Jan Engelhardt Cc: Linux Kernel Mailing List , Chris Wright Subject: Re: [PATCH 5/16] fix-kthread-niceness.diff Message-Id: <20070401223935.f73402a8.akpm@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed version 2.2.7 (GTK+ 2.8.17; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 1 Apr 2007 20:14:40 +0200 (MEST) Jan Engelhardt wrote: > Fix kevent's childs priority greedy-ness. 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 > > Signed-off-by: Jan Engelhardt > Cc: Chris Wright > > kmod.c | 1 + > 1 file changed, 1 insertion(+) > > Index: linux-2.6.21-rc5/kernel/kmod.c > =================================================================== > --- linux-2.6.21-rc5.orig/kernel/kmod.c > +++ linux-2.6.21-rc5/kernel/kmod.c > @@ -165,6 +165,7 @@ static int ____call_usermodehelper(void > > /* We can run anywhere, unlike our parent keventd(). */ > set_cpus_allowed(current, CPU_MASK_ALL); > + set_user_nice(current, 0); > > retval = -EPERM; > if (current->fs->root) > # -ETOOOBSCURE. --- a/kernel/kmod.c~fix-kthread-nicenessdiff-fix +++ a/kernel/kmod.c @@ -163,6 +163,11 @@ static int ____call_usermodehelper(void /* 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; _