PCI/DOE: Speed up mailbox polling
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest2 patches 1 replyIn review
Changes in v2 from the cover letter
- New patch 1, fixing busy-polling when HZ < 128.
- Patch 2: share the fast poll with pci_doe_abort() by moving it into pci_doe_wait().
- Patch 2: replace the fixed ~2 ms fast-polling window with an exponential backoff that busy-waits for its first ~255 us, but only until high resolution timers are enabled.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | PCI/DOE: Don't busy-poll the mailbox when HZ < 128drivers/ | +1 | 0 replies | |
| 2/2 | PCI/DOE: Poll briefly for a response before sleepingdrivers/ | +43 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/2] PCI/DOE: Speed up mailbox polling
The DOE code waits for mailbox responses by sleeping PCI_DOE_POLL_INTERVAL (7 ms at HZ=1000, 4 ms at HZ=250) between status reads. Every DOE-capable endpoint goes through several such exchanges during enumeration: an abort when the mailbox is created and one discovery exchange per supported feature. Each pays at least one interval, even though devices typically respond within about a hundred microseconds.
Patch 1 fixes PCI_DOE_POLL_INTERVAL being 0 when HZ < 128, which makes the polling loops spin for up to a second instead of sleeping.
Patch 2 replaces the fixed sleep with an exponential backoff that busy-waits briefly while high resolution timers are not yet enabled, as is the case during enumeration at boot. Time spent in pci_device_add() for an NVIDIA B200 GPU drops from 45.9 ms to 6.4 ms.
Changes in v2:
- New patch 1, fixing busy-polling when HZ < 128.
- Patch 2: share the fast poll with pci_doe_abort() by moving it into pci_doe_wait().
- Patch 2: replace the fixed ~2 ms fast-polling window with an exponential backoff that busy-waits for its first ~255 us, but only until high resolution timers are enabled.
Michal Clapinski (2):
PCI/DOE: Don't busy-poll the mailbox when HZ < 128 PCI/DOE: Poll briefly for a response before sleeping
drivers/pci/doe.c | 49 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 5 deletions(-)
Signature · 1 line
2.56.0.385.gac671c819a-goog