The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Gary Guo" <gary@garyguo.net>
To: "Vladislav Zaharov" <vladazaharova2018@gmail.com>,
	<sashiko-bot@kernel.org>
Cc: <dakr@kernel.org>, <acourbot@nvidia.com>, <aliceryhl@google.com>,
	<nova-gpu@lists.linux.dev>, <dri-devel@lists.freedesktop.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] gpu: nova-core: gsp: retain the GSP-RM log buffers after unbind
Date: Wed, 12 Aug 2026 15:00:54 +0100	[thread overview]
Message-ID: <DKN0Q8TTO2AN.1FSUS3RCSAB2U@garyguo.net> (raw)
In-Reply-To: <20260812120606.191456-1-vladazaharova2018@gmail.com>

On Wed Aug 12, 2026 at 1:06 PM BST, Vladislav Zaharov wrote:
> sashiko-bot@kernel.org wrote:
>> Does this code need a memory barrier (such as dma_rmb()) between reading
>> the 'put' pointer and copying the buffer contents?
>
> Not in the path this code is written for. snapshot() is called from the
> drop path of the log buffers, which is only reached after PinnedDrop for
> GspResources has run the GSP unload sequence, so the GSP is no longer
> writing to these buffers and there is nothing to order against.
>
> The one case where that does not hold is a Gsp::boot() that fails by
> timing out: the GSP may then still be alive and appending while the
> buffers are dropped. The copy is best-effort there - it cannot be made
> atomic either way - but reading a non-zero 'put' and then reading
> contents that predate it is indeed the pattern dma_rmb() exists for.
>
> I am happy to add it, but there is no dma_rmb() abstraction in
> rust/kernel at the moment: sync/barrier.rs only provides the smp_*
> family, and smp_rmb() is not a correct substitute, as on arm64 it uses
> the inner shareable domain rather than the outer shareable one that
> dma_rmb() needs.

See
https://lore.kernel.org/rust-for-linux/20260609-rust-barrier-v2-0-30fcc48e1cd0@garyguo.net/

The abstraction part is being upstreamed via tip tree, so they're not currently
present in drm-rust.next. It'll be there when the next backmerge happens.

>
> Would you prefer a small prerequisite patch adding dma_rmb() to
> rust/kernel, or is relying on the unload ordering acceptable, with the
> requirement spelled out in a comment on snapshot()?

Sashiko is a patch review bot so you won't get any response by asking it --
although I suppose this message is written by a LLM too.

Best,
Gary

  reply	other threads:[~2026-08-12 14:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 11:37 [PATCH 0/2] gpu: nova-core: retain the GSP-RM log buffers Vladislav Zaharov
2026-08-12 11:37 ` [PATCH 1/2] gpu: nova-core: gsp: retain the GSP-RM log buffers after unbind Vladislav Zaharov
2026-08-12 12:06   ` Vladislav Zaharov
2026-08-12 14:00     ` Gary Guo [this message]
2026-08-12 14:38       ` Vladislav Zaharov
2026-08-12 22:41   ` John Hubbard
2026-08-12 23:15     ` Danilo Krummrich
2026-08-13  0:00       ` John Hubbard
2026-08-12 23:43   ` Danilo Krummrich
2026-08-12 11:37 ` [PATCH 2/2] Documentation: nova: remove completed GSP log buffer task Vladislav Zaharov
2026-08-12 15:54 ` [PATCH 0/2] gpu: nova-core: retain the GSP-RM log buffers Danilo Krummrich
2026-08-12 16:08   ` Vladislav Zaharov

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=DKN0Q8TTO2AN.1FSUS3RCSAB2U@garyguo.net \
    --to=gary@garyguo.net \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nova-gpu@lists.linux.dev \
    --cc=sashiko-bot@kernel.org \
    --cc=vladazaharova2018@gmail.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