From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F57EC433E1 for ; Tue, 19 May 2020 16:55:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 508552075F for ; Tue, 19 May 2020 16:55:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dGgsCdTf"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="HJmvsN4I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 508552075F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tqC3kXjRd2r/P5x/oLFgf3f4fxDy3mzmA/XIoM3dPqQ=; b=dGgsCdTfyD0T/i 2iNWpdC9ZbS+qPSjsIk0AnGdk9NZijNkj7++eS8lUT0pL9/zCwkel+godcMqjne1ZdztQ5qLL5kFz C4CYjPJJb+V5WO9OB8k7t81MxBYNswzFczdq8wiw7PdzPa/R2C93crVFQqBHjM+A5j87sk/yP8KYn 9WpVXrsijGcAm8ToHEyFjuGfzY9iKO9zuxd1PVI/fa3QYPTtvUWeL5wXxUQNKb3H6VtQ+IWjc4yLl K80wpXIOHmARQ2ZpbtJSOYFfhQuDnZO8W3fuoGqzCWrFJvuC27Kpw26NtniOEKMFWA5zlQfIj+zF9 9C8yI1bdCS1I1aIgTtOw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jb5WF-0007g2-Ea; Tue, 19 May 2020 16:55:07 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jb5WB-0006U9-ER for linux-arm-kernel@lists.infradead.org; Tue, 19 May 2020 16:55:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2J7edtIKU9Kn/UNXC5anf0rrFGx9UjP8C0V9Udnrr8A=; b=HJmvsN4IScMzVOcw3aVvAMnB0 IBu629nlhZa44BnsNodzQoi1K+Ur4yZ4ww9q0lFfY6I7fU68iduc4SjqCGBNlg9jVqBwmoZfHEzL3 GKXMyHJBusT8zbaS8cQsBdSRbdi6golaW9wov0f7Vylrqce2wttp7AU17EMGybLx6Vo07BGtmi9H0 uD7hulluInw5e4v+WejFfZ/p8htbco0mVwkUGHa5qvsjJJRomNN6U1m3xeFQt5wG3goaicDCmoV4u yl5UXdgSaL1pGfL40CfZTSlxEMVqVe9eJTUibXlyeGaFNK1kYViDWSEdHpcQ/JobB2lpWwvciURKj g2jln2F0w==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:34260) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jb5Vw-0005vD-Hx; Tue, 19 May 2020 17:54:48 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jb5Vt-0005tH-KB; Tue, 19 May 2020 17:54:45 +0100 Date: Tue, 19 May 2020 17:54:45 +0100 From: Russell King - ARM Linux admin To: Arnd Bergmann Subject: Re: [PATCH 2/2] ARM: Allow either FLATMEM or SPARSEMEM on the multiplatform build Message-ID: <20200519165445.GI1551@shell.armlinux.org.uk> References: <20200506235009.25023-3-f.fainelli@gmail.com> <20200507072711.GB683243@linux.ibm.com> <20200518194533.GD1059226@linux.ibm.com> <20200519144306.GE1059226@linux.ibm.com> <20200519150452.GH1551@shell.armlinux.org.uk> <20200519152714.GF1059226@linux.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200519_095503_497501_071A43CB X-CRM114-Status: GOOD ( 23.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Doug Berger , Stephen Boyd , Kevin Cernekee , Mike Rapoport , Florian Fainelli , Gregory Fong , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 19, 2020 at 05:32:52PM +0200, Arnd Bergmann wrote: > On Tue, May 19, 2020 at 5:27 PM Mike Rapoport wrote: > > On Tue, May 19, 2020 at 04:04:52PM +0100, Russell King - ARM Linux admin wrote: > > > There are cases where the reason to use sparsemem is not an optional > > > one but is out of necessity - they require the page array to be split > > > up in order to boot successfully. > > > > > > With that in mind, flatmem becomes an "optimisation" over sparsemem. > > > > At the moment, there are three platforms that enable SPARSEMEM: ARCH_EP93XX, > > ARCH_RPC and ARCH_SA1100. All the rest have FLATMEM implcitly selected. > > > > I do not intend to change that, I am only going add an ability to select > > the memory model for ARCH_MULTIPLATFORM. > > > > I'll respin the series on the list before adding the patches to the > > patch system. > > I think we'll make EP93xx part of multiplatform at some point, IIRC > only the missing clock driver is stopping us at the moment, and I already > discussed with Linus Walleij how that can be done. > > My guess is that ep93xx is one platform on which sparsemem is > just an optimization to reduce the initial memory consumption, but > we should verify that when we get there. When you have a platform where the memory is segmented into separate blocks widely spaced, sparsemem is not an optimisation. For example, If you have four blocks spaced across 1GB, that requires about 256Ki struct page's. Assuming 32 byte struct page, that requires 8MiB of contiguous memory. If we also consider the other constraint - that the kernel has to fit in the first bank of memory, then, considering the size of the kernel (the first two are non-multiplatform kernels): text data bss dec hex filename 4045505 903700 92984 5042189 4cf00d n2100/boot/vmlinux-5.6.12+ 4045361 957276 1159052 6161689 5e0519 assabet/boot/vmlinux-5.2.0+ 6933363 1451420 203984 8588767 830ddf virt/boot/vmlinux-5.6.0+ 9980260 3568070 7403296 20951626 13fb24a multi/boot/vmlinux-5.3.0+ So, realistically, we're looking at imposing a requirement that the first bank of memory is no smaller than 16MB on these machines if a "default" flatmem multiplatform kernel is going to be able to boot, and if all banks are populated, that there is another bank that has at least 8MB to hold the memmap array. BTW, the "optimisation" argument for sparsemem doesn't actually hold. For flatmem, we free the unused parts of the memmap array, freeing those pages for other uses. Sparsemem on ARM is about allowing these platforms to boot with their memory spread across the physical address space savannah. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC for 0.8m (est. 1762m) line in suburbia: sync at 13.1Mbps down 424kbps up _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel