Re: [patch] Make prof_counter use per-cpu areas patch 2/4 -- ppc arch

Ravikiran G Thirumalai
2003-01-13T12:11:58Z

This one's for ppc.

diff -ruN -X dontdiff linux-2.5.55/arch/ppc/kernel/smp.c prof_counter-2.5.55/arch/ppc/kernel/smp.c
--- linux-2.5.55/arch/ppc/kernel/smp.c Thu Jan 9 09:34:25 2003
+++ prof_counter-2.5.55/arch/ppc/kernel/smp.c Mon Jan 13 14:20:04 2003
@@ -45,7 +45,7 @@
atomic_t ipi_recv;
atomic_t ipi_sent;
unsigned int prof_multiplier[NR_CPUS] = { [1 ... NR_CPUS-1] = 1 };
-unsigned int prof_counter[NR_CPUS] = { [1 ... NR_CPUS-1] = 1 };
+DEFINE_PER_CPU(unsigned int, prof_counter) = 1;
unsigned long cache_decay_ticks = HZ/100;
unsigned long cpu_online_map = 1UL;
unsigned long cpu_possible_map = 1UL;
@@ -90,9 +90,9 @@
{
int cpu = smp_processor_id();

- if (!--prof_counter[cpu]) {
+ if (!--per_cpu(prof_counter, cpu)) {
update_process_times(user_mode(regs));
- prof_counter[cpu]=prof_multiplier[cpu];
+ per_cpu(prof_counter, cpu)=prof_multiplier[cpu];
}
}