All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Michal Clapinski" <mclapinski@google.com>, linux-pci@vger.kernel.org
Subject: Re: [PATCH v2 2/2] PCI/DOE: Poll briefly for a response before sleeping
Date: Tue, 03 Nov 2026 16:35:00 +0000	[thread overview]
Message-ID: <sashiko-outbox-195731@kernel.org> (raw)
In-Reply-To: <20261103163101.1696520-3-mclapinski@google.com>

> doe_statemachine_work() and pci_doe_abort() wait for the mailbox by
> sleeping PCI_DOE_POLL_INTERVAL (PCI_DOE_TIMEOUT / 128) between status
> reads, which is 7 ms at HZ=1000 and 4 ms at HZ=250. Mailbox operations
> are served from the device's local mailbox logic and complete much
> faster: on NVIDIA B200 GPUs, an abort completes in ~70 us and a
> discovery exchange in ~110 us, including the status reads polling for
> them. Every DOE-capable endpoint pays the sleep once for the abort
> issued during mailbox creation and once per supported feature during
> enumeration.
> 
> Make pci_doe_wait(), which both paths use, back off exponentially:
> start with a 1 us delay and double it on every poll until it reaches
> PCI_DOE_POLL_INTERVAL, then fall back to the existing jiffies-based
> wait.
> 
> Enumeration at boot runs before high resolution timers are enabled, so
> any sleep lasts until the next tick, which at HZ=250 is no shorter than
> PCI_DOE_POLL_INTERVAL. Until they are enabled, busy-wait instead of
> sleeping for delays of up to 128 us. Operations that complete within
> ~255 us of accumulated delay, like the ones above, then finish without
> sleeping, while slower ones waste at most that much CPU time before
> sleeping anyway. Once high resolution timers are enabled, short sleeps
> are accurate and no busy-wait beyond what fsleep() does is needed.
> 
> Time spent in pci_device_add() for a B200 GPU drops from 45.9 ms to
> 6.4 ms.
> 
> Signed-off-by: Michal Clapinski <mclapinski@google.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261103163101.1696520-1-mclapinski@google.com?part=2


  reply	other threads:[~2026-11-03 16:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 16:30 [PATCH v2 0/2] PCI/DOE: Speed up mailbox polling Michal Clapinski
2026-11-03 16:31 ` [PATCH v2 1/2] PCI/DOE: Don't busy-poll the mailbox when HZ < 128 Michal Clapinski
2026-11-03 16:33   ` sashiko-bot
2026-11-03 16:31 ` [PATCH v2 2/2] PCI/DOE: Poll briefly for a response before sleeping Michal Clapinski
2026-11-03 16:35   ` sashiko-bot [this message]
2026-11-03 21:27 ` [PATCH v2 0/2] PCI/DOE: Speed up mailbox polling 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=sashiko-outbox-195731@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mclapinski@google.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.