public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Eliot Courtney" <ecourtney@nvidia.com>
To: "Danilo Krummrich" <dakr@kernel.org>,
	"Eliot Courtney" <ecourtney@nvidia.com>
Cc: "Alice Ryhl" <aliceryhl@google.com>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>, "Zhi Wang" <zhiw@nvidia.com>,
	"John Hubbard" <jhubbard@nvidia.com>,
	"Alistair Popple" <apopple@nvidia.com>,
	"Joel Fernandes" <joelagnelf@nvidia.com>,
	"Timur Tabi" <ttabi@nvidia.com>,
	nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	dri-devel <dri-devel-bounces@lists.freedesktop.org>
Subject: Re: [PATCH v5 2/9] gpu: nova-core: gsp: add mechanism to wait for space on command queue
Date: Thu, 05 Mar 2026 16:37:13 +0900	[thread overview]
Message-ID: <DGUODB0SCS88.2LMCK991QHVG4@nvidia.com> (raw)
In-Reply-To: <DGTYVZMRVLLE.3HQVL7ZT6MU7H@kernel.org>

On Wed Mar 4, 2026 at 8:39 PM JST, Danilo Krummrich wrote:
> On Wed Mar 4, 2026 at 2:42 AM CET, Eliot Courtney wrote:
>> +    fn allocate_command(&mut self, size: usize, timeout: Delta) -> Result<GspCommand<'_>> {
>> +        read_poll_timeout(
>> +            || Ok(self.driver_write_area_size()),
>> +            |available_bytes| *available_bytes >= size_of::<GspMsgElement>() + size,
>> +            Delta::ZERO,
>
> Isn't this either creating unneccessary thrashing of the memory controller or
> unnecessary contention at the cache-coherency level?
>
> I think we should probably add at least a small delay of something around 1us.

This is what nouveau does (specifically `usleep_range(1, 2)`). OTOH,
openrm just does a busy wait, which is what I replicated here for now.
GSP command queue not having space IIUC is meant to be very exceptional.
I am not sure which is best, maybe Alex has an opinion, but also happy
to change it because that reasoning makes sense to me and I don't know
enough about the distribution of how often it would actually need
to wait to know if 0 delay is justified.

  reply	other threads:[~2026-03-05  7:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04  1:42 [PATCH v5 0/9] gpu: nova-core: gsp: add continuation record support Eliot Courtney
2026-03-04  1:42 ` [PATCH v5 1/9] gpu: nova-core: gsp: sort `MsgFunction` variants alphabetically Eliot Courtney
2026-03-04  1:42 ` [PATCH v5 2/9] gpu: nova-core: gsp: add mechanism to wait for space on command queue Eliot Courtney
2026-03-04 11:39   ` Danilo Krummrich
2026-03-05  7:37     ` Eliot Courtney [this message]
2026-03-05  7:50       ` John Hubbard
2026-03-05  8:01         ` Eliot Courtney
2026-03-05 10:38       ` Alexandre Courbot
2026-03-05 11:16       ` Danilo Krummrich
2026-03-06  0:48         ` Alexandre Courbot
2026-03-06  1:46           ` Gary Guo
2026-03-06 11:03           ` Danilo Krummrich
2026-03-06  5:21         ` Alexandre Courbot
2026-03-04  1:42 ` [PATCH v5 3/9] rust: add EMSGSIZE error code Eliot Courtney
2026-03-04  1:42 ` [PATCH v5 4/9] gpu: nova-core: gsp: add checking oversized commands Eliot Courtney
2026-03-04  1:42 ` [PATCH v5 5/9] gpu: nova-core: gsp: clarify invariant on command queue Eliot Courtney
2026-03-04  1:42 ` [PATCH v5 6/9] gpu: nova-core: gsp: unconditionally call variable payload handling Eliot Courtney
2026-03-04  1:42 ` [PATCH v5 7/9] gpu: nova-core: gsp: add `size_in_bytes` helper to `CommandToGsp` Eliot Courtney
2026-03-04  2:53   ` Alexandre Courbot
2026-03-04  3:10     ` Eliot Courtney
2026-03-04  1:42 ` [PATCH v5 8/9] gpu: nova-core: gsp: support large RPCs via continuation record Eliot Courtney
2026-03-04  1:42 ` [PATCH v5 9/9] gpu: nova-core: gsp: add tests for continuation records Eliot Courtney

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=DGUODB0SCS88.2LMCK991QHVG4@nvidia.com \
    --to=ecourtney@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=apopple@nvidia.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=dri-devel-bounces@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=jhubbard@nvidia.com \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tmgross@umich.edu \
    --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