Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756073Ab2BGRmn (ORCPT ); Tue, 7 Feb 2012 12:42:43 -0500 Received: from wolverine01.qualcomm.com ([199.106.114.254]:58748 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754563Ab2BGRml (ORCPT ); Tue, 7 Feb 2012 12:42:41 -0500 X-IronPort-AV: E=McAfee;i="5400,1158,6613"; a="161234633" Message-ID: <4F31628E.3030006@codeaurora.org> Date: Tue, 07 Feb 2012 09:42:38 -0800 From: Stephen Boyd User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Thunderbird/3.1.16 MIME-Version: 1.0 To: Saravana Kannan CC: Russell King - ARM Linux , Nicolas Pitre , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Catalin Marinas Subject: Re: [PATCH] ARM: cache-v7: Disable preemption when reading CCSIDR References: <1328210686-15909-1-git-send-email-sboyd@codeaurora.org> <20120202204411.GB14129@n2100.arm.linux.org.uk> <4F2B1E11.1040000@codeaurora.org> <20120203003633.GD14129@n2100.arm.linux.org.uk> <4F309BAE.8000608@codeaurora.org> In-Reply-To: <4F309BAE.8000608@codeaurora.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3179 Lines: 75 On 02/06/12 19:34, Saravana Kannan wrote: > On 02/02/2012 04:36 PM, Russell King - ARM Linux wrote: >> On Thu, Feb 02, 2012 at 03:36:49PM -0800, Stephen Boyd wrote: >>> On 02/02/12 13:38, Nicolas Pitre wrote: >>>> On Thu, 2 Feb 2012, Russell King - ARM Linux wrote >>>>> On Thu, Feb 02, 2012 at 11:24:46AM -0800, Stephen Boyd wrote: >>>>>> Should we move get_thread_info into assembler.h? It seems odd >>>>>> to include entry-header.S but I saw that vfp was doing the same. >>>>> Probably yes, and probably also have preempt_disable and >>>>> preempt_enable >>>>> assembler macros. That's going to get rather icky if we have to >>>>> explicitly call the scheduler though (to solve (1)). >>>> What about a pair of helpers written in C instead? >>>> >>>> v7_flush_dcache_all() could be renamed, and a wrapper function called >>>> v7_flush_dcache_all() would call the preemption disable helper, >>>> call the >>>> former v7_flush_dcache_all code, then call the preemption enable >>>> helper. >>>> >>>> Then __v7_setup() could still call the core cache flush code without >>>> issues. >>> >>> I tried to put the preemption disable/enable right around the place >>> where it was needed. With this approach we would disable preemption >>> during the entire cache flush. I'm not sure if we want to make this >>> function worse for performance, do we? It certainly sounds easier than >>> writing all the preempt macros in assembly though. >> >> Err, why do you think it's a big task? >> >> preempt disable is a case of incrementing the thread preempt count, >> while >> preempt enable is a case of decrementing it, testing for zero, if zero, >> then checking whether TIF_NEED_RESCHED is set and calling a function. >> >> If that's too much, then the simple method in assembly to quickly >> disable >> preemption over a very few set of instructions is using mrs/msr and >> cpsid i. >> That'll be far cheaper than fiddling about with preempt counters or >> messing about with veneers in C code. > > Russell, > > I think you misunderstood Stephen's point about the performance. He > isn't referring to the performance difference between a C call to > preemt disable/enable vs. a few assembly level instructions. > > I believe he is referring to the performance hit of having preemption > disabled during the entirety of the cache flush operation vs. having > preemption disabled only for the duration of writing to CSSELR and > reading back CCSIDR. > > I would think a cache flush is a fairly long operation and to have > preemption disable across it doesn't sound appealing to me. > > Thoughts? > Sorry I messed up the headers for v2 of the patch. It didn't get sent to the msm list. Anyway, disabling interrupts for those few instructions sounds like the best approach and so I sent that out in v2. -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. -- 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/