linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@linux.ibm.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Doug Berger <opendmb@gmail.com>, Arnd Bergmann <arnd@arndb.de>,
	Stephen Boyd <sboyd@kernel.org>,
	Kevin Cernekee <cernekee@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Gregory Fong <gregory.0xf0@gmail.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/2] ARM: Allow either FLATMEM or SPARSEMEM on the multiplatform build
Date: Tue, 19 May 2020 20:59:44 +0300	[thread overview]
Message-ID: <20200519175944.GH1059226@linux.ibm.com> (raw)
In-Reply-To: <20200519165445.GI1551@shell.armlinux.org.uk>

Hi Russell,

On Tue, May 19, 2020 at 05:54:45PM +0100, Russell King - ARM Linux admin wrote:
> On Tue, May 19, 2020 at 05:32:52PM +0200, Arnd Bergmann wrote:
> > On Tue, May 19, 2020 at 5:27 PM Mike Rapoport <rppt@linux.ibm.com> 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.

There is no argument that sparsemem is more robust and flexible in its
ability to hande separated memory banks. And, AFAIU, nobody suggests to
start using flatmem instead of sparsemem on any machine.

Currently, when you build the kernel with "make defconfig && make" or
"make multi_X_defconfig && make" kconfig implicitly selects flatmem and
there is no possiblity to enable sparsemem in the menuconfig.

Florian sent the pathces with the purpose to allow overriding the
explict choise of flatmem with sparsemem in menuconfig.

At some point I've asked whether we would like to use sparsemem instead
of flatmem as the default for the multiplafrom build. The upside of such
change is the robustness you described above. The downside is a bit
larger kernel image and slight slow down in page_to_pfn and pfn_to_page.

That said we have two options:
* Massage the patches Florian sent and add ability to select memory
model in menuconfig for the multiplatform builds without changing
anything in configurations that were not manually atered.
* Simply add 'select ARCH_SPAPSEMEM_ENABLE' under 'ARCH_MULTIPLAFROM'
and force all multiplatform builds to use sparsemem.

So the question is what is the preferred way to move forward.

> -- 
> 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

-- 
Sincerely yours,
Mike.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-05-19 18:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06 23:50 [PATCH 0/2] Allow either FLATMEM or SPARSEMEM on the multiplatform build Florian Fainelli
2020-05-06 23:50 ` [PATCH 1/2] ARM: Remove redundant ARCH_SPARSEMEM_DEFAULT setting Florian Fainelli
2020-05-07  7:27   ` Mike Rapoport
2020-05-07 10:30   ` Russell King - ARM Linux admin
2020-05-07 17:25     ` Florian Fainelli
2020-05-07 18:50       ` Russell King - ARM Linux admin
2020-05-07 19:38         ` Florian Fainelli
2020-05-07 20:08     ` [PATCH] arm: use SPARSMEM_STATIC when SPARSEMEM is enabled (Was: [PATCH 1/2] ARM: Remove redundant ARCH_SPARSEMEM_DEFAULT setting) Mike Rapoport
2020-05-08 20:20       ` Florian Fainelli
2020-05-07 20:29     ` [PATCH 1/2] ARM: Remove redundant ARCH_SPARSEMEM_DEFAULT setting Mike Rapoport
2020-05-07 20:47       ` Florian Fainelli
2020-05-08 21:41         ` Mike Rapoport
2020-05-08 21:45           ` Florian Fainelli
2020-05-06 23:50 ` [PATCH 2/2] ARM: Allow either FLATMEM or SPARSEMEM on the multiplatform build Florian Fainelli
2020-05-07  7:27   ` Mike Rapoport
2020-05-07 20:11     ` Florian Fainelli
2020-05-18 15:58       ` Florian Fainelli
2020-05-18 19:45         ` Mike Rapoport
2020-05-19  7:59           ` Arnd Bergmann
2020-05-19 14:43             ` Mike Rapoport
2020-05-19 15:04               ` Russell King - ARM Linux admin
2020-05-19 15:27                 ` Mike Rapoport
2020-05-19 15:32                   ` Arnd Bergmann
2020-05-19 16:54                     ` Russell King - ARM Linux admin
2020-05-19 17:59                       ` Mike Rapoport [this message]
2020-05-19 20:42                       ` Arnd Bergmann
2020-05-21  2:45                         ` Florian Fainelli
2020-05-21  7:47                           ` Arnd Bergmann
2020-05-07  8:14 ` [PATCH 0/2] " Russell King - ARM Linux admin
2020-05-07 10:09   ` Mike Rapoport
  -- strict thread matches above, loose matches on Subject: below --
2020-05-21  8:18 [PATCH 0/2] ARM: " Mike Rapoport
2020-05-21  8:18 ` [PATCH 2/2] " Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200519175944.GH1059226@linux.ibm.com \
    --to=rppt@linux.ibm.com \
    --cc=arnd@arndb.de \
    --cc=cernekee@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregory.0xf0@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=opendmb@gmail.com \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).