On Tue, 2018-08-14 at 13:16 -0500, Bjorn Helgaas wrote: > On Wed, Jul 25, 2018 at 05:02:59PM -0600, Jon Derrick wrote: > > Currently, a hotplug bridge will be given hpmemsize additional > > memory if > > available, in order to satisfy any future hotplug allocation > > requirements. > > > > These calculations don't consider the current memory size of the > > hotplug > > bridge/slot, so hotplug bridges/slots which have downstream devices > > will > > get their current allocation in addition to the hpmemsize value. > > > > This makes for possibly undesirable results with a mix of > > unoccupied and > > occupied slots (ex, with hpmemsize=2M): > > > > 02:03.0 PCI bridge: <-- Occupied > > Memory behind bridge: d6200000-d64fffff [size=3M] > > 02:04.0 PCI bridge: <-- Unoccupied > > Memory behind bridge: d6500000-d66fffff [size=2M] > > > > This change considers the current allocation size when using the > > hpmemsize parameter to make the reservations predictable for the > > mix of > > unoccupied and occupied slots: > > > > 02:03.0 PCI bridge: <-- Occupied > > Memory behind bridge: d6200000-d63fffff [size=2M] > > 02:04.0 PCI bridge: <-- Unoccupied > > Memory behind bridge: d6400000-d65fffff [size=2M] > > The I/O sizing code (pbus_size_io() and calculate_iosize()) is > essentially > identical to the mem sizing code you're updating. I assume the same > considerations would apply there? If not, please include a note in > the > changelog about why you changed the mem code but not the I/O code. > Thanks for the look Bjorn. I'll follow-up with v2 set with an I/O patch in a few days [snip]