From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Subject: [patch 07/10] x86: use cpumask function for present, possible, and online cpus
Date: Sat, 19 Apr 2008 23:55:17 +0900 [thread overview]
Message-ID: <480a0a98.12da600a.609a.541a@mx.google.com> (raw)
In-Reply-To: <20080419145510.150338641@gmail.com>
[-- Attachment #1: x86-use-cpumask-functions.patch --]
[-- Type: text/plain, Size: 3733 bytes --]
cpu_online(), cpu_present(), for_each_possible_cpu(), num_possible_cpus()
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
arch/x86/kernel/genapic_64.c | 2 +-
arch/x86/kernel/smpboot.c | 4 ++--
arch/x86/kernel/tlb_64.c | 4 ++--
arch/x86/mach-voyager/voyager_smp.c | 10 +++++-----
arch/x86/xen/smp.c | 2 +-
5 files changed, 11 insertions(+), 11 deletions(-)
Index: 2.6-git/arch/x86/mach-voyager/voyager_smp.c
===================================================================
--- 2.6-git.orig/arch/x86/mach-voyager/voyager_smp.c
+++ 2.6-git/arch/x86/mach-voyager/voyager_smp.c
@@ -115,7 +115,7 @@ static inline void send_QIC_CPI(__u32 cp
for_each_online_cpu(cpu) {
if (cpuset & (1 << cpu)) {
#ifdef VOYAGER_DEBUG
- if (!cpu_isset(cpu, cpu_online_map))
+ if (!cpu_online(cpu))
VDEBUG(("CPU%d sending cpi %d to CPU%d not in "
"cpu_online_map\n",
hard_smp_processor_id(), cpi, cpu));
@@ -702,9 +702,9 @@ void __init smp_boot_cpus(void)
* Code added from smpboot.c */
{
unsigned long bogosum = 0;
- for (i = 0; i < NR_CPUS; i++)
- if (cpu_isset(i, cpu_online_map))
- bogosum += cpu_data(i).loops_per_jiffy;
+
+ for_each_online_cpu(i)
+ bogosum += cpu_data(i).loops_per_jiffy;
printk(KERN_INFO "Total of %d processors activated "
"(%lu.%02lu BogoMIPS).\n",
cpucount + 1, bogosum / (500000 / HZ),
@@ -1857,7 +1857,7 @@ static int __cpuinit voyager_cpu_up(unsi
return -EIO;
/* Unleash the CPU! */
cpu_set(cpu, smp_commenced_mask);
- while (!cpu_isset(cpu, cpu_online_map))
+ while (!cpu_online(cpu))
mb();
return 0;
}
Index: 2.6-git/arch/x86/kernel/smpboot.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/smpboot.c
+++ 2.6-git/arch/x86/kernel/smpboot.c
@@ -1047,7 +1047,7 @@ int __cpuinit native_cpu_up(unsigned int
check_tsc_sync_source(cpu);
local_irq_restore(flags);
- while (!cpu_isset(cpu, cpu_online_map)) {
+ while (!cpu_online(cpu)) {
cpu_relax();
touch_nmi_watchdog();
}
@@ -1157,7 +1157,7 @@ static void __init smp_cpu_index_default
int i;
struct cpuinfo_x86 *c;
- for_each_cpu_mask(i, cpu_possible_map) {
+ for_each_possible_cpu(i) {
c = &cpu_data(i);
/* mark all to hotplug */
c->cpu_index = NR_CPUS;
Index: 2.6-git/arch/x86/kernel/genapic_64.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/genapic_64.c
+++ 2.6-git/arch/x86/kernel/genapic_64.c
@@ -51,7 +51,7 @@ void __init setup_apic_routing(void)
else
#endif
- if (cpus_weight(cpu_possible_map) <= 8)
+ if (num_possible_cpus() <= 8)
genapic = &apic_flat;
else
genapic = &apic_physflat;
Index: 2.6-git/arch/x86/kernel/tlb_64.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/tlb_64.c
+++ 2.6-git/arch/x86/kernel/tlb_64.c
@@ -195,9 +195,9 @@ int __cpuinit init_smp_flush(void)
{
int i;
- for_each_cpu_mask(i, cpu_possible_map) {
+ for_each_possible_cpu(i)
spin_lock_init(&per_cpu(flush_state, i).tlbstate_lock);
- }
+
return 0;
}
core_initcall(init_smp_flush);
Index: 2.6-git/arch/x86/xen/smp.c
===================================================================
--- 2.6-git.orig/arch/x86/xen/smp.c
+++ 2.6-git/arch/x86/xen/smp.c
@@ -183,7 +183,7 @@ void __init xen_smp_prepare_cpus(unsigne
/* Restrict the possible_map according to max_cpus. */
while ((num_possible_cpus() > 1) && (num_possible_cpus() > max_cpus)) {
- for (cpu = NR_CPUS-1; !cpu_isset(cpu, cpu_possible_map); cpu--)
+ for (cpu = NR_CPUS - 1; !cpu_possible(cpu); cpu--)
continue;
cpu_clear(cpu, cpu_possible_map);
}
--
next prev parent reply other threads:[~2008-04-19 15:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080419145510.150338641@gmail.com>
2008-04-19 14:55 ` [patch 01/10] x86: use BUILD_BUG_ON() for the size of struct intel_mp_floating Akinobu Mita
2008-04-19 14:55 ` [patch 02/10] x86: use MP_intsrc_info() Akinobu Mita
2008-04-19 14:55 ` [patch 03/10] x86: use bitmap library for pin_programmed Akinobu Mita
2008-04-19 14:55 ` [patch 04/10] x86: remove unnecessary memset and NULL check after alloc_bootmem() Akinobu Mita
2008-04-19 14:55 ` [patch 05/10] x86: cleanup clocksource_hz2mult usage Akinobu Mita
2008-04-19 14:55 ` [patch 06/10] x86: cleanup div_sc() usage Akinobu Mita
2008-04-19 14:55 ` Akinobu Mita [this message]
2008-04-19 14:55 ` [patch 08/10] x86: get_bios_ebda() requires asm/io.h Akinobu Mita
2008-04-19 14:55 ` [patch 09/10] x86: remove duplicate get_bios_ebda() from rio.h Akinobu Mita
2008-04-19 14:55 ` [patch 10/10] x86: use get_bios_ebda() Akinobu Mita
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=480a0a98.12da600a.609a.541a@mx.google.com \
--to=akinobu.mita@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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
Powered by JetHome