All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "Bjorn Helgaas" <bhelgaas@google.com>,
	linux-pci@vger.kernel.org,
	"Michał Winiarski" <michal.winiarski@intel.com>,
	"Igor Mammedov" <imammedo@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	"Mika Westerberg" <mika.westerberg@linux.intel.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH 00/25] PCI: Resource fitting/assignment fixes and cleanups
Date: Mon, 16 Dec 2024 19:56:07 +0200	[thread overview]
Message-ID: <20241216175632.4175-1-ilpo.jarvinen@linux.intel.com> (raw)

Hi all,

This series focuses on PCI resource fitting and assignment algorithms.
I've further changes in works to enable handling resizable BARs better
during resource fitting built on top of these, but that's still WIP and
this series seems way too large as is to have more stuff included.

First there are small tweaks and fixes to the relaxed tail alignment
code and applying the lessons learned to other similar cases. They are
sort of independent of the rest. Then a large set of pure cleanups and
refactoring that are not intended to make any functional changes.
Finally, starting from "PCI: Extend enable to check for any optional
resource" are again patches that aim to make behavioral changes to fix
bridge window sizing to consider expansion ROM as an optional resource
(to fix a remove/rescan cycle issue) and improve resource fitting
algorithm in general.

The series includes one of the change from Michał Winiarski
<michal.winiarski@intel.com> as these changes also touch the same IOV
checks.

Please let me know if you'd prefer me to order the changes differently
or split it into smaller chunks.


I've extensively tested this series over the hosts in our lab which
have quite heterogeneous PCI setup each. There were no losses of any
important resource. Without pci=realloc, there's some churn in which of
the disabled expansion ROMs gets a scarce memory space assigned (with
pci=realloc, they are all assigned large enough bridge window).


Ilpo Järvinen (24):
  PCI: Remove add_align overwrite unrelated to size0
  PCI: size0 is unrelated to add_align
  PCI: Simplify size1 assignment logic
  PCI: Optional bridge window size too may need relaxing
  PCI: Fix old_size lower bound in calculate_iosize() too
  PCI: Use SZ_* instead of literals in setup-bus.c
  PCI: resource_set_range/size() conversions
  PCI: Check resource_size() separately
  PCI: Add pci_resource_num() helper
  PCI: Add dev & res local variables to resource assignment funcs
  PCI: Converge return paths in __assign_resources_sorted()
  PCI: Refactor pdev_sort_resources() & __dev_sort_resources()
  PCI: Use while loop and break instead of gotos
  PCI: Rename retval to ret
  PCI: Consolidate assignment loop next round preparation
  PCI: Remove wrong comment from pci_reassign_resource()
  PCI: Add restore_dev_resource()
  PCI: Extend enable to check for any optional resource
  PCI: Always have realloc_head in __assign_resources_sorted()
  PCI: Indicate optional resource assignment failures
  PCI: Add debug print when releasing resources before retry
  PCI: Use res->parent to check is resource is assigned
  PCI: Perform reset_resource() and build fail list in sync
  PCI: Rework optional resource handling

Michał Winiarski (1):
  PCI: Add a helper to identify IOV resources

 drivers/pci/pci.h       |  44 +++-
 drivers/pci/setup-bus.c | 566 +++++++++++++++++++++++-----------------
 drivers/pci/setup-res.c |   8 +-
 3 files changed, 364 insertions(+), 254 deletions(-)

-- 
2.39.5


WARNING: multiple messages have this Message-ID (diff)
From: Xiaochun Lee <lixiaochun.2888@163.com>
To: xiaocli@redhat.com, 740797925@qq.com,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	linux-pci@vger.kernel.org,
	"Michał Winiarski" <michal.winiarski@intel.com>,
	"Igor Mammedov" <imammedo@redhat.com>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	linux-kernel@vger.kernel.org,
	"Mika Westerberg" <mika.westerberg@linux.intel.com>
Subject: [PATCH 00/25] PCI: Resource fitting/assignment fixes and cleanups
Date: Fri, 14 Feb 2025 17:59:02 +0800	[thread overview]
Message-ID: <20241216175632.4175-1-ilpo.jarvinen@linux.intel.com> (raw)
Message-ID: <20250214095902.RaapUYfV8MPtw_a4e6c8tQl76NlAC3QhojQEytN8pA0@z> (raw)

From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

> Hi all,
> 
> This series focuses on PCI resource fitting and assignment algorithms.
> I've further changes in works to enable handling resizable BARs better
> during resource fitting built on top of these, but that's still WIP and
> this series seems way too large as is to have more stuff included.
> 
> First there are small tweaks and fixes to the relaxed tail alignment
> code and applying the lessons learned to other similar cases. They are
> sort of independent of the rest. Then a large set of pure cleanups and
> refactoring that are not intended to make any functional changes.
> Finally, starting from "PCI: Extend enable to check for any optional
> resource" are again patches that aim to make behavioral changes to fix
> bridge window sizing to consider expansion ROM as an optional resource
> (to fix a remove/rescan cycle issue) and improve resource fitting
> algorithm in general.
> 
> The series includes one of the change from Michał Winiarski
> <michal.winiarski@intel.com> as these changes also touch the same IOV
> checks.
> 
> Please let me know if you'd prefer me to order the changes differently
> or split it into smaller chunks.
> 
> 
> I've extensively tested this series over the hosts in our lab which
> have quite heterogeneous PCI setup each. There were no losses of any
> important resource. Without pci=realloc, there's some churn in which of
> the disabled expansion ROMs gets a scarce memory space assigned (with
> pci=realloc, they are all assigned large enough bridge window).
> 
> 
> Ilpo Järvinen (24):
>   PCI: Remove add_align overwrite unrelated to size0
>   PCI: size0 is unrelated to add_align
>   PCI: Simplify size1 assignment logic
>   PCI: Optional bridge window size too may need relaxing
>   PCI: Fix old_size lower bound in calculate_iosize() too
>   PCI: Use SZ_* instead of literals in setup-bus.c
>   PCI: resource_set_range/size() conversions
>   PCI: Check resource_size() separately
>   PCI: Add pci_resource_num() helper
>   PCI: Add dev & res local variables to resource assignment funcs
>   PCI: Converge return paths in __assign_resources_sorted()
>   PCI: Refactor pdev_sort_resources() & __dev_sort_resources()
>   PCI: Use while loop and break instead of gotos
>   PCI: Rename retval to ret
>   PCI: Consolidate assignment loop next round preparation
>   PCI: Remove wrong comment from pci_reassign_resource()
>   PCI: Add restore_dev_resource()
>   PCI: Extend enable to check for any optional resource
>   PCI: Always have realloc_head in __assign_resources_sorted()
>   PCI: Indicate optional resource assignment failures
>   PCI: Add debug print when releasing resources before retry
>   PCI: Use res->parent to check is resource is assigned
>   PCI: Perform reset_resource() and build fail list in sync
>   PCI: Rework optional resource handling
> 
> Michał Winiarski (1):
>   PCI: Add a helper to identify IOV resources
> 
>  drivers/pci/pci.h       |  44 +++-
>  drivers/pci/setup-bus.c | 566 +++++++++++++++++++++++-----------------
>  drivers/pci/setup-res.c |   8 +-
>  3 files changed, 364 insertions(+), 254 deletions(-)
> 
Tested-by: Xiaochun XC17 Li <lixc17@lenovo.com>
> -- 
> 2.39.5



             reply	other threads:[~2024-12-16 17:56 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16 17:56 Ilpo Järvinen [this message]
2025-02-14  9:59 ` [PATCH 00/25] PCI: Resource fitting/assignment fixes and cleanups Xiaochun Lee
2024-12-16 17:56 ` [PATCH 01/25] PCI: Remove add_align overwrite unrelated to size0 Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 02/25] PCI: size0 is unrelated to add_align Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 03/25] PCI: Simplify size1 assignment logic Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 04/25] PCI: Optional bridge window size too may need relaxing Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 05/25] PCI: Fix old_size lower bound in calculate_iosize() too Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 06/25] PCI: Use SZ_* instead of literals in setup-bus.c Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 07/25] PCI: resource_set_range/size() conversions Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 08/25] PCI: Add a helper to identify IOV resources Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 09/25] PCI: Check resource_size() separately Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 10/25] PCI: Add pci_resource_num() helper Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 11/25] PCI: Add dev & res local variables to resource assignment funcs Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 12/25] PCI: Converge return paths in __assign_resources_sorted() Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 13/25] PCI: Refactor pdev_sort_resources() & __dev_sort_resources() Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 14/25] PCI: Use while loop and break instead of gotos Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 15/25] PCI: Rename retval to ret Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 16/25] PCI: Consolidate assignment loop next round preparation Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 17/25] PCI: Remove wrong comment from pci_reassign_resource() Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 18/25] PCI: Add restore_dev_resource() Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 19/25] PCI: Extend enable to check for any optional resource Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 20/25] PCI: Always have realloc_head in __assign_resources_sorted() Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 21/25] PCI: Indicate optional resource assignment failures Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 22/25] PCI: Add debug print when releasing resources before retry Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 23/25] PCI: Use res->parent to check is resource is assigned Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 24/25] PCI: Perform reset_resource() and build fail list in sync Ilpo Järvinen
2024-12-16 17:56 ` [PATCH 25/25] PCI: Rework optional resource handling Ilpo Järvinen
2025-02-13 21:46 ` [PATCH 00/25] PCI: Resource fitting/assignment fixes and cleanups Bjorn Helgaas
2025-02-14  8:18 ` Xiaochun XC17 Li | 李小春 Xavier
2025-02-14 11:53   ` Ilpo Järvinen
2025-02-14 21:28     ` 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=20241216175632.4175-1-ilpo.jarvinen@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=imammedo@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=michal.winiarski@intel.com \
    --cc=mika.westerberg@linux.intel.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.