Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751504AbcCKXPw (ORCPT ); Fri, 11 Mar 2016 18:15:52 -0500 Received: from host.buserror.net ([209.198.135.123]:34288 "EHLO host.buserror.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750744AbcCKXPt (ORCPT ); Fri, 11 Mar 2016 18:15:49 -0500 Date: Fri, 11 Mar 2016 17:15:39 -0600 From: Scott Wood To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Message-ID: <20160311231539.GB30872@home.buserror.net> References: <469ed145e21be6720c186686039b569e30ca1ed4.1455032446.git.christophe.leroy@c-s.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <469ed145e21be6720c186686039b569e30ca1ed4.1455032446.git.christophe.leroy@c-s.fr> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 75.72.173.242 X-SA-Exim-Mail-From: oss@buserror.net X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -15 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Subject: Re: [v8, 08/23] powerpc/8xx: Map IMMR area with 512k page at a fixed address X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:57:07 +0000) X-SA-Exim-Scanned: Yes (on host.buserror.net) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1800 Lines: 40 On Tue, Feb 09, 2016 at 05:08:02PM +0100, Christophe Leroy wrote: > Once the linear memory space has been mapped with 8Mb pages, as > seen in the related commit, we get 11 millions DTLB missed during > the reference 600s period. 77% of the misses are on user addresses > and 23% are on kernel addresses (1 fourth for linear address space > and 3 fourth for virtual address space) > > Traditionaly, each driver manages one computer board which has its > own components with its own memory maps. > But on embedded chips like the MPC8xx, the SOC has all registers > located in the same IO area. > > When looking at ioremaps done during startup, we see that > many drivers are re-mapping small parts of the IMMR for their own use > and all those small pieces gets their own 4k page, amplifying the > number of TLB misses: in our system we get 0xff000000 mapped 31 times > and 0xff003000 mapped 9 times. > > Even if each part of IMMR was mapped only once with 4k pages, it would > still be several small mappings towards linear area. > > With the patch, on the same principle as what was done for the RAM, > the IMMR gets mapped by a 512k page. "the patch" -- this one, that below says it maps IMMR with other sizes? > > In 4k pages mode, we reserve a 4Mb area for mapping IMMR. The TLB > miss handler checks that we are within the first 512k and bail out > with page not marked valid if we are outside > > In 16k pages mode, it is not realistic to reserve a 64Mb area, so > we do a standard mapping of the 512k area using 32 pages of 16k. > The CPM will be mapped via the first two pages, and the SEC engine > will be mapped via the 16th and 17th pages. As the pages are marked > guarded, there will be no speculative accesses. If IMMR is 512k, why do you need to reserve 4M/64M for it? -Scott