x86: use performance variant for_each_cpu_mask_nr
Change references from for_each_cpu_mask to for_each_cpu_mask_nr where appropriate Reviewed-by: Paul Jackson <pj@sgi.com> Reviewed-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> commit 2d474871e2fb092eb46a0930aba5442e10eb96cc Author: Mike Travis <travis@sgi.com> Date: Mon May 12 21:21:13 2008 +0200
This commit is contained in:
committed by
Thomas Gleixner
parent
0e12f848b3
commit
334ef7a7ab
@@ -202,7 +202,7 @@ static void drv_write(struct drv_cmd *cmd)
|
|||||||
cpumask_t saved_mask = current->cpus_allowed;
|
cpumask_t saved_mask = current->cpus_allowed;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
for_each_cpu_mask(i, cmd->mask) {
|
for_each_cpu_mask_nr(i, cmd->mask) {
|
||||||
set_cpus_allowed_ptr(current, &cpumask_of_cpu(i));
|
set_cpus_allowed_ptr(current, &cpumask_of_cpu(i));
|
||||||
do_drv_write(cmd);
|
do_drv_write(cmd);
|
||||||
}
|
}
|
||||||
@@ -451,7 +451,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
|
|||||||
|
|
||||||
freqs.old = perf->states[perf->state].core_frequency * 1000;
|
freqs.old = perf->states[perf->state].core_frequency * 1000;
|
||||||
freqs.new = data->freq_table[next_state].frequency;
|
freqs.new = data->freq_table[next_state].frequency;
|
||||||
for_each_cpu_mask(i, cmd.mask) {
|
for_each_cpu_mask_nr(i, cmd.mask) {
|
||||||
freqs.cpu = i;
|
freqs.cpu = i;
|
||||||
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
||||||
}
|
}
|
||||||
@@ -466,7 +466,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for_each_cpu_mask(i, cmd.mask) {
|
for_each_cpu_mask_nr(i, cmd.mask) {
|
||||||
freqs.cpu = i;
|
freqs.cpu = i;
|
||||||
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||||
}
|
}
|
||||||
|
@@ -122,7 +122,7 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* notifiers */
|
/* notifiers */
|
||||||
for_each_cpu_mask(i, policy->cpus) {
|
for_each_cpu_mask_nr(i, policy->cpus) {
|
||||||
freqs.cpu = i;
|
freqs.cpu = i;
|
||||||
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
||||||
}
|
}
|
||||||
@@ -130,11 +130,11 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy,
|
|||||||
/* run on each logical CPU, see section 13.15.3 of IA32 Intel Architecture Software
|
/* run on each logical CPU, see section 13.15.3 of IA32 Intel Architecture Software
|
||||||
* Developer's Manual, Volume 3
|
* Developer's Manual, Volume 3
|
||||||
*/
|
*/
|
||||||
for_each_cpu_mask(i, policy->cpus)
|
for_each_cpu_mask_nr(i, policy->cpus)
|
||||||
cpufreq_p4_setdc(i, p4clockmod_table[newstate].index);
|
cpufreq_p4_setdc(i, p4clockmod_table[newstate].index);
|
||||||
|
|
||||||
/* notifiers */
|
/* notifiers */
|
||||||
for_each_cpu_mask(i, policy->cpus) {
|
for_each_cpu_mask_nr(i, policy->cpus) {
|
||||||
freqs.cpu = i;
|
freqs.cpu = i;
|
||||||
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||||
}
|
}
|
||||||
|
@@ -966,7 +966,7 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data, unsigned i
|
|||||||
freqs.old = find_khz_freq_from_fid(data->currfid);
|
freqs.old = find_khz_freq_from_fid(data->currfid);
|
||||||
freqs.new = find_khz_freq_from_fid(fid);
|
freqs.new = find_khz_freq_from_fid(fid);
|
||||||
|
|
||||||
for_each_cpu_mask(i, *(data->available_cores)) {
|
for_each_cpu_mask_nr(i, *(data->available_cores)) {
|
||||||
freqs.cpu = i;
|
freqs.cpu = i;
|
||||||
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
||||||
}
|
}
|
||||||
@@ -974,7 +974,7 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data, unsigned i
|
|||||||
res = transition_fid_vid(data, fid, vid);
|
res = transition_fid_vid(data, fid, vid);
|
||||||
freqs.new = find_khz_freq_from_fid(data->currfid);
|
freqs.new = find_khz_freq_from_fid(data->currfid);
|
||||||
|
|
||||||
for_each_cpu_mask(i, *(data->available_cores)) {
|
for_each_cpu_mask_nr(i, *(data->available_cores)) {
|
||||||
freqs.cpu = i;
|
freqs.cpu = i;
|
||||||
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||||
}
|
}
|
||||||
@@ -997,7 +997,7 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i
|
|||||||
freqs.old = find_khz_freq_from_pstate(data->powernow_table, data->currpstate);
|
freqs.old = find_khz_freq_from_pstate(data->powernow_table, data->currpstate);
|
||||||
freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);
|
freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);
|
||||||
|
|
||||||
for_each_cpu_mask(i, *(data->available_cores)) {
|
for_each_cpu_mask_nr(i, *(data->available_cores)) {
|
||||||
freqs.cpu = i;
|
freqs.cpu = i;
|
||||||
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
||||||
}
|
}
|
||||||
@@ -1005,7 +1005,7 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i
|
|||||||
res = transition_pstate(data, pstate);
|
res = transition_pstate(data, pstate);
|
||||||
freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);
|
freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);
|
||||||
|
|
||||||
for_each_cpu_mask(i, *(data->available_cores)) {
|
for_each_cpu_mask_nr(i, *(data->available_cores)) {
|
||||||
freqs.cpu = i;
|
freqs.cpu = i;
|
||||||
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||||
}
|
}
|
||||||
|
@@ -476,7 +476,7 @@ static int centrino_target (struct cpufreq_policy *policy,
|
|||||||
saved_mask = current->cpus_allowed;
|
saved_mask = current->cpus_allowed;
|
||||||
first_cpu = 1;
|
first_cpu = 1;
|
||||||
cpus_clear(covered_cpus);
|
cpus_clear(covered_cpus);
|
||||||
for_each_cpu_mask(j, online_policy_cpus) {
|
for_each_cpu_mask_nr(j, online_policy_cpus) {
|
||||||
/*
|
/*
|
||||||
* Support for SMP systems.
|
* Support for SMP systems.
|
||||||
* Make sure we are running on CPU that wants to change freq
|
* Make sure we are running on CPU that wants to change freq
|
||||||
@@ -517,7 +517,7 @@ static int centrino_target (struct cpufreq_policy *policy,
|
|||||||
dprintk("target=%dkHz old=%d new=%d msr=%04x\n",
|
dprintk("target=%dkHz old=%d new=%d msr=%04x\n",
|
||||||
target_freq, freqs.old, freqs.new, msr);
|
target_freq, freqs.old, freqs.new, msr);
|
||||||
|
|
||||||
for_each_cpu_mask(k, online_policy_cpus) {
|
for_each_cpu_mask_nr(k, online_policy_cpus) {
|
||||||
freqs.cpu = k;
|
freqs.cpu = k;
|
||||||
cpufreq_notify_transition(&freqs,
|
cpufreq_notify_transition(&freqs,
|
||||||
CPUFREQ_PRECHANGE);
|
CPUFREQ_PRECHANGE);
|
||||||
@@ -540,7 +540,7 @@ static int centrino_target (struct cpufreq_policy *policy,
|
|||||||
preempt_enable();
|
preempt_enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
for_each_cpu_mask(k, online_policy_cpus) {
|
for_each_cpu_mask_nr(k, online_policy_cpus) {
|
||||||
freqs.cpu = k;
|
freqs.cpu = k;
|
||||||
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||||
}
|
}
|
||||||
@@ -554,7 +554,7 @@ static int centrino_target (struct cpufreq_policy *policy,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (!cpus_empty(covered_cpus)) {
|
if (!cpus_empty(covered_cpus)) {
|
||||||
for_each_cpu_mask(j, covered_cpus) {
|
for_each_cpu_mask_nr(j, covered_cpus) {
|
||||||
set_cpus_allowed_ptr(current,
|
set_cpus_allowed_ptr(current,
|
||||||
&cpumask_of_cpu(j));
|
&cpumask_of_cpu(j));
|
||||||
wrmsr(MSR_IA32_PERF_CTL, oldmsr, h);
|
wrmsr(MSR_IA32_PERF_CTL, oldmsr, h);
|
||||||
@@ -564,7 +564,7 @@ static int centrino_target (struct cpufreq_policy *policy,
|
|||||||
tmp = freqs.new;
|
tmp = freqs.new;
|
||||||
freqs.new = freqs.old;
|
freqs.new = freqs.old;
|
||||||
freqs.old = tmp;
|
freqs.old = tmp;
|
||||||
for_each_cpu_mask(j, online_policy_cpus) {
|
for_each_cpu_mask_nr(j, online_policy_cpus) {
|
||||||
freqs.cpu = j;
|
freqs.cpu = j;
|
||||||
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
||||||
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||||
|
@@ -279,7 +279,7 @@ static int speedstep_target (struct cpufreq_policy *policy,
|
|||||||
|
|
||||||
cpus_allowed = current->cpus_allowed;
|
cpus_allowed = current->cpus_allowed;
|
||||||
|
|
||||||
for_each_cpu_mask(i, policy->cpus) {
|
for_each_cpu_mask_nr(i, policy->cpus) {
|
||||||
freqs.cpu = i;
|
freqs.cpu = i;
|
||||||
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
||||||
}
|
}
|
||||||
@@ -292,7 +292,7 @@ static int speedstep_target (struct cpufreq_policy *policy,
|
|||||||
/* allow to be run on all CPUs */
|
/* allow to be run on all CPUs */
|
||||||
set_cpus_allowed_ptr(current, &cpus_allowed);
|
set_cpus_allowed_ptr(current, &cpus_allowed);
|
||||||
|
|
||||||
for_each_cpu_mask(i, policy->cpus) {
|
for_each_cpu_mask_nr(i, policy->cpus) {
|
||||||
freqs.cpu = i;
|
freqs.cpu = i;
|
||||||
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||||
}
|
}
|
||||||
|
@@ -488,7 +488,7 @@ static void __cpuinit cache_remove_shared_cpu_map(unsigned int cpu, int index)
|
|||||||
int sibling;
|
int sibling;
|
||||||
|
|
||||||
this_leaf = CPUID4_INFO_IDX(cpu, index);
|
this_leaf = CPUID4_INFO_IDX(cpu, index);
|
||||||
for_each_cpu_mask(sibling, this_leaf->shared_cpu_map) {
|
for_each_cpu_mask_nr(sibling, this_leaf->shared_cpu_map) {
|
||||||
sibling_leaf = CPUID4_INFO_IDX(sibling, index);
|
sibling_leaf = CPUID4_INFO_IDX(sibling, index);
|
||||||
cpu_clear(cpu, sibling_leaf->shared_cpu_map);
|
cpu_clear(cpu, sibling_leaf->shared_cpu_map);
|
||||||
}
|
}
|
||||||
|
@@ -527,7 +527,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
|
|||||||
if (err)
|
if (err)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
|
||||||
for_each_cpu_mask(i, b->cpus) {
|
for_each_cpu_mask_nr(i, b->cpus) {
|
||||||
if (i == cpu)
|
if (i == cpu)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -617,7 +617,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* remove all sibling symlinks before unregistering */
|
/* remove all sibling symlinks before unregistering */
|
||||||
for_each_cpu_mask(i, b->cpus) {
|
for_each_cpu_mask_nr(i, b->cpus) {
|
||||||
if (i == cpu)
|
if (i == cpu)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@@ -718,7 +718,7 @@ static int __assign_irq_vector(int irq, cpumask_t mask)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for_each_cpu_mask(cpu, mask) {
|
for_each_cpu_mask_nr(cpu, mask) {
|
||||||
cpumask_t domain, new_mask;
|
cpumask_t domain, new_mask;
|
||||||
int new_cpu;
|
int new_cpu;
|
||||||
int vector, offset;
|
int vector, offset;
|
||||||
@@ -739,7 +739,7 @@ next:
|
|||||||
continue;
|
continue;
|
||||||
if (vector == IA32_SYSCALL_VECTOR)
|
if (vector == IA32_SYSCALL_VECTOR)
|
||||||
goto next;
|
goto next;
|
||||||
for_each_cpu_mask(new_cpu, new_mask)
|
for_each_cpu_mask_nr(new_cpu, new_mask)
|
||||||
if (per_cpu(vector_irq, new_cpu)[vector] != -1)
|
if (per_cpu(vector_irq, new_cpu)[vector] != -1)
|
||||||
goto next;
|
goto next;
|
||||||
/* Found one! */
|
/* Found one! */
|
||||||
@@ -749,7 +749,7 @@ next:
|
|||||||
cfg->move_in_progress = 1;
|
cfg->move_in_progress = 1;
|
||||||
cfg->old_domain = cfg->domain;
|
cfg->old_domain = cfg->domain;
|
||||||
}
|
}
|
||||||
for_each_cpu_mask(new_cpu, new_mask)
|
for_each_cpu_mask_nr(new_cpu, new_mask)
|
||||||
per_cpu(vector_irq, new_cpu)[vector] = irq;
|
per_cpu(vector_irq, new_cpu)[vector] = irq;
|
||||||
cfg->vector = vector;
|
cfg->vector = vector;
|
||||||
cfg->domain = domain;
|
cfg->domain = domain;
|
||||||
@@ -781,7 +781,7 @@ static void __clear_irq_vector(int irq)
|
|||||||
|
|
||||||
vector = cfg->vector;
|
vector = cfg->vector;
|
||||||
cpus_and(mask, cfg->domain, cpu_online_map);
|
cpus_and(mask, cfg->domain, cpu_online_map);
|
||||||
for_each_cpu_mask(cpu, mask)
|
for_each_cpu_mask_nr(cpu, mask)
|
||||||
per_cpu(vector_irq, cpu)[vector] = -1;
|
per_cpu(vector_irq, cpu)[vector] = -1;
|
||||||
|
|
||||||
cfg->vector = 0;
|
cfg->vector = 0;
|
||||||
|
@@ -487,7 +487,7 @@ void __cpuinit set_cpu_sibling_map(int cpu)
|
|||||||
cpu_set(cpu, cpu_sibling_setup_map);
|
cpu_set(cpu, cpu_sibling_setup_map);
|
||||||
|
|
||||||
if (smp_num_siblings > 1) {
|
if (smp_num_siblings > 1) {
|
||||||
for_each_cpu_mask(i, cpu_sibling_setup_map) {
|
for_each_cpu_mask_nr(i, cpu_sibling_setup_map) {
|
||||||
if (c->phys_proc_id == cpu_data(i).phys_proc_id &&
|
if (c->phys_proc_id == cpu_data(i).phys_proc_id &&
|
||||||
c->cpu_core_id == cpu_data(i).cpu_core_id) {
|
c->cpu_core_id == cpu_data(i).cpu_core_id) {
|
||||||
cpu_set(i, per_cpu(cpu_sibling_map, cpu));
|
cpu_set(i, per_cpu(cpu_sibling_map, cpu));
|
||||||
@@ -510,7 +510,7 @@ void __cpuinit set_cpu_sibling_map(int cpu)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for_each_cpu_mask(i, cpu_sibling_setup_map) {
|
for_each_cpu_mask_nr(i, cpu_sibling_setup_map) {
|
||||||
if (per_cpu(cpu_llc_id, cpu) != BAD_APICID &&
|
if (per_cpu(cpu_llc_id, cpu) != BAD_APICID &&
|
||||||
per_cpu(cpu_llc_id, cpu) == per_cpu(cpu_llc_id, i)) {
|
per_cpu(cpu_llc_id, cpu) == per_cpu(cpu_llc_id, i)) {
|
||||||
cpu_set(i, c->llc_shared_map);
|
cpu_set(i, c->llc_shared_map);
|
||||||
@@ -1298,7 +1298,7 @@ static void remove_siblinginfo(int cpu)
|
|||||||
int sibling;
|
int sibling;
|
||||||
struct cpuinfo_x86 *c = &cpu_data(cpu);
|
struct cpuinfo_x86 *c = &cpu_data(cpu);
|
||||||
|
|
||||||
for_each_cpu_mask(sibling, per_cpu(cpu_core_map, cpu)) {
|
for_each_cpu_mask_nr(sibling, per_cpu(cpu_core_map, cpu)) {
|
||||||
cpu_clear(cpu, per_cpu(cpu_core_map, sibling));
|
cpu_clear(cpu, per_cpu(cpu_core_map, sibling));
|
||||||
/*/
|
/*/
|
||||||
* last thread sibling in this cpu core going down
|
* last thread sibling in this cpu core going down
|
||||||
@@ -1307,7 +1307,7 @@ static void remove_siblinginfo(int cpu)
|
|||||||
cpu_data(sibling).booted_cores--;
|
cpu_data(sibling).booted_cores--;
|
||||||
}
|
}
|
||||||
|
|
||||||
for_each_cpu_mask(sibling, per_cpu(cpu_sibling_map, cpu))
|
for_each_cpu_mask_nr(sibling, per_cpu(cpu_sibling_map, cpu))
|
||||||
cpu_clear(cpu, per_cpu(cpu_sibling_map, sibling));
|
cpu_clear(cpu, per_cpu(cpu_sibling_map, sibling));
|
||||||
cpus_clear(per_cpu(cpu_sibling_map, cpu));
|
cpus_clear(per_cpu(cpu_sibling_map, cpu));
|
||||||
cpus_clear(per_cpu(cpu_core_map, cpu));
|
cpus_clear(per_cpu(cpu_core_map, cpu));
|
||||||
|
@@ -345,7 +345,7 @@ static void xen_send_IPI_mask(cpumask_t mask, enum ipi_vector vector)
|
|||||||
|
|
||||||
cpus_and(mask, mask, cpu_online_map);
|
cpus_and(mask, mask, cpu_online_map);
|
||||||
|
|
||||||
for_each_cpu_mask(cpu, mask)
|
for_each_cpu_mask_nr(cpu, mask)
|
||||||
xen_send_IPI_one(cpu, vector);
|
xen_send_IPI_one(cpu, vector);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,7 +413,7 @@ int xen_smp_call_function_mask(cpumask_t mask, void (*func)(void *),
|
|||||||
|
|
||||||
/* Make sure other vcpus get a chance to run if they need to. */
|
/* Make sure other vcpus get a chance to run if they need to. */
|
||||||
yield = false;
|
yield = false;
|
||||||
for_each_cpu_mask(cpu, mask)
|
for_each_cpu_mask_nr(cpu, mask)
|
||||||
if (xen_vcpu_stolen(cpu))
|
if (xen_vcpu_stolen(cpu))
|
||||||
yield = true;
|
yield = true;
|
||||||
|
|
||||||
|
@@ -121,7 +121,7 @@ static inline void send_IPI_mask_sequence(cpumask_t mask, int vector)
|
|||||||
* - mbligh
|
* - mbligh
|
||||||
*/
|
*/
|
||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
for_each_cpu_mask(query_cpu, mask) {
|
for_each_cpu_mask_nr(query_cpu, mask) {
|
||||||
__send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, query_cpu),
|
__send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, query_cpu),
|
||||||
vector, APIC_DEST_PHYSICAL);
|
vector, APIC_DEST_PHYSICAL);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user