From patchwork Thu Jun 19 22:40:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaro Koskinen X-Patchwork-Id: 4386571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 860E39F314 for ; Thu, 19 Jun 2014 22:44:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AEC642039D for ; Thu, 19 Jun 2014 22:44:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8D491202EB for ; Thu, 19 Jun 2014 22:44:38 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wxl0X-0007dT-45; Thu, 19 Jun 2014 22:40:37 +0000 Received: from filtteri6.pp.htv.fi ([213.243.153.189]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wxl0U-0007Ub-Aw for linux-arm-kernel@lists.infradead.org; Thu, 19 Jun 2014 22:40:35 +0000 Received: from localhost (localhost [127.0.0.1]) by filtteri6.pp.htv.fi (Postfix) with ESMTP id 8132B56F9F8; Fri, 20 Jun 2014 01:40:11 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at pp.htv.fi Received: from smtp6.welho.com ([213.243.153.40]) by localhost (filtteri6.pp.htv.fi [213.243.153.189]) (amavisd-new, port 10024) with ESMTP id FmkO+1MpRzSX; Fri, 20 Jun 2014 01:40:05 +0300 (EEST) Received: from drone (91-145-91-118.bb.dnainternet.fi [91.145.91.118]) by smtp6.welho.com (Postfix) with ESMTP id E75015BC005; Fri, 20 Jun 2014 01:40:04 +0300 (EEST) Date: Fri, 20 Jun 2014 01:40:04 +0300 From: Aaro Koskinen To: Russell King - ARM Linux Subject: Re: v3.16-rc1 & default cachepolicy Message-ID: <20140619224004.GF558@drone.musicnaut.iki.fi> References: <20140619203655.GE558@drone.musicnaut.iki.fi> <20140619205853.GH3705@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140619205853.GH3705@n2100.arm.linux.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140619_154034_624236_0CEEEE8F X-CRM114-Status: GOOD ( 16.98 ) X-Spam-Score: 0.7 (/) Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, On Thu, Jun 19, 2014 at 09:58:53PM +0100, Russell King - ARM Linux wrote: > On Thu, Jun 19, 2014 at 11:36:55PM +0300, Aaro Koskinen wrote: > > When booting v3.16-rc1 on OMAP1, I noticed strange slowness. > > E.g. initramfs unpack takes several minutes. This was caused by default > > cachepolicy getting changed from writethrough -> uncached for some reason: > > > > [ 0.000000] Booting Linux on physical CPU 0x0 > > [ 0.000000] Initializing cgroup subsys cpu > > [ 0.000000] Linux version 3.16.0-rc1-e3-los_880e+ (aaro@cooljazz) (gcc version 4.9.0 (GCC) ) #1 PREEMPT Thu Jun 19 22:51:42 EEST 2014 > > [ 0.000000] CPU: ARM925T [54029252] revision 2 (ARMv4T), cr=0000317f > > [ 0.000000] CPU: VIVT data cache, VIVT instruction cache > > [ 0.000000] Machine: Amstrad E3 (Delta) > > [ 0.000000] Ignoring memory below PHYS_OFFSET: 0x02000000-0x10000000 > > [ 0.000000] bootconsole [earlycon0] enabled > > [ 0.000000] Memory policy: Data cache uncached > > [...] > > [ 4.602732] Unpacking initramfs... > > [ 425.125093] Freeing initrd memory: 3532K (c1c00000 - c1f73000) > > > > It seems this is caused by commit: > > > > commit ca8f0b0a545f55b3dc6877cda24d609a8979c951 > > Author: Russell King > > Date: Tue May 27 20:34:28 2014 +0100 > > > > ARM: ensure C page table setup code follows assembly code > > > > I can workaround this with "cachepolicy=writethrough" parameter. > > It brings up the question - proc-arm925.S contains: > > .long PMD_TYPE_SECT | \ > PMD_BIT4 | \ > PMD_SECT_AP_WRITE | \ > PMD_SECT_AP_READ > .long PMD_TYPE_SECT | \ > PMD_BIT4 | \ > PMD_SECT_AP_WRITE | \ > PMD_SECT_AP_READ > > In other words, it's telling the assembly code to setup uncached mappings > for everything, even memory. Most people want to set memory up (even at > the assembly code time) in cacheable mode... so I'd suggest adding: > > PMD_SECT_BUFFERABLE | \ > PMD_SECT_CACHEABLE | \ > > from the first. You'll find it in the .macro at the end of proc-arm925.S. > Please let me know if that works for you. So I tried the below change. But now it hangs early, even before the earlyprintk is working. :-/ A. diff --git a/arch/arm/mm/proc-arm925.S b/arch/arm/mm/proc-arm925.S index 97448c3..cb7c0e7 100644 --- a/arch/arm/mm/proc-arm925.S +++ b/arch/arm/mm/proc-arm925.S @@ -502,6 +502,8 @@ __\name\()_proc_info: .long \cpu_val .long \cpu_mask .long PMD_TYPE_SECT | \ + PMD_SECT_BUFFERABLE | \ + PMD_SECT_CACHEABLE | \ PMD_BIT4 | \ PMD_SECT_AP_WRITE | \ PMD_SECT_AP_READ