From: Alexandre Courbot <acourbot@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>,
Alice Ryhl <aliceryhl@google.com>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>
Cc: John Hubbard <jhubbard@nvidia.com>,
Alistair Popple <apopple@nvidia.com>,
Timur Tabi <ttabi@nvidia.com>,
Eliot Courtney <ecourtney@nvidia.com>,
Zhi Wang <zhiw@nvidia.com>,
nova-gpu@lists.linux.dev, linux-kernel@vger.kernel.org,
rust-for-linux@vger.kernel.org,
Alexandre Courbot <acourbot@nvidia.com>
Subject: [PATCH v2] gpu: nova-core: gsp: cmdq: reduce sleep delta in wait_for_msg
Date: Mon, 02 Nov 2026 21:30:05 +0900 [thread overview]
Message-ID: <20261102-cmdq_wait_msg_timeout-v2-1-50bc4534b659@nvidia.com> (raw)
If a message is not immediately available on the queue, `wait_for_msg`
sleeps for 1 millisecond before checking again. This is 3 orders of
magnitude more than Nouveau (which sleeps for 1 microsecond) or OpenRM
(which does not sleep at all and busy-polls) and is way too much, as GSP
commands are expected to be processed much faster than that.
Reduce the sleep time to 1 microsecond. This effectively makes `fsleep`
busy-loop with a call to `cpu_relax` afterwards, keeping latency to a
minimum.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
Changes in v2:
- Wait for 1 microsecond. (Eliot)
- Link to v1: https://patch.msgid.link/20261030-cmdq_wait_msg_timeout-v1-1-a1e628d2732c@nvidia.com
---
drivers/gpu/nova-core/gsp/cmdq.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs b/drivers/gpu/nova-core/gsp/cmdq.rs
index 936406004a57..8ee8a99e4d7e 100644
--- a/drivers/gpu/nova-core/gsp/cmdq.rs
+++ b/drivers/gpu/nova-core/gsp/cmdq.rs
@@ -603,7 +603,7 @@ fn wait_for_msg(&self, timeout: Delta) -> Result<GspMessage<'_>> {
read_poll_timeout(
|| Ok(self.gsp_mem.driver_read_area()),
|driver_area| !driver_area.0.is_empty(),
- Delta::from_millis(1),
+ Delta::from_micros(1),
timeout,
)
}
---
base-commit: 9fe580fd90e20c8432832c5f9a7e92b049ae9af6
change-id: 20261030-cmdq_wait_msg_timeout-26df11234d10
Best regards,
--
Alexandre Courbot <acourbot@nvidia.com>
next reply other threads:[~2026-11-02 12:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 12:30 Alexandre Courbot [this message]
2026-11-02 12:38 ` [PATCH v2] gpu: nova-core: gsp: cmdq: reduce sleep delta in wait_for_msg Eliot Courtney
2026-11-02 12:39 ` Danilo Krummrich
2026-11-02 14:00 ` Alexandre Courbot
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=20261102-cmdq_wait_msg_timeout-v2-1-50bc4534b659@nvidia.com \
--to=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=apopple@nvidia.com \
--cc=dakr@kernel.org \
--cc=ecourtney@nvidia.com \
--cc=jhubbard@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nova-gpu@lists.linux.dev \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=ttabi@nvidia.com \
--cc=zhiw@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox