* [PATCH v2] gpu: nova-core: gsp: cmdq: reduce sleep delta in wait_for_msg
@ 2026-11-02 12:30 Alexandre Courbot
2026-11-02 12:38 ` Eliot Courtney
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Alexandre Courbot @ 2026-11-02 12:30 UTC (permalink / raw)
To: Danilo Krummrich, Alice Ryhl, David Airlie, Simona Vetter
Cc: John Hubbard, Alistair Popple, Timur Tabi, Eliot Courtney,
Zhi Wang, nova-gpu, linux-kernel, rust-for-linux,
Alexandre Courbot
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] gpu: nova-core: gsp: cmdq: reduce sleep delta in wait_for_msg
2026-11-02 12:30 [PATCH v2] gpu: nova-core: gsp: cmdq: reduce sleep delta in wait_for_msg Alexandre Courbot
@ 2026-11-02 12:38 ` Eliot Courtney
2026-11-02 12:39 ` Danilo Krummrich
2026-11-02 14:00 ` Alexandre Courbot
2 siblings, 0 replies; 4+ messages in thread
From: Eliot Courtney @ 2026-11-02 12:38 UTC (permalink / raw)
To: Alexandre Courbot, Danilo Krummrich, Alice Ryhl, David Airlie,
Simona Vetter
Cc: John Hubbard, Alistair Popple, Timur Tabi, Eliot Courtney,
Zhi Wang, nova-gpu, linux-kernel, rust-for-linux
On Mon Nov 2, 2026 at 9:30 PM JST, Alexandre Courbot wrote:
> 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
> ---
Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] gpu: nova-core: gsp: cmdq: reduce sleep delta in wait_for_msg
2026-11-02 12:30 [PATCH v2] gpu: nova-core: gsp: cmdq: reduce sleep delta in wait_for_msg Alexandre Courbot
2026-11-02 12:38 ` Eliot Courtney
@ 2026-11-02 12:39 ` Danilo Krummrich
2026-11-02 14:00 ` Alexandre Courbot
2 siblings, 0 replies; 4+ messages in thread
From: Danilo Krummrich @ 2026-11-02 12:39 UTC (permalink / raw)
To: Alexandre Courbot, Alice Ryhl, David Airlie, Simona Vetter
Cc: John Hubbard, Alistair Popple, Timur Tabi, Eliot Courtney,
Zhi Wang, nova-gpu, linux-kernel, rust-for-linux
On Mon, Nov 2, 2026, at 1:30 PM, Alexandre Courbot wrote:
> 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>
Acked-by: Danilo Krummrich <dakr@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] gpu: nova-core: gsp: cmdq: reduce sleep delta in wait_for_msg
2026-11-02 12:30 [PATCH v2] gpu: nova-core: gsp: cmdq: reduce sleep delta in wait_for_msg Alexandre Courbot
2026-11-02 12:38 ` Eliot Courtney
2026-11-02 12:39 ` Danilo Krummrich
@ 2026-11-02 14:00 ` Alexandre Courbot
2 siblings, 0 replies; 4+ messages in thread
From: Alexandre Courbot @ 2026-11-02 14:00 UTC (permalink / raw)
To: Danilo Krummrich, Alice Ryhl, David Airlie, Simona Vetter
Cc: John Hubbard, Alistair Popple, Timur Tabi, Eliot Courtney,
Zhi Wang, nova-gpu, linux-kernel, rust-for-linux,
Alexandre Courbot
On Mon Nov 2, 2026 at 9:30 PM JST, Alexandre Courbot wrote:
> 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>
Pushed to drm-rust-next, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-02 14:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02 12:30 [PATCH v2] gpu: nova-core: gsp: cmdq: reduce sleep delta in wait_for_msg Alexandre Courbot
2026-11-02 12:38 ` Eliot Courtney
2026-11-02 12:39 ` Danilo Krummrich
2026-11-02 14:00 ` Alexandre Courbot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®