From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 20 Dec 2013 00:08:19 +0100 (CET) Received: from mail-ig0-f170.google.com ([209.85.213.170]:46442 "EHLO mail-ig0-f170.google.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S6867279Ab3LSXIQdwHZw (ORCPT ); Fri, 20 Dec 2013 00:08:16 +0100 Received: by mail-ig0-f170.google.com with SMTP id k19so13302001igc.1 for ; Thu, 19 Dec 2013 15:08:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=FjFuCrSroMnyLR+Rkzk9L/pg5HnmU99Ve6DE3BRYhzo=; b=xSmDbMY9804sLTUwzT3D64Qlkx9PhbNIoaWWjO2AXtNbsIF5Dz8IMfpuuIr1mpb7ZN 8JldL2Zb5yDaNn5FOwcxqEkDhL9fkySirg0dD1qk9AC+63Qh/xK2owUPisMjhivP4Yoq GkZAj1jFQhNIyk1r1nb89xznLaN2mLMu3lbwnjHQEIAt2xDOQ31M9NuwP1f+Jdgy3CR7 EJdvqSxmya9LiqoRAl6YylzCBpBm02vmUB/SPx9Ps8kmrr6ofM1a5+HFf/LW712Cmz1Q CoKX8Qij9tAPdJQRFGEdYnNemGM288H0JMNNfi05dAdBMqFfzS6Y6oyHYzJHIxSLE6AK F+1A== X-Received: by 10.42.84.130 with SMTP id m2mr3166227icl.16.1387494489800; Thu, 19 Dec 2013 15:08:09 -0800 (PST) Received: from dl.caveonetworks.com (64.2.3.195.ptr.us.xo.net. [64.2.3.195]) by mx.google.com with ESMTPSA id y10sm9373479igl.4.2013.12.19.15.08.07 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Dec 2013 15:08:08 -0800 (PST) Message-ID: <52B37C56.7090302@gmail.com> Date: Thu, 19 Dec 2013 15:08:06 -0800 From: David Daney User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Christoph Lameter , Ralf Baechle , linux-mips CC: Tejun Heo , akpm@linuxfoundation.org, rostedt@goodmis.org, linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Thomas Gleixner Subject: Re: [PATCH 29/40] mips: Replace __get_cpu_var uses References: <20131219155015.443763038@linux.com> <20131219155033.834416420@linux.com> <52B330F3.4090603@gmail.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------070507070702050801040409" Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 38766 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: ddaney.cavm@gmail.com Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips This is a multi-part message in MIME format. --------------070507070702050801040409 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 12/19/2013 01:10 PM, Christoph Lameter wrote: > On Thu, 19 Dec 2013, David Daney wrote: > >>> 16:07:58.244398747 -0600 >>> @@ -43,7 +43,7 @@ DECLARE_PER_CPU(struct mips_fpu_emulator >>> #define MIPS_FPU_EMU_INC_STATS(M) \ >>> do { >>> \ >>> preempt_disable(); \ >>> - __local_inc(&__get_cpu_var(fpuemustats).M); \ >>> + __this_cpu_inc(fpuemustats.M); \ >>> preempt_enable(); \ >>> } while (0) >>> >> >> Something seems to be incorrect in this bit. > > Hrmm.. yes this is a local_t so the this_cpu_inc would not work unless > fpuemustats is defined differently. > See the attached patch. Feel free to include it as part of your patch set. I tested it on a 64-bit OCTEON system. I think it will work on 32-bit systems as well. > Use > > __local_inc(this_cpu_ptr(fpuemustats.M); > No, I couldn't get various incantations of that to work either. > instead until then. > --------------070507070702050801040409 Content-Type: text/x-patch; name="0001-MIPS-Replace-__get_cpu_var-uses-in-FPU-emulator.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-MIPS-Replace-__get_cpu_var-uses-in-FPU-emulator.patch" From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756601Ab3LSXIN (ORCPT ); Thu, 19 Dec 2013 18:08:13 -0500 Received: from mail-ie0-f169.google.com ([209.85.223.169]:41892 "EHLO mail-ie0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755875Ab3LSXIM (ORCPT ); Thu, 19 Dec 2013 18:08:12 -0500 Message-ID: <52B37C56.7090302@gmail.com> Date: Thu, 19 Dec 2013 15:08:06 -0800 From: David Daney User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Christoph Lameter , Ralf Baechle , linux-mips CC: Tejun Heo , akpm@linuxfoundation.org, rostedt@goodmis.org, linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Thomas Gleixner Subject: Re: [PATCH 29/40] mips: Replace __get_cpu_var uses References: <20131219155015.443763038@linux.com> <20131219155033.834416420@linux.com> <52B330F3.4090603@gmail.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------070507070702050801040409" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------070507070702050801040409 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 12/19/2013 01:10 PM, Christoph Lameter wrote: > On Thu, 19 Dec 2013, David Daney wrote: > >>> 16:07:58.244398747 -0600 >>> @@ -43,7 +43,7 @@ DECLARE_PER_CPU(struct mips_fpu_emulator >>> #define MIPS_FPU_EMU_INC_STATS(M) \ >>> do { >>> \ >>> preempt_disable(); \ >>> - __local_inc(&__get_cpu_var(fpuemustats).M); \ >>> + __this_cpu_inc(fpuemustats.M); \ >>> preempt_enable(); \ >>> } while (0) >>> >> >> Something seems to be incorrect in this bit. > > Hrmm.. yes this is a local_t so the this_cpu_inc would not work unless > fpuemustats is defined differently. > See the attached patch. Feel free to include it as part of your patch set. I tested it on a 64-bit OCTEON system. I think it will work on 32-bit systems as well. > Use > > __local_inc(this_cpu_ptr(fpuemustats.M); > No, I couldn't get various incantations of that to work either. > instead until then. > --------------070507070702050801040409 Content-Type: text/x-patch; name="0001-MIPS-Replace-__get_cpu_var-uses-in-FPU-emulator.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-MIPS-Replace-__get_cpu_var-uses-in-FPU-emulator.patch" >>From cc9590cf4d75cf7fd36a58be132d35fbbe536a64 Mon Sep 17 00:00:00 2001 From: David Daney Date: Thu, 19 Dec 2013 14:00:17 -0800 Subject: [PATCH] MIPS: Replace __get_cpu_var uses in FPU emulator. The use of __this_cpu_inc() requires a fundamental integer type, so change the type of all the counters to unsigned long, which is the same width they were before, but not wrapped in local_t. Signed-off-by: David Daney --- arch/mips/include/asm/fpu_emulator.h | 14 +++++++------- arch/mips/math-emu/cp1emu.c | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/mips/include/asm/fpu_emulator.h b/arch/mips/include/asm/fpu_emulator.h index 2abb587..619fa5f 100644 --- a/arch/mips/include/asm/fpu_emulator.h +++ b/arch/mips/include/asm/fpu_emulator.h @@ -30,12 +30,12 @@ #ifdef CONFIG_DEBUG_FS struct mips_fpu_emulator_stats { - local_t emulated; - local_t loads; - local_t stores; - local_t cp1ops; - local_t cp1xops; - local_t errors; + unsigned long emulated; + unsigned long loads; + unsigned long stores; + unsigned long cp1ops; + unsigned long cp1xops; + unsigned long errors; }; DECLARE_PER_CPU(struct mips_fpu_emulator_stats, fpuemustats); @@ -43,7 +43,7 @@ DECLARE_PER_CPU(struct mips_fpu_emulator_stats, fpuemustats); #define MIPS_FPU_EMU_INC_STATS(M) \ do { \ preempt_disable(); \ - __local_inc(&__get_cpu_var(fpuemustats).M); \ + __this_cpu_inc(fpuemustats.M); \ preempt_enable(); \ } while (0) diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c index efe0088..b853d05 100644 --- a/arch/mips/math-emu/cp1emu.c +++ b/arch/mips/math-emu/cp1emu.c @@ -2110,13 +2110,13 @@ int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx, static int fpuemu_stat_get(void *data, u64 *val) { int cpu; - unsigned long sum = 0; + u64 sum = 0; for_each_online_cpu(cpu) { struct mips_fpu_emulator_stats *ps; - local_t *pv; + unsigned long *pv; ps = &per_cpu(fpuemustats, cpu); pv = (void *)ps + (unsigned long)data; - sum += local_read(pv); + sum += *pv; } *val = sum; return 0; -- 1.7.11.7 --------------070507070702050801040409--