public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ravikiran G Thirumalai <kiran@in.ibm.com>
To: Andrew Morton <akpm@digeo.com>
Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: [patch] Make prof_counter use per-cpu areas patch 4/4 -- sparc arch
Date: Mon, 13 Jan 2003 18:08:25 +0530	[thread overview]
Message-ID: <20030113123825.GF2714@in.ibm.com> (raw)
In-Reply-To: <20030113122835.GC2714@in.ibm.com>

This one's for sparc


diff -ruN -X dontdiff linux-2.5.55/arch/sparc/kernel/smp.c prof_counter-2.5.55/arch/sparc/kernel/smp.c
--- linux-2.5.55/arch/sparc/kernel/smp.c	Thu Jan  9 09:33:58 2003
+++ prof_counter-2.5.55/arch/sparc/kernel/smp.c	Mon Jan 13 14:35:15 2003
@@ -256,7 +256,7 @@
 }
 
 unsigned int prof_multiplier[NR_CPUS];
-unsigned int prof_counter[NR_CPUS];
+DEFINE_PER_CPU(unsigned int, prof_counter);
 extern unsigned int lvl14_resolution;
 
 int setup_profiling_timer(unsigned int multiplier)
diff -ruN -X dontdiff linux-2.5.55/arch/sparc/kernel/sun4d_smp.c prof_counter-2.5.55/arch/sparc/kernel/sun4d_smp.c
--- linux-2.5.55/arch/sparc/kernel/sun4d_smp.c	Thu Jan  9 09:33:55 2003
+++ prof_counter-2.5.55/arch/sparc/kernel/sun4d_smp.c	Mon Jan 13 14:37:21 2003
@@ -431,7 +431,7 @@
 }
 
 extern unsigned int prof_multiplier[NR_CPUS];
-extern unsigned int prof_counter[NR_CPUS];
+DECLARE_PER_CPU(unsigned int, prof_counter);
 
 extern void sparc_do_profile(unsigned long pc, unsigned long o7);
 
@@ -455,14 +455,14 @@
 	if(!user_mode(regs))
 		sparc_do_profile(regs->pc, regs->u_regs[UREG_RETPC]);
 
-	if(!--prof_counter[cpu]) {
+	if(!--per_cpu(prof_counter, cpu)) {
 		int user = user_mode(regs);
 
 		irq_enter();
 		update_process_times(user);
 		irq_exit();
 
-		prof_counter[cpu] = prof_multiplier[cpu];
+		per_cpu(prof_counter, cpu) = prof_multiplier[cpu];
 	}
 }
 
@@ -472,7 +472,7 @@
 {
 	int cpu = hard_smp4d_processor_id();
 
-	prof_counter[cpu] = prof_multiplier[cpu] = 1;
+	per_cpu(prof_counter, cpu) = prof_multiplier[cpu] = 1;
 	load_profile_irq(cpu, lvl14_resolution);
 }
 

  parent reply	other threads:[~2003-01-13 12:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-13 12:28 [patch] Make prof_counter use per-cpu areas patch 1/4 -- x86 arch Ravikiran G Thirumalai
2003-01-13 12:33 ` [patch] Make prof_counter use per-cpu areas patch 2/4 -- ppc arch Ravikiran G Thirumalai
2003-01-14  2:21   ` Paul Mackerras
2003-01-13 12:36 ` [patch] Make prof_counter use per-cpu areas patch 3/4 -- x86_64 arch Ravikiran G Thirumalai
     [not found]   ` <20030113152110.GA19931@wotan.suse.de>
2003-01-16 12:17     ` Ravikiran G Thirumalai
2003-01-13 12:38 ` Ravikiran G Thirumalai [this message]
2003-01-13 16:49   ` [patch] Make prof_counter use per-cpu areas patch 4/4 -- sparc arch Pete Zaitcev
2003-01-14 11:46     ` David S. Miller
2003-01-13 20:10 ` [patch] Make prof_counter use per-cpu areas patch 1/4 -- x86 arch Andrew Morton
2003-01-16 12:06   ` Ravikiran G Thirumalai
2003-01-16 20:18     ` Andrew Morton

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=20030113123825.GF2714@in.ibm.com \
    --to=kiran@in.ibm.com \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sparclinux@vger.kernel.org \
    /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