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

From: Ravikiran G Thirumalai (kiran@in.ibm.com)
Date: Mon Jan 13 2003 - 07:33:23 EST


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];
         }
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jan 15 2003 - 22:00:45 EST