From patchwork Wed Jan 13 22:04:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 42838 X-Patchwork-Delegate: benh@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 08761B7F22 for ; Thu, 14 Jan 2010 09:05:18 +1100 (EST) Received: by ozlabs.org (Postfix) id CCAC5B7C9C; Thu, 14 Jan 2010 09:05:11 +1100 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: by ozlabs.org (Postfix, from userid 1010) id CB087B7CA0; Thu, 14 Jan 2010 09:05:11 +1100 (EST) Date: Thu, 14 Jan 2010 09:04:11 +1100 From: Anton Blanchard To: benh@kernel.crashing.org Subject: [PATCH] powerpc: Replace per_cpu(, smp_processor_id()) with __get_cpu_var() Message-ID: <20100113220410.GM12666@kryten> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Cc: linuxppc-dev@ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org The cputime code has a few places that do per_cpu(, smp_processor_id()). Replace them with __get_cpu_var(). Signed-off-by: Anton Blanchard Index: linux-cpumask/arch/powerpc/include/asm/cputime.h =================================================================== --- linux-cpumask.orig/arch/powerpc/include/asm/cputime.h 2010-01-13 08:57:32.634007010 +1100 +++ linux-cpumask/arch/powerpc/include/asm/cputime.h 2010-01-13 08:58:45.265253809 +1100 @@ -73,10 +73,9 @@ static inline unsigned long cputime_to_j static inline cputime_t cputime_to_scaled(const cputime_t ct) { if (cpu_has_feature(CPU_FTR_SPURR) && - per_cpu(cputime_last_delta, smp_processor_id())) - return ct * - per_cpu(cputime_scaled_last_delta, smp_processor_id())/ - per_cpu(cputime_last_delta, smp_processor_id()); + __get_cpu_var(cputime_last_delta)) + return ct * __get_cpu_var(cputime_scaled_last_delta) / + __get_cpu_var(cputime_last_delta); return ct; } Index: linux-cpumask/arch/powerpc/kernel/time.c =================================================================== --- linux-cpumask.orig/arch/powerpc/kernel/time.c 2010-01-13 08:57:32.714003980 +1100 +++ linux-cpumask/arch/powerpc/kernel/time.c 2010-01-13 08:58:45.265253809 +1100 @@ -265,8 +265,8 @@ void account_system_vtime(struct task_st account_system_time(tsk, 0, delta, deltascaled); else account_idle_time(delta); - per_cpu(cputime_last_delta, smp_processor_id()) = delta; - per_cpu(cputime_scaled_last_delta, smp_processor_id()) = deltascaled; + __get_cpu_var(cputime_last_delta) = delta; + __get_cpu_var(cputime_scaled_last_delta) = deltascaled; local_irq_restore(flags); } EXPORT_SYMBOL_GPL(account_system_vtime);