Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Maciej Grochowski <maciej.grochowski@sony.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>
Subject: Re: [RFC PATCH 1/2] PCI: Add pci=hpreserve= to reserve memory windows for a hotplug bridge
Date: Wed,  7 Oct 2026 15:35:16 +0200	[thread overview]
Message-ID: <20261007133516.49748-1-maciej.grochowski@sony.com> (raw)
In-Reply-To: <8b41ee8a-8138-cfe7-8e58-19de2f1baee9@linux.intel.com>

On Mon, 5 Oct 2026, Ilpo Järvinen wrote:
> > Add "pci=hpreserve=<reservation>@<pci_dev>[; ...]" to request a minimum
>
> Why is this a new parameter instead of adding the per device functionality
> into hpmmio{,pref}size=x ?

Hi Ilpo,

Mainly to avoid giving one option two meanings.  As I read the
allocator, on the hotplug path (pci_assign_unassigned_bridge_resources())
hpmmio{,pref}size is only an optional size: it is passed as add_size, so
it lands on the realloc list, the required-only retry can drop it, and
pci_bridge_distribute_available_resources() then sets each empty
hotplug port's window to an equal share of what remains of the parent
window.  It also has no alignment of its own.  This case needs a required, aligned size
on one specific port, so I kept it separate rather than have
"hpmmioprefsize=1032M" mean "best effort" globally and "must fit" per
device.  I also wanted the bus number reservation in the same entry.

That said, the separation isn't essential, and I'd be happy to fold it
into the existing options for v2, e.g.:

  pci=hpmmioprefsize=1032M@0000:80:01.1/00.0/03.0,hpbussize=11@0000:80:01.1/00.0/03.0

where a bare value keeps today's global, optional meaning and a value
with a device specification applies only to the matching hotplug
bridges.  "[; ...]" would also cover the cover letter's grouping
question (same size for several paths), at the cost of repeating the
path once per option.  A couple of questions before I respin:

1. Should a per-device size be required, as in this RFC, or optional
   like the global one?  My understanding is that optional is not enough
   here, since the retry can drop it and distribution hands each empty
   port only an equal share of the parent window.  I haven't isolated
   this in a test with valid bus numbers; the run I did with the global
   "hpmmioprefsize=1032M,hpbussize=11" failed earlier on bus numbers
   (hpbussize is a per-bridge minimum, so the first ports drained the
   pool).  If you'd rather keep the semantics uniform, I could make it
   optional and teach distribution to honour it, but I expect that to be
   a bigger change.

2. How far should the @<pci_dev> form reach?  This case needs it only
   on hpmmioprefsize and hpbussize; I'd add hpmmiosize too.  hpiosize and
   hpmemsize are a few more parser branches, but nothing here exercises
   them.  Add them anyway, or only the knobs with a real need?

> > Tested-by: Maciej Grochowski <maciej.grochowski@sony.com>
>
> The usual assumption the patch submitter has actually tested the patch so
> normal custom is to not include self tested-bys.

Understood, I'll drop it.

Thanks,
Maciej

  reply	other threads:[~2026-10-07 13:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 19:31 [RFC PATCH 0/2] PCI: Reserve resources for a delayed hotplug subtree Maciej Grochowski
2026-10-02 19:31 ` [RFC PATCH 1/2] PCI: Add pci=hpreserve= to reserve memory windows for a hotplug bridge Maciej Grochowski
2026-10-03  1:33   ` sashiko-bot
2026-10-05  8:39   ` Ilpo Järvinen
2026-10-07 13:35     ` Maciej Grochowski [this message]
2026-10-02 19:31 ` [RFC PATCH 2/2] PCI: Allow pci=hpreserve= to reserve bus numbers " Maciej Grochowski
2026-10-03  1:33   ` sashiko-bot

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=20261007133516.49748-1-maciej.grochowski@sony.com \
    --to=maciej.grochowski@sony.com \
    --cc=bhelgaas@google.com \
    --cc=corbet@lwn.net \
    --cc=ilpo.jarvinen@linux.intel.com \
    --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