From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754462AbbIXLmd (ORCPT ); Thu, 24 Sep 2015 07:42:33 -0400 Received: from smtp-out6.electric.net ([192.162.217.195]:62794 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752819AbbIXLmc (ORCPT ); Thu, 24 Sep 2015 07:42:32 -0400 From: David Laight To: "'Christophe Leroy'" , Benjamin Herrenschmidt , Paul Mackerras , "Michael Ellerman" , "scottwood@freescale.com" CC: "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v2 08/25] powerpc/8xx: Map IMMR area with 512k page at a fixed address Thread-Topic: [PATCH v2 08/25] powerpc/8xx: Map IMMR area with 512k page at a fixed address Thread-Index: AQHQ9ViIWkdjaYZFDUelHW1RqGORq55Lj53g Date: Thu, 24 Sep 2015 11:41:25 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CBA15B8@AcuExch.aculab.com> References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id t8OBgb56022671 From: Christophe Leroy > Sent: 22 September 2015 17:51 ... > 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. Isn't this a more general problem? If there are multiple remap requests for the same physical page shouldn't the kernel be just increasing a reference count somewhere and returning address in the same virtual page? This should probably happen regardless of the address. I presume it must be done for cacheable mappings. Whether things like the IMMR should be mapped with a larger TLB is a separate matter. David {.n++%ݶw{.n+{G{ayʇڙ,jfhz_(階ݢj"mG?&~iOzv^m ?I