All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, Will Deacon <will.deacon@arm.com>,
	Mark Brown <mark.brown@linaro.org>
Subject: Re: [PATCH] PCI: generic: map config window in one go
Date: Fri, 05 Feb 2016 14:37:44 +0100	[thread overview]
Message-ID: <1507671.sEYIrU8dv6@wuerfel> (raw)
In-Reply-To: <CAKv+Gu8oZADs_FRN=p7_Nz0wXJVWVmzVNsxtzscyp7_cFAreAQ@mail.gmail.com>

On Friday 05 February 2016 11:48:54 Ard Biesheuvel wrote:
> On 29 January 2016 at 15:52, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Friday 29 January 2016 15:32:01 Ard Biesheuvel wrote:
> >> On 29 January 2016 at 15:28, Will Deacon <will.deacon@arm.com> wrote:
> >> > Hi Ard,
> >> >
> >> > On Fri, Jan 29, 2016 at 03:17:15PM +0100, Ard Biesheuvel wrote:
> >> >> Instead of iterating over the PCI config window and performing individual
> >> >> ioremap() calls on all the adjacent slices, perform a single ioremap() to
> >> >> map the entire region, and divvy it up later. This not only prevents
> >> >> leaving some of it mapped if we fail half way through, it also ensures that
> >> >> archs that support huge-vmap can use section mappings to perform the
> >> >> mapping.
> >> >>
> >> >> On my Seattle A0 box, this transforms 128 separate 1 MB mappings that are
> >> >> mapped down to 4 KB pages into a single 128 MB mapping using 2 MB sections,
> >> >> saving 512 KB worth of page tables.
> >> >>
> >> >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >> >> ---
> >> >
> >> > The code was written this way in response to feedback during driver review
> >> > that we couldn't necessarily grab that much contiguous vmalloc space on
> >> > 32-bit ARM. Unless that's changed, we probably want to to predicate this
> >> > change on having a 64-bit arch.
> >> >
> >>
> >> Ah right. How about testing for the ARCH_HAVE_HUGE_VMAP Kconfig symbol
> >> explicitly?
> >>
> >
> > Testing for 64BIT should be sufficient.
> >
> 
> Does it make sense to spin a v2 for this patch? Given the discussion
> we had regarding allocating only the config regions for busses that
> are populated, perhaps there is a better approach here?

Allocating only the config regions that are actually used would
be ideal, the problem is that you need to access the config space
in order to know which ones are, so this is certainly a bit tricky.

Are there any downsides to the x86 approach of using fixmap to
map each patch separately during the access? It's probably a bit
slower per access, but we don't do a lot of those accesses after
the system is booted.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] PCI: generic: map config window in one go
Date: Fri, 05 Feb 2016 14:37:44 +0100	[thread overview]
Message-ID: <1507671.sEYIrU8dv6@wuerfel> (raw)
In-Reply-To: <CAKv+Gu8oZADs_FRN=p7_Nz0wXJVWVmzVNsxtzscyp7_cFAreAQ@mail.gmail.com>

On Friday 05 February 2016 11:48:54 Ard Biesheuvel wrote:
> On 29 January 2016 at 15:52, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Friday 29 January 2016 15:32:01 Ard Biesheuvel wrote:
> >> On 29 January 2016 at 15:28, Will Deacon <will.deacon@arm.com> wrote:
> >> > Hi Ard,
> >> >
> >> > On Fri, Jan 29, 2016 at 03:17:15PM +0100, Ard Biesheuvel wrote:
> >> >> Instead of iterating over the PCI config window and performing individual
> >> >> ioremap() calls on all the adjacent slices, perform a single ioremap() to
> >> >> map the entire region, and divvy it up later. This not only prevents
> >> >> leaving some of it mapped if we fail half way through, it also ensures that
> >> >> archs that support huge-vmap can use section mappings to perform the
> >> >> mapping.
> >> >>
> >> >> On my Seattle A0 box, this transforms 128 separate 1 MB mappings that are
> >> >> mapped down to 4 KB pages into a single 128 MB mapping using 2 MB sections,
> >> >> saving 512 KB worth of page tables.
> >> >>
> >> >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >> >> ---
> >> >
> >> > The code was written this way in response to feedback during driver review
> >> > that we couldn't necessarily grab that much contiguous vmalloc space on
> >> > 32-bit ARM. Unless that's changed, we probably want to to predicate this
> >> > change on having a 64-bit arch.
> >> >
> >>
> >> Ah right. How about testing for the ARCH_HAVE_HUGE_VMAP Kconfig symbol
> >> explicitly?
> >>
> >
> > Testing for 64BIT should be sufficient.
> >
> 
> Does it make sense to spin a v2 for this patch? Given the discussion
> we had regarding allocating only the config regions for busses that
> are populated, perhaps there is a better approach here?

Allocating only the config regions that are actually used would
be ideal, the problem is that you need to access the config space
in order to know which ones are, so this is certainly a bit tricky.

Are there any downsides to the x86 approach of using fixmap to
map each patch separately during the access? It's probably a bit
slower per access, but we don't do a lot of those accesses after
the system is booted.

	Arnd

  reply	other threads:[~2016-02-05 13:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29 14:17 [PATCH] PCI: generic: map config window in one go Ard Biesheuvel
2016-01-29 14:17 ` Ard Biesheuvel
2016-01-29 14:19 ` Ard Biesheuvel
2016-01-29 14:19   ` Ard Biesheuvel
2016-01-29 14:22   ` Ard Biesheuvel
2016-01-29 14:22     ` Ard Biesheuvel
2016-01-29 14:28 ` Will Deacon
2016-01-29 14:28   ` Will Deacon
2016-01-29 14:32   ` Ard Biesheuvel
2016-01-29 14:32     ` Ard Biesheuvel
2016-01-29 14:52     ` Arnd Bergmann
2016-01-29 14:52       ` Arnd Bergmann
2016-02-05 10:48       ` Ard Biesheuvel
2016-02-05 10:48         ` Ard Biesheuvel
2016-02-05 13:37         ` Arnd Bergmann [this message]
2016-02-05 13:37           ` Arnd Bergmann
2016-02-05 14:09           ` Ard Biesheuvel
2016-02-05 14:09             ` Ard Biesheuvel

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=1507671.sEYIrU8dv6@wuerfel \
    --to=arnd@arndb.de \
    --cc=ard.biesheuvel@linaro.org \
    --cc=bhelgaas@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mark.brown@linaro.org \
    --cc=will.deacon@arm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.