All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org, piggin@cyberone.com.au,
	dipankar@in.ibm.com, vatsa@in.ibm.com, mingo@redhat.com
Subject: Re: [PATCH 3/4] 2.6.2-rc2-mm2 CPU Hotplug: The Core
Date: Sun, 1 Feb 2004 00:03:14 -0800	[thread overview]
Message-ID: <20040201000314.233e05a7.akpm@osdl.org> (raw)
In-Reply-To: <20040131141937.E58852C082@lists.samba.org>

Rusty Russell <rusty@rustcorp.com.au> wrote:
>
>  The actual CPU patch.  It's big, but almost all under
>  CONFIG_HOTPLUG_CPU, or macros which have same effect.

Needs a fixup.



CPU_MASK_ALL and CPU_MASK_NONE may only be used for initialisers.  It
doesn't compile if NR_CPUS>4*BITS_PER_LONG.  Fixes to the cpumask
infrastructure for this remain welcome.



---

 25-akpm/kernel/kmod.c    |    5 +++--
 25-akpm/kernel/kthread.c |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff -puN kernel/kmod.c~set_cpus_allowed-fix kernel/kmod.c
--- 25/kernel/kmod.c~set_cpus_allowed-fix	Sun Feb  1 02:21:19 2004
+++ 25-akpm/kernel/kmod.c	Sun Feb  1 02:21:19 2004
@@ -159,6 +159,7 @@ struct subprocess_info {
 static int ____call_usermodehelper(void *data)
 {
 	struct subprocess_info *sub_info = data;
+	static cpumask_t all_cpus = CPU_MASK_ALL;
 	int retval;
 
 	/* Unblock all signals. */
@@ -170,12 +171,12 @@ 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, all_cpus);
 	/* As a kernel thread which was bound to a specific cpu,
 	   migrate_all_tasks wouldn't touch us.  Avoid running child
 	   on dying CPU. */
 	if (cpu_is_offline(smp_processor_id()))
-		migrate_to_cpu(any_online_cpu(CPU_MASK_ALL));
+		migrate_to_cpu(any_online_cpu(all_cpus));
 
 	retval = -EPERM;
 	if (current->fs->root)
diff -puN kernel/kthread.c~set_cpus_allowed-fix kernel/kthread.c
--- 25/kernel/kthread.c~set_cpus_allowed-fix	Sun Feb  1 02:21:19 2004
+++ 25-akpm/kernel/kthread.c	Sun Feb  1 02:21:19 2004
@@ -35,6 +35,7 @@ static int kthread(void *_create)
 	void *data;
 	sigset_t blocked;
 	int ret = -EINTR;
+	static cpumask_t all_cpus = CPU_MASK_ALL;
 
 	/* Copy data: it's on keventd's stack */
 	threadfn = create->threadfn;
@@ -46,13 +47,13 @@ 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, all_cpus);
 
 	/* As a kernel thread which was bound to a specific cpu,
 	   migrate_all_tasks wouldn't touch us.  Avoid running on
 	   dying CPU. */
 	if (cpu_is_offline(smp_processor_id()))
-		migrate_to_cpu(any_online_cpu(CPU_MASK_ALL));
+		migrate_to_cpu(any_online_cpu(all_cpus));
 
 	/* OK, tell user we're spawned, wait for stop or wakeup */
 	__set_current_state(TASK_INTERRUPTIBLE);

_


  reply	other threads:[~2004-02-01  8:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-31 14:16 [PATCH 3/4] 2.6.2-rc2-mm2 CPU Hotplug: The Core Rusty Russell
2004-02-01  8:03 ` Andrew Morton [this message]
2004-02-01 10:19   ` Nick Piggin
2004-02-01 12:07   ` Rusty Russell
2004-02-02  9:12 ` Ingo Molnar
2004-02-02 10:55   ` Rusty Russell
2004-02-02 12:45     ` Ingo Molnar
2004-02-02 13:22       ` Srivatsa Vaddagiri
2004-02-02 15:40         ` Ingo Molnar
2004-02-03  0:45           ` Rusty Russell
2004-02-03  8:04             ` Ingo Molnar
2004-02-03  8:16               ` Rusty Russell
2004-02-03  8:31                 ` Ingo Molnar
2004-02-03  7:39           ` New v. v. experimental HOTPLUG CPU megapatch Rusty Russell
2004-02-03  9:35             ` Ingo Molnar
2004-02-05 18:12             ` Pavel Machek
2004-02-03  0:34       ` [PATCH 3/4] 2.6.2-rc2-mm2 CPU Hotplug: The Core Rusty Russell
2004-02-03  9:26         ` Ingo Molnar
2004-02-04  0:19           ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040201000314.233e05a7.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=piggin@cyberone.com.au \
    --cc=rusty@rustcorp.com.au \
    --cc=vatsa@in.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.