mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
eliminate cpu_set()
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
d814eb0255
commit
e82e07391c
16 files changed
+34
-35
No files matched your search
@@ -557,7 +557,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
|
||||
(pa->apic_id << 8) | (pa->local_sapic_eid);
|
||||
/* nid should be overridden as logical node id later */
|
||||
node_cpuid[srat_num_cpus].nid = pxm;
|
||||
cpu_set(srat_num_cpus, early_cpu_possible_map);
|
||||
cpumask_set_cpu(srat_num_cpus, &early_cpu_possible_map);
|
||||
srat_num_cpus++;
|
||||
}
|
||||
|
||||
@@ -917,7 +917,7 @@ __init void prefill_possible_map(void)
|
||||
possible, max((possible - available_cpus), 0));
|
||||
|
||||
for (i = 0; i < possible; i++)
|
||||
cpu_set(i, cpu_possible_map);
|
||||
cpumask_set_cpu(i, &cpu_possible_map);
|
||||
}
|
||||
|
||||
#ifndef XEN
|
||||
|
||||
@@ -463,7 +463,7 @@ mark_bsp_online (void)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
/* If we register an early console, allow CPU 0 to printk */
|
||||
cpu_set(smp_processor_id(), cpu_online_map);
|
||||
cpumask_set_cpu(smp_processor_id(), &cpu_online_map);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -392,7 +392,7 @@ smp_callin (void)
|
||||
#else
|
||||
lock_ipi_calllock();
|
||||
#endif
|
||||
cpu_set(cpuid, cpu_online_map);
|
||||
cpumask_set_cpu(cpuid, &cpu_online_map);
|
||||
#ifdef XEN
|
||||
unlock_ipi_calllock(flags);
|
||||
#else
|
||||
@@ -437,7 +437,7 @@ smp_callin (void)
|
||||
/*
|
||||
* Allow the master to continue.
|
||||
*/
|
||||
cpu_set(cpuid, cpu_callin_map);
|
||||
cpumask_set_cpu(cpuid, &cpu_callin_map);
|
||||
Dprintk("Stack on CPU %d at about %p\n",cpuid, &cpuid);
|
||||
}
|
||||
|
||||
@@ -625,8 +625,8 @@ smp_prepare_cpus (unsigned int max_cpus)
|
||||
/*
|
||||
* We have the boot CPU online for sure.
|
||||
*/
|
||||
cpu_set(0, cpu_online_map);
|
||||
cpu_set(0, cpu_callin_map);
|
||||
cpumask_set_cpu(0, &cpu_online_map);
|
||||
cpumask_set_cpu(0, &cpu_callin_map);
|
||||
|
||||
local_cpu_data->loops_per_jiffy = loops_per_jiffy;
|
||||
ia64_cpu_to_sapicid[0] = boot_cpu_id;
|
||||
@@ -652,8 +652,8 @@ smp_prepare_cpus (unsigned int max_cpus)
|
||||
|
||||
void __devinit smp_prepare_boot_cpu(void)
|
||||
{
|
||||
cpu_set(smp_processor_id(), cpu_online_map);
|
||||
cpu_set(smp_processor_id(), cpu_callin_map);
|
||||
cpumask_set_cpu(smp_processor_id(), &cpu_online_map);
|
||||
cpumask_set_cpu(smp_processor_id(), &cpu_callin_map);
|
||||
per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
|
||||
}
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ sn2_global_tlb_purge(unsigned long start,
|
||||
for_each_possible_cpu(cpu) {
|
||||
cnode = cpu_to_node(cpu);
|
||||
if (!node_isset(cnode, nodes_flushed)) {
|
||||
cpu_set(cpu, selected_cpus);
|
||||
cpumask_set_cpu(cpu, &selected_cpus);
|
||||
i++;
|
||||
}
|
||||
node_set(cnode, nodes_flushed);
|
||||
|
||||
@@ -38,7 +38,7 @@ ia64_mmu_init (void *my_cpu_data)
|
||||
ia64_set_psr(psr);
|
||||
ia64_srlz_i();
|
||||
#ifdef XEN
|
||||
cpu_set(cpu, percpu_set);
|
||||
cpumask_set_cpu(cpu, &percpu_set);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -389,7 +389,7 @@ tlb_track_insert_or_dirty(struct tlb_track* tlb_track, struct mm_struct* mm,
|
||||
|
||||
found:
|
||||
BUG_ON(v->processor >= NR_CPUS);
|
||||
cpu_set(v->processor, entry->pcpu_dirty_mask);
|
||||
cpumask_set_cpu(v->processor, &entry->pcpu_dirty_mask);
|
||||
BUG_ON(v->vcpu_id >= NR_CPUS);
|
||||
vcpu_set(v->vcpu_id, entry->vcpu_dirty_mask);
|
||||
perfc_incr(tlb_track_iod_dirtied);
|
||||
|
||||
@@ -271,9 +271,9 @@ static void mwait_idle_with_hints(unsigned long eax, unsigned long ecx)
|
||||
*/
|
||||
if ( expires > NOW() || expires == 0 )
|
||||
{
|
||||
cpu_set(cpu, cpuidle_mwait_flags);
|
||||
cpumask_set_cpu(cpu, &cpuidle_mwait_flags);
|
||||
__mwait(eax, ecx);
|
||||
cpu_clear(cpu, cpuidle_mwait_flags);
|
||||
cpumask_clear_cpu(cpu, &cpuidle_mwait_flags);
|
||||
}
|
||||
|
||||
if ( expires <= NOW() && expires > 0 )
|
||||
|
||||
@@ -828,7 +828,7 @@ static void intel_machine_check(struct cpu_user_regs * regs, long error_code)
|
||||
* (the MSRs are sticky)
|
||||
*/
|
||||
if (bs.pcc || !bs.recoverable)
|
||||
cpu_set(smp_processor_id(), mce_fatal_cpus);
|
||||
cpumask_set_cpu(smp_processor_id(), &mce_fatal_cpus);
|
||||
} else {
|
||||
if (mctc != NULL)
|
||||
mctelem_commit(mctc);
|
||||
@@ -849,7 +849,7 @@ static void intel_machine_check(struct cpu_user_regs * regs, long error_code)
|
||||
|
||||
mce_barrier_enter(&mce_trap_bar);
|
||||
if ( mctc != NULL && mce_urgent_action(regs, mctc))
|
||||
cpu_set(smp_processor_id(), mce_fatal_cpus);
|
||||
cpumask_set_cpu(smp_processor_id(), &mce_fatal_cpus);
|
||||
mce_barrier_exit(&mce_trap_bar);
|
||||
/*
|
||||
* Wait until everybody has processed the trap.
|
||||
|
||||
@@ -161,7 +161,7 @@ static int __devinit MP_processor_info_x(struct mpc_config_processor *m,
|
||||
return cpu;
|
||||
}
|
||||
x86_cpu_to_apicid[cpu] = apicid;
|
||||
cpu_set(cpu, cpu_present_map);
|
||||
cpumask_set_cpu(cpu, &cpu_present_map);
|
||||
}
|
||||
|
||||
if (++num_processors > 8) {
|
||||
|
||||
+1
-1
@@ -288,7 +288,7 @@ void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn)
|
||||
|
||||
__cpuinit void numa_add_cpu(int cpu)
|
||||
{
|
||||
cpu_set(cpu, node_to_cpumask[cpu_to_node(cpu)]);
|
||||
cpumask_set_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]);
|
||||
}
|
||||
|
||||
void __cpuinit numa_set_node(int cpu, int node)
|
||||
|
||||
@@ -244,7 +244,7 @@ static void set_cpu_sibling_map(int cpu)
|
||||
int i;
|
||||
struct cpuinfo_x86 *c = cpu_data;
|
||||
|
||||
cpu_set(cpu, cpu_sibling_setup_map);
|
||||
cpumask_set_cpu(cpu, &cpu_sibling_setup_map);
|
||||
|
||||
if ( c[cpu].x86_num_siblings > 1 )
|
||||
{
|
||||
@@ -380,7 +380,7 @@ void start_secondary(void *unused)
|
||||
*/
|
||||
lock_vector_lock();
|
||||
__setup_vector_irq(cpu);
|
||||
cpu_set(cpu, cpu_online_map);
|
||||
cpumask_set_cpu(cpu, &cpu_online_map);
|
||||
unlock_vector_lock();
|
||||
|
||||
init_percpu_time();
|
||||
@@ -804,8 +804,8 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
|
||||
|
||||
void __init smp_prepare_boot_cpu(void)
|
||||
{
|
||||
cpu_set(smp_processor_id(), cpu_online_map);
|
||||
cpu_set(smp_processor_id(), cpu_present_map);
|
||||
cpumask_set_cpu(smp_processor_id(), &cpu_online_map);
|
||||
cpumask_set_cpu(smp_processor_id(), &cpu_present_map);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -933,7 +933,7 @@ int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t pxm)
|
||||
"break assumed cross-CPU TSC coherency.\n"
|
||||
" ** Consider using boot parameter \"tsc=skewed\" "
|
||||
"which forces TSC emulation where appropriate.\n", cpu);
|
||||
cpu_set(cpu, tsc_sync_cpu_mask);
|
||||
cpumask_set_cpu(cpu, &tsc_sync_cpu_mask);
|
||||
}
|
||||
|
||||
srat_detect_node(cpu);
|
||||
|
||||
+1
-1
@@ -1573,7 +1573,7 @@ __initcall(disable_pit_irq);
|
||||
|
||||
void pit_broadcast_enter(void)
|
||||
{
|
||||
cpu_set(smp_processor_id(), pit_broadcast_mask);
|
||||
cpumask_set_cpu(smp_processor_id(), &pit_broadcast_mask);
|
||||
}
|
||||
|
||||
void pit_broadcast_exit(void)
|
||||
|
||||
@@ -253,7 +253,7 @@ static long cpupool_unassign_cpu_helper(void *info)
|
||||
|
||||
spin_lock(&cpupool_lock);
|
||||
ret = cpu_disable_scheduler(cpu);
|
||||
cpu_set(cpu, cpupool_free_cpus);
|
||||
cpumask_set_cpu(cpu, &cpupool_free_cpus);
|
||||
if ( !ret )
|
||||
{
|
||||
ret = schedule_cpu_switch(cpu, NULL);
|
||||
@@ -409,8 +409,8 @@ void cpupool_rm_domain(struct domain *d)
|
||||
static void cpupool_cpu_add(unsigned int cpu)
|
||||
{
|
||||
spin_lock(&cpupool_lock);
|
||||
cpu_clear(cpu, cpupool_locked_cpus);
|
||||
cpu_set(cpu, cpupool_free_cpus);
|
||||
cpumask_clear_cpu(cpu, &cpupool_locked_cpus);
|
||||
cpumask_set_cpu(cpu, &cpupool_free_cpus);
|
||||
cpupool_assign_cpu_locked(cpupool0, cpu);
|
||||
spin_unlock(&cpupool_lock);
|
||||
}
|
||||
@@ -428,7 +428,7 @@ static int cpupool_cpu_remove(unsigned int cpu)
|
||||
if ( !cpumask_test_cpu(cpu, cpupool0->cpu_valid))
|
||||
ret = -EBUSY;
|
||||
else
|
||||
cpu_set(cpu, cpupool_locked_cpus);
|
||||
cpumask_set_cpu(cpu, &cpupool_locked_cpus);
|
||||
spin_unlock(&cpupool_lock);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -1725,7 +1725,7 @@ csched_schedule(
|
||||
{
|
||||
/* Update the idle mask if necessary */
|
||||
if ( !cpumask_test_cpu(cpu, &rqd->idle) )
|
||||
cpu_set(cpu, rqd->idle);
|
||||
cpumask_set_cpu(cpu, &rqd->idle);
|
||||
/* Make sure avgload gets updated periodically even
|
||||
* if there's no activity */
|
||||
update_load(ops, rqd, NULL, 0, now);
|
||||
@@ -1860,7 +1860,7 @@ static void activate_runqueue(struct csched_private *prv, int rqi)
|
||||
INIT_LIST_HEAD(&rqd->runq);
|
||||
spin_lock_init(&rqd->lock);
|
||||
|
||||
cpu_set(rqi, prv->active_queues);
|
||||
cpumask_set_cpu(rqi, &prv->active_queues);
|
||||
}
|
||||
|
||||
static void deactivate_runqueue(struct csched_private *prv, int rqi)
|
||||
@@ -1927,12 +1927,12 @@ static void init_pcpu(const struct scheduler *ops, int cpu)
|
||||
/* Set the runqueue map */
|
||||
prv->runq_map[cpu]=rqi;
|
||||
|
||||
cpu_set(cpu, rqd->idle);
|
||||
cpu_set(cpu, rqd->active);
|
||||
cpumask_set_cpu(cpu, &rqd->idle);
|
||||
cpumask_set_cpu(cpu, &rqd->active);
|
||||
|
||||
spin_unlock(old_lock);
|
||||
|
||||
cpu_set(cpu, prv->initialized);
|
||||
cpumask_set_cpu(cpu, &prv->initialized);
|
||||
|
||||
spin_unlock_irqrestore(&prv->lock, flags);
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ static inline void per_cpu_scan_finalize(int min_cpus, int reserve_cpus)
|
||||
high_cpu = min(high_cpu + reserve_cpus, NR_CPUS);
|
||||
|
||||
for (cpu = low_cpu; cpu < high_cpu; cpu++) {
|
||||
cpu_set(cpu, early_cpu_possible_map);
|
||||
cpumask_set_cpu(cpu, &early_cpu_possible_map);
|
||||
if (node_cpuid[cpu].nid == NUMA_NO_NODE) {
|
||||
node_cpuid[cpu].nid = next_nid;
|
||||
next_nid++;
|
||||
|
||||
@@ -97,7 +97,6 @@ static inline unsigned int cpumask_check(unsigned int cpu)
|
||||
return cpu;
|
||||
}
|
||||
|
||||
#define cpu_set(cpu, dst) cpumask_set_cpu(cpu, &(dst))
|
||||
static inline void cpumask_set_cpu(int cpu, volatile cpumask_t *dstp)
|
||||
{
|
||||
set_bit(cpumask_check(cpu), dstp->bits);
|
||||
|
||||