linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	linux-pci <linux-pci@vger.kernel.org>
Subject: Re: [PATCH] PCI: dynamically map ECAM regions
Date: Thu, 13 May 2021 16:13:41 +0100	[thread overview]
Message-ID: <20210513151341.GZ1336@shell.armlinux.org.uk> (raw)
In-Reply-To: <CAK8P3a0TxtWn7Ua05=XsG5QK853C9SMDLdTOV_6rLB8cE49qXg@mail.gmail.com>

On Thu, May 13, 2021 at 05:02:32PM +0200, Arnd Bergmann wrote:
> On Thu, May 13, 2021 at 4:18 PM Russell King <rmk+kernel@armlinux.org.uk> wrote:
> >
> > Attempting to boot 32-bit ARM kernels under QEMU's 3.x virt models
> > fails when we have more than 512M of RAM in the model as we run out
> > of vmalloc space for the PCI ECAM regions. This failure will be
> > silent when running libvirt, as the console in that situation is a
> > PCI device.
> >
> > In this configuration, the kernel maps the whole ECAM, which QEMU
> > sets up for 256 buses, even when maybe only seven buses are in use.
> > Each bus uses 1M of ECAM space, and ioremap() adds an additional
> > guard page between allocations. The kernel vmap allocator will
> > align these regions to 512K, resulting in each mapping eating 1.5M
> > of vmalloc space. This means we need 384M of vmalloc space just to
> > map all of these, which is very wasteful of resources.
> >
> > Fix this by only mapping the ECAM for buses we are going to be using.
> > In my setups, this is around seven buses in most guests, which is
> > 10.5M of vmalloc space - way smaller than the 384M that would
> > otherwise be required. This also means that the kernel can boot
> > without forcing extra RAM into highmem with the vmalloc= argument,
> > or decreasing the virtual RAM available to the guest.
> >
> > Suggested-by: Arnd Bergmann <arnd@arndb.de>
> > Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> 
> Looks good to me. I wonder if we should actually mark this for stable
> backports. It is a somewhat invasive change, so there is a regression
> risk, but it's also likely that others will run into this problem on distro
> kernels.

Maybe merge it first, wait a release cycle, and then request it for
stable if we think it's of benefit?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

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

  reply	other threads:[~2021-05-13 15:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13 14:18 [PATCH] PCI: dynamically map ECAM regions Russell King
2021-05-13 15:02 ` Arnd Bergmann
2021-05-13 15:13   ` Russell King - ARM Linux admin [this message]
2021-05-13 15:14     ` Arnd Bergmann
2021-06-16 22:23 ` Bjorn Helgaas

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=20210513151341.GZ1336@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.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).