Re: [PATCH][2.6-mm] kernel/kmod.c kernel/kthread.c NR_CPUS fixes

From: Martin Hicks
Date: Mon Feb 16 2004 - 18:02:10 EST



Hmm...I sent a similar patch to Andrew a couple hours ago. I was really
hoping there was a nicer way to fix this.

mh

On Mon, Feb 16, 2004 at 05:43:08PM -0500, Zwane Mwaikambo wrote:
> Needed to compile with high NR_CPUS, Rusty try not to cringe too much =)
>
> Index: linux-2.6.3-rc3-mm1-test/kernel/kmod.c
> ===================================================================
> RCS file: /home/cvsroot/linux-2.6.3-rc3-mm1/kernel/kmod.c,v
> retrieving revision 1.1.1.1
> diff -u -p -B -r1.1.1.1 kmod.c
> --- linux-2.6.3-rc3-mm1-test/kernel/kmod.c 16 Feb 2004 20:42:49 -0000 1.1.1.1
> +++ linux-2.6.3-rc3-mm1-test/kernel/kmod.c 16 Feb 2004 21:40:49 -0000
> @@ -148,6 +148,7 @@ struct subprocess_info {
> */
> static int ____call_usermodehelper(void *data)
> {
> + const cpumask_t mask = CPU_MASK_ALL;
> struct subprocess_info *sub_info = data;
> int retval;
>
> @@ -160,7 +161,7 @@ static int ____call_usermodehelper(void
> spin_unlock_irq(&current->sighand->siglock);
>
> /* We can run anywhere, unlike our parent keventd(). */
> - set_cpus_allowed(current, CPU_MASK_ALL);
> + set_cpus_allowed(current, mask);
> retval = -EPERM;
> if (current->fs->root)
> retval = execve(sub_info->path, sub_info->argv,sub_info->envp);
> Index: linux-2.6.3-rc3-mm1-test/kernel/kthread.c
> ===================================================================
> RCS file: /home/cvsroot/linux-2.6.3-rc3-mm1/kernel/kthread.c,v
> retrieving revision 1.1.1.1
> diff -u -p -B -r1.1.1.1 kthread.c
> --- linux-2.6.3-rc3-mm1-test/kernel/kthread.c 16 Feb 2004 20:42:49 -0000 1.1.1.1
> +++ linux-2.6.3-rc3-mm1-test/kernel/kthread.c 16 Feb 2004 21:43:40 -0000
> @@ -29,6 +29,7 @@ struct kthread_create_info
> /* Returns so that WEXITSTATUS(ret) == errno. */
> static int kthread(void *_create)
> {
> + const cpumask_t mask = CPU_MASK_ALL;
> struct kthread_create_info *create = _create;
> int (*threadfn)(void *data);
> void *data;
> @@ -45,7 +46,7 @@ static int kthread(void *_create)
> flush_signals(current);
>
> /* By default we can run anywhere, unlike keventd. */
> - set_cpus_allowed(current, CPU_MASK_ALL);
> + set_cpus_allowed(current, mask);
>
> /* OK, tell user we're spawned, wait for stop or wakeup */
> __set_current_state(TASK_INTERRUPTIBLE);
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

--
Martin Hicks Wild Open Source Inc.
mort@xxxxxxxxxxxxxxxxxx 613-266-2296
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/