Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1600321

Re: [PATCH 1/4] pci: Allow lockless access path to PCI mmconfig

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH 1/4] pci: Allow lockless access path to PCI mmconfig
Date 2017-03-14 14:10 +0100
Message-ID <tkUn8-x2-19@gated-at.bofh.it> (permalink)
References <tgKw1-2hO-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 2 Mar 2017, Andi Kleen wrote:

> From: Andi Kleen <ak@linux.intel.com>
> 
> The Intel uncore driver can do a lot of PCI config accesses to read
> performance counters. I had a situation on a 4S system where it
> was spending 40+% of CPU time grabbing the pci_cfg_lock due to that.
> 
> For 64bit x86 with MMCONFIG there isn't really any reason to take
> a lock. The access is directly mapped to an underlying MMIO area,
> which can fully operate lockless.
> 
> Add a new flag that allows the PCI mid layer to skip the lock
> and set it for the 64bit mmconfig code.
> 
> There's a small risk that someone relies on this lock for synchronization,
> but I think that's unlikely because there isn't really any useful
> synchronization at this individual operation level. Any useful
> synchronization would likely need to protect at least a
> read-modify-write or similar.  So I made it unconditional without opt-in.

This part of the changelog is just crap.

The reason why pci_lock exists and is taken for each single read/write
config is that some ops implementations, e.g. the generic ones, must
protect at this granularity level because

	ops->map_bus()
	read/writeX()

needs to be 'atomic'.

MMCONFIG obviously does not require this at all because it's a simple
byte/word/dword read/write which is serialized by itself. So it's obvious
that the serialization with pci_lock is pointless in this case.

It's not that hard to figure it out and write up a proper changelog instead
of handwaving about risk and whatever.

Thanks,

	tglx

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/4] pci: Allow lockless access path to PCI mmconfig Andi Kleen <andi@firstfloor.org> - 2017-03-03 03:20 +0100
  [PATCH 3/4] x86, pci: Add interface to force mmconfig Andi Kleen <andi@firstfloor.org> - 2017-03-03 06:10 +0100
    Re: [PATCH 3/4] x86, pci: Add interface to force mmconfig Thomas Gleixner <tglx@linutronix.de> - 2017-03-14 15:00 +0100
      Re: [PATCH 3/4] x86, pci: Add interface to force mmconfig Andi Kleen <ak@linux.intel.com> - 2017-03-14 16:50 +0100
        Re: [PATCH 3/4] x86, pci: Add interface to force mmconfig Thomas Gleixner <tglx@linutronix.de> - 2017-03-14 17:50 +0100
          Re: [PATCH 3/4] x86, pci: Add interface to force mmconfig Andi Kleen <ak@linux.intel.com> - 2017-03-14 18:10 +0100
            Re: [PATCH 3/4] x86, pci: Add interface to force mmconfig Thomas Gleixner <tglx@linutronix.de> - 2017-03-14 19:00 +0100
              Re: [PATCH 3/4] x86, pci: Add interface to force mmconfig Bjorn Helgaas <helgaas@kernel.org> - 2017-03-14 20:50 +0100
                Re: [PATCH 3/4] x86, pci: Add interface to force mmconfig Andi Kleen <andi@firstfloor.org> - 2017-03-15 03:30 +0100
                Re: [PATCH 3/4] x86, pci: Add interface to force mmconfig Bjorn Helgaas <helgaas@kernel.org> - 2017-03-15 04:00 +0100
                Re: [PATCH 3/4] x86, pci: Add interface to force mmconfig Thomas Gleixner <tglx@linutronix.de> - 2017-03-15 11:10 +0100
                Re: [PATCH 3/4] x86, pci: Add interface to force mmconfig Bjorn Helgaas <helgaas@kernel.org> - 2017-03-15 15:20 +0100
                Re: [PATCH 3/4] x86, pci: Add interface to force mmconfig Andi Kleen <andi@firstfloor.org> - 2017-03-16 01:10 +0100
                Re: [PATCH 3/4] x86, pci: Add interface to force mmconfig Thomas Gleixner <tglx@linutronix.de> - 2017-03-16 23:50 +0100
  Re: [PATCH 1/4] pci: Allow lockless access path to PCI mmconfig Thomas Gleixner <tglx@linutronix.de> - 2017-03-14 14:10 +0100
  Re: [PATCH 1/4] pci: Allow lockless access path to PCI mmconfig "H. Peter Anvin" <hpa@zytor.com> - 2017-03-14 18:30 +0100

csiph-web