From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751903AbaHQRbJ (ORCPT ); Sun, 17 Aug 2014 13:31:09 -0400 Received: from qmta11.emeryville.ca.mail.comcast.net ([76.96.27.211]:48101 "EHLO qmta11.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751368AbaHQRax (ORCPT ); Sun, 17 Aug 2014 13:30:53 -0400 Message-Id: <20140817173034.171175734@linux.com> Date: Sun, 17 Aug 2014 12:30:31 -0500 From: Christoph Lameter To: Tejun Heo Cc: akpm@linuxfoundation.org, rostedt@goodmis.org, linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Robert Richter , oprofile-list@lists.sf.net Subject: [PATCH 08/35] [PATCH 08/36] drivers/oprofile: Replace __get_cpu_var uses for address calculation References: <20140817173023.439660246@linux.com> Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline; filename=0008-drivers-oprofile-Replace-__get_cpu_var-uses-for-addr.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the uses of __get_cpu_var for address calculation with this_cpu_ptr. Cc: Robert Richter Cc: oprofile-list@lists.sf.net Signed-off-by: Christoph Lameter --- drivers/oprofile/cpu_buffer.c | 10 +++++----- drivers/oprofile/timer_int.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) Index: linux/drivers/oprofile/cpu_buffer.c =================================================================== --- linux.orig/drivers/oprofile/cpu_buffer.c +++ linux/drivers/oprofile/cpu_buffer.c @@ -45,7 +45,7 @@ unsigned long oprofile_get_cpu_buffer_si void oprofile_cpu_buffer_inc_smpl_lost(void) { - struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); + struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer); cpu_buf->sample_lost_overflow++; } @@ -297,7 +297,7 @@ __oprofile_add_ext_sample(unsigned long unsigned long event, int is_kernel, struct task_struct *task) { - struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); + struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer); unsigned long backtrace = oprofile_backtrace_depth; /* @@ -357,7 +357,7 @@ oprofile_write_reserve(struct op_entry * { struct op_sample *sample; int is_kernel = !user_mode(regs); - struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); + struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer); cpu_buf->sample_received++; @@ -412,13 +412,13 @@ int oprofile_write_commit(struct op_entr void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event) { - struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); + struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer); log_sample(cpu_buf, pc, 0, is_kernel, event, NULL); } void oprofile_add_trace(unsigned long pc) { - struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); + struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer); if (!cpu_buf->tracing) return; Index: linux/drivers/oprofile/timer_int.c =================================================================== --- linux.orig/drivers/oprofile/timer_int.c +++ linux/drivers/oprofile/timer_int.c @@ -32,7 +32,7 @@ static enum hrtimer_restart oprofile_hrt static void __oprofile_hrtimer_start(void *unused) { - struct hrtimer *hrtimer = &__get_cpu_var(oprofile_hrtimer); + struct hrtimer *hrtimer = this_cpu_ptr(&oprofile_hrtimer); if (!ctr_running) return;