From owner-freebsd-arm@FreeBSD.ORG Mon Feb 7 21:38:14 2011 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 684971065674 for ; Mon, 7 Feb 2011 21:38:14 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout021.mac.com (asmtpout021.mac.com [17.148.16.96]) by mx1.freebsd.org (Postfix) with ESMTP id 4E5158FC12 for ; Mon, 7 Feb 2011 21:38:14 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from sa-nc-common2-131.static.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp021.mac.com (Oracle Communications Messaging Exchange Server 7u4-20.01 64bit (built Nov 21 2010)) with ESMTPSA id <0LG9002O2LAMEJH0@asmtp021.mac.com> for freebsd-arm@freebsd.org; Mon, 07 Feb 2011 12:37:35 -0800 (PST) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2011-02-07_06:2011-02-07, 2011-02-07, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=2 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1012030000 definitions=main-1102070104 From: Marcel Moolenaar In-reply-to: <4D5050B3.4070608@gmail.com> Date: Mon, 07 Feb 2011 12:37:33 -0800 Message-id: <4A878FC3-C011-4E40-8B36-71E36B4C4A11@mac.com> References: <857AA8D9-5C41-4D80-A3B5-0D29BE051014@mac.com> <4D5050B3.4070608@gmail.com> To: Mark Tinguely X-Mailer: Apple Mail (2.1082) Cc: freebsd-arm@freebsd.org Subject: Re: Elimination of cpu_l2cache_* functions X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2011 21:38:14 -0000 On Feb 7, 2011, at 12:06 PM, Mark Tinguely wrote: > On 2/7/2011 12:43 PM, Marcel Moolenaar wrote: >> All, >> >> I've been reviewing the use of the cpu_l2cache_* functions and found >> that 1) they're missing from cpu_witch() and 2) they are always used >> in conjunction with either cpu_idcache_* or cpu_dcache_*. >> >> Since most CPU variants define them as null ops, isn't it better to >> incorporate the functionality of cpu_l2cache_* in cpu_idcache_* and >> cpu_dcache_* and eliminate them altogether? >> >> Any objections to me removing cpu_l2cache_* and therefore changing >> the semantics of cpu_idcache_* and cpu_dcahce_* to apply to all >> relevant cache levels? >> >> Thanks, > > It was pointed out to me that the level two cache operation were removed from the context switch on purpose, for performance reasons. I think this exception is why we still have both a level one and level two cache operation definitions. > > I proposed the senerio that the Sheeva cluster IO filesystem corruption problem is related to level two caches not being written back and removed upon context switch. Assuming we want to keep the performance gain by not performing the level two cache operations when we perform a context switch, and since I believe that the Sheeva has PIPT level two caches, I have a proposed fix to pmap_idcache_wdinv_range() that maps the page to a local KVA and doing the appropriate level two cache operation when needed. > --- > In ARMv6 and ARMv7, the inner (level one) caches are PIPT, and all these cache operations go away with the exception of the sync area of the busdma routine. Hi Mark, Yes, the L2 cache on the Sheeva is PIPT, and I think it's safe to remove the the L2 cache operations from the context switch. However, why do we have L2 cache operations everywhere else when we only need to worry about it for DMA and when synchronizing the I-cache in that case right? -- Marcel Moolenaar xcllnt@mac.com