public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Jackson <pj@sgi.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org,
	Matthew Dobson <colpatch@us.ibm.com>,
	William Lee Irwin III <wli@holomorphy.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Joe Korty <joe.korty@ccur.com>, Jesse Barnes <jbarnes@sgi.com>
Subject: [PATCH mask 6/15] nonsmp-cpu-present-map
Date: Thu, 6 May 2004 11:48:32 -0700	[thread overview]
Message-ID: <20040506114832.33657806.pj@sgi.com> (raw)
In-Reply-To: <20040506111814.62d1f537.pj@sgi.com>

Fix build breakage if CONFIG_SMP disabled, in Ashok's cpuhotplog
patches in init/main.c routine fixup_cpu_present_map().

Make cpu_present_map a real map for all configurations,
instead of a constant for non-SMP.  Also move the definition
of cpu_present_map out of kernel/cpu.c into kernel/sched.c,
because cpu.c isn't compiled into non-SMP kernels.

============= include/linux/cpumask.h =============

--- 2.6.6-rc3-mm2-old/include/linux/cpumask.h	2004-05-06 04:22:43.000000000 -0700
+++ 2.6.6-rc3-mm2/include/linux/cpumask.h	2004-05-06 03:30:32.000000000 -0700
@@ -10,15 +10,12 @@
 
 extern cpumask_t cpu_online_map;
 extern cpumask_t cpu_possible_map;
-extern cpumask_t cpu_present_map;
 
 #define num_online_cpus()		cpus_weight(cpu_online_map)
 #define num_possible_cpus()		cpus_weight(cpu_possible_map)
-#define num_present_cpus()		cpus_weight(cpu_present_map)
 
 #define cpu_online(cpu)			cpu_isset(cpu, cpu_online_map)
 #define cpu_possible(cpu)		cpu_isset(cpu, cpu_possible_map)
-#define cpu_present(cpu)		cpu_isset(cpu, cpu_present_map)
 
 #define for_each_cpu_mask(cpu, mask)					\
 	for (cpu = first_cpu_const(mk_cpumask_const(mask));		\
@@ -27,25 +24,25 @@ extern cpumask_t cpu_present_map;
 
 #define for_each_cpu(cpu) for_each_cpu_mask(cpu, cpu_possible_map)
 #define for_each_online_cpu(cpu) for_each_cpu_mask(cpu, cpu_online_map)
-#define for_each_present_cpu(cpu) for_each_cpu_mask(cpu, cpu_present_map)
 #else
 #define	cpu_online_map			cpumask_of_cpu(0)
 #define	cpu_possible_map		cpumask_of_cpu(0)
-#define	cpu_present_map			cpumask_of_cpu(0)
 
 #define num_online_cpus()		1
 #define num_possible_cpus()		1
-#define num_present_cpus()		1
 
 #define cpu_online(cpu)			({ BUG_ON((cpu) != 0); 1; })
 #define cpu_possible(cpu)		({ BUG_ON((cpu) != 0); 1; })
-#define cpu_present(cpu)		({ BUG_ON((cpu) != 0); 1; })
 
 #define for_each_cpu(cpu) for (cpu = 0; cpu < 1; cpu++)
 #define for_each_online_cpu(cpu) for (cpu = 0; cpu < 1; cpu++)
-#define for_each_present_cpu(cpu) for (cpu = 0; cpu < 1; cpu++)
 #endif
 
+extern cpumask_t cpu_present_map;
+#define num_present_cpus()		cpus_weight(cpu_present_map)
+#define cpu_present(cpu)		cpu_isset(cpu, cpu_present_map)
+#define for_each_present_cpu(cpu) for_each_cpu_mask(cpu, cpu_present_map)
+
 #define cpumask_scnprintf(buf, buflen, map)				\
 	bitmap_scnprintf(buf, buflen, cpus_addr(map), NR_CPUS)
 

============= kernel/cpu.c =============

--- 2.6.6-rc3-mm2-old/kernel/cpu.c	2004-05-06 04:22:43.000000000 -0700
+++ 2.6.6-rc3-mm2/kernel/cpu.c	2004-05-06 01:07:27.000000000 -0700
@@ -20,14 +20,6 @@
 DECLARE_MUTEX(cpucontrol);
 
 static struct notifier_block *cpu_chain;
-/*
- * Represents all cpu's present in the system
- * In systems capable of hotplug, this map could dynamically grow
- * as new cpu's are detected in the system via any platform specific
- * method, such as ACPI for e.g.
- */
-cpumask_t	cpu_present_map;
-EXPORT_SYMBOL(cpu_present_map);
 
 /* Need to know about CPUs going up/down? */
 int register_cpu_notifier(struct notifier_block *nb)

============= kernel/sched.c =============

--- 2.6.6-rc3-mm2-old/kernel/sched.c	2004-05-06 04:22:43.000000000 -0700
+++ 2.6.6-rc3-mm2/kernel/sched.c	2004-05-06 03:30:35.000000000 -0700
@@ -3052,6 +3052,16 @@ out_unlock:
 	return retval;
 }
 
+/*
+ * Represents all cpu's present in the system
+ * In systems capable of hotplug, this map could dynamically grow
+ * as new cpu's are detected in the system via any platform specific
+ * method, such as ACPI for e.g.
+ */
+
+cpumask_t cpu_present_map;
+EXPORT_SYMBOL(cpu_present_map);
+
 /**
  * sys_sched_setaffinity - set the cpu affinity of a process
  * @pid: pid of the process


-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <pj@sgi.com> 1.650.933.1373

  parent reply	other threads:[~2004-05-06 19:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-06 18:18 [PATCH mask 0/15] bitmap and cpumask cleanup Paul Jackson
2004-05-06 18:46 ` [PATCH mask 1/15] pj-fix-1-unifix Paul Jackson
2004-05-06 20:05   ` Matt Mackall
2004-05-06 20:15     ` Paul Jackson
2004-05-06 20:36     ` Paul Jackson
2004-05-06 18:48 ` [PATCH mask 2/15] pj-fix-2-ashoks-updated-cpuhotplug-6-7 Paul Jackson
2004-05-06 18:48 ` [PATCH mask 3/15] pj-fix-3-ashoks-updated-cpuhotplug-7-7 Paul Jackson
2004-05-06 18:48 ` [PATCH mask 4/15] pj-fix-4-include-mempolicy Paul Jackson
2004-05-06 18:48 ` [PATCH mask 5/15] pj-fix-5-syscall-return-semicolon Paul Jackson
2004-05-06 18:48 ` Paul Jackson [this message]
2004-05-06 18:48 ` [PATCH mask 7/15] mask1-bitmap-cleanup-prep Paul Jackson
2004-05-06 18:48 ` [PATCH mask 8/15] mask2-bitmap-extensions Paul Jackson
2004-05-06 18:48 ` [PATCH mask 9/15] mask3-unline-find-next-bit-ia64 Paul Jackson
2004-05-06 18:48 ` [PATCH mask 10/15] mask4-new-cpumask-h Paul Jackson
2004-05-06 18:48 ` [PATCH mask 11/15] mask5-remove-old-cpumask-files Paul Jackson
2004-05-06 18:49 ` [PATCH mask 12/15] mask6-cpumask-i386-fixup Paul Jackson
2004-05-06 18:49 ` [PATCH mask 13/15] mask7-cpumask-etc-fixup Paul Jackson
2004-05-06 18:49 ` [PATCH mask 14/15] mask8-rm-old-cpumask-emul Paul Jackson
2004-05-06 18:49 ` [PATCH mask 15/15] mask9-post-cleanup-tweaks Paul Jackson
2004-05-07  9:53 ` [PATCH mask 0/15] bitmap and cpumask cleanup Paul Jackson
     [not found] <936AF5883B4DD84F83C40185A810315001540E16@orsmsx404.jf.intel.com>
     [not found] ` <20040506190021.A17643@unix-os.sc.intel.com>
2004-05-08 11:10   ` [PATCH mask 6/15] nonsmp-cpu-present-map Paul Jackson
2004-05-08 11:31     ` Paul Jackson

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=20040506114832.33657806.pj@sgi.com \
    --to=pj@sgi.com \
    --cc=akpm@osdl.org \
    --cc=colpatch@us.ibm.com \
    --cc=jbarnes@sgi.com \
    --cc=joe.korty@ccur.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=wli@holomorphy.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox