Return-Path: <rusty@samba.org>
Received: from mnm [127.0.0.1]
	by localhost with POP3 (fetchmail-5.9.0)
	for akpm@localhost (single-drop); Thu, 29 Jan 2004 21:59:17 -0800 (PST)
Received: from fire-1.osdl.org (air1.pdx.osdl.net [172.20.0.5])
	by mail.osdl.org (8.11.6/8.11.6) with ESMTP id i0U5sxo29636
	for <akpm@osdl.org>; Thu, 29 Jan 2004 21:54:59 -0800
Received: from lists.samba.org (dp.samba.org [66.70.73.150])
	by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id i0U5sw16029123
	for <akpm@osdl.org>; Thu, 29 Jan 2004 21:54:59 -0800
Received: by lists.samba.org (Postfix, from userid 590)
	id 2B6282C0CA; Fri, 30 Jan 2004 05:55:13 +0000 (GMT)
From: Rusty Russell <rusty@rustcorp.com.au>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Affinity of call_usermode_helper fix
Date: Fri, 30 Jan 2004 15:52:34 +1100
Sender: rusty@bach.samba.org
Message-Id: <20040130055513.2B6282C0CA@lists.samba.org>
X-MIMEDefang-Filter: osdl$Revision: 1.48 $
X-Scanned-By: MIMEDefang 2.36
X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on mnm
X-Spam-Level: 
X-Spam-Status: No, hits=-4.9 required=2.0 tests=BAYES_00 autolearn=ham 
	version=2.60

Vatsa and I noticed this.

call_usermode_helper uses keventd, so the process created inherits its
cpus_allowed mask.  Unset it.

Name: call_usermode_helper Without Being Bound To A Specific CPU
Author: Rusty Russell
Status: Booted on 2.6.2-rc2-bk2

D: call_usermode_helper uses keventd, so the process created inherits
D: its cpus_allowed mask.  Unset it.

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .6951-linux-2.6.2-rc2-bk2/kernel/kmod.c .6951-linux-2.6.2-rc2-bk2.updated/kernel/kmod.c
--- .6951-linux-2.6.2-rc2-bk2/kernel/kmod.c	2004-01-10 13:59:39.000000000 +1100
+++ .6951-linux-2.6.2-rc2-bk2.updated/kernel/kmod.c	2004-01-29 16:08:31.000000000 +1100
@@ -168,6 +168,8 @@ static int ____call_usermodehelper(void 
 	recalc_sigpending();
 	spin_unlock_irq(&current->sighand->siglock);
 
+	/* We can run anywhere, unlike our parent keventd(). */
+	set_cpus_allowed(current, CPU_MASK_ALL);
 	retval = -EPERM;
 	if (current->fs->root)
 		retval = execve(sub_info->path, sub_info->argv,sub_info->envp);


--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.