Skip to content

PCI: Improve head free space usage

Ilpo Järvinen linux-alpha linux-arm-kernel linux-m68k linux-mips linux-parisc linux-pci linux-s390 linux-sh linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10resource: Add __resource_contains_unbound() for internal contains checksinclude/linux/ioport.h kernel/resource.c+19 -50 replies
2/10resource: Pass full extent of empty space to resource_alignf CBarch/alpha/kernel/pci.c arch/arm/kernel/bios32.c arch/m68k/kernel/pcibios.c +13 more+35 -130 replies
3/10resource: Rename 'tmp' variable to 'full_avail'kernel/resource.c+14 -140 replies
4/10ARM/PCI: Remove unnecessary second application of alignarch/arm/kernel/bios32.c+0 -20 replies
5/10am68k/PCI: Remove unnecessary second application of alignarch/m68k/kernel/pcibios.c+0 -25 replies
6/10MIPS: PCI: Remove unnecessary second application of alignarch/mips/pci/pci-generic.c+0 -20 replies
7/10parisc/PCI: Cleanup align handlingarch/parisc/kernel/pci.c+4 -60 replies
8/10PCI: Rename window_alignment() to pci_min_window_alignment()drivers/pci/pci.h drivers/pci/setup-bus.c+6 -30 replies
9/10PCI: Align head space betterarch/arm/kernel/bios32.c arch/m68k/kernel/pcibios.c arch/mips/pci/pci-generic.c +9 more+67 -21 reply
10/10PCI: Fix alignment calculation for resource size larger than aligndrivers/pci/setup-bus.c+8 -10 replies

Reviews trailers per patch

1 of 10 patches has a Reviewed-by or Acked-by.

PatchGreg Ungerer
1/10
2/10
3/10
4/10
5/10A-b
6/10
7/10
8/10
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/10] PCI: Improve head free space usage

Hi all,

This series attempts to take advantage of free head space (the free space before the aligned start address) in order to generally produce a tighter packing of the resources/bridge windows.

The recent changes to the resource fitting algorithm caused resource allocation failures in some cases where a bridge window that is sized to be gapless could no longer be assigned. The previous algorithm left a huge gaps which allowed it to place the remainder (non-aligning part of the size) before the start address of used for the gapless fit, whereas the new gapless approach always had to place the remainder after the aligning part of the resources. There is not always space for the remainder triggering those failures (e.g., when the aligning part must be placed at the top of the window).

This series attempts to allow placing the remainder once again before the aligning part, but now without leaving huge gaps to retain the benefits of the gapless bridge windows. The approach is somewhat hacky but should work thanks to PCI resources fundamentally consisting only power-of-two atoms.

There maybe cases where architecture would not want to do such relocation. This series adds the relocation to arch pcibios_align_resource() functions to allow all of them taking advantage of the better resource packing but if somebody objects doing this relocation for a particular arch, I can remove it, please just let me know (this relocation doesn't seem critical unless there are regressions).

Ilpo Järvinen (10):
resource: Add __resource_contains_unbound() for internal contains
checks
resource: Pass full extent of empty space to resource_alignf CB
resource: Rename 'tmp' variable to 'full_avail' ARM/PCI: Remove unnecessary second application of align am68k/PCI: Remove unnecessary second application of align
MIPS: PCI: Remove unnecessary second application of align parisc/PCI: Cleanup align handling
PCI: Rename window_alignment() to pci_min_window_alignment()
PCI: Align head space better
PCI: Fix alignment calculation for resource size larger than align

 arch/alpha/kernel/pci.c          |  1 +
 arch/arm/kernel/bios32.c         |  9 ++++---
 arch/m68k/kernel/pcibios.c       |  8 +++++--
 arch/mips/pci/pci-generic.c      |  8 ++++---
 arch/mips/pci/pci-legacy.c       |  3 +++
 arch/parisc/kernel/pci.c         | 17 ++++++++------
 arch/powerpc/kernel/pci-common.c |  6 ++++-
 arch/s390/pci/pci.c              |  1 +
 arch/sh/drivers/pci/pci.c        |  6 ++++-
 arch/x86/pci/i386.c              |  5 +++-
 arch/xtensa/kernel/pci.c         |  3 +++
 drivers/pci/pci.h                |  3 +++
 drivers/pci/setup-bus.c          | 15 ++++++++----
 drivers/pci/setup-res.c          | 40 +++++++++++++++++++++++++++++++-
 drivers/pcmcia/rsrc_nonstatic.c  |  3 ++-
 include/linux/ioport.h           | 22 +++++++++++++++---
 include/linux/pci.h              | 12 +++++++---
 kernel/resource.c                | 33 +++++++++++++-------------
 18 files changed, 149 insertions(+), 46 deletions(-)

base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f

Signature · 1 line
2.39.5