From: sashiko-bot@kernel.org
To: "Andreas Hindborg" <a.hindborg@kernel.org>
Cc: linux-pci@vger.kernel.org, ojeda@kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v20 5/8] rust: rename `AlwaysRefCounted` to `RefCounted`.
Date: Mon, 24 Aug 2026 11:28:30 +0000 [thread overview]
Message-ID: <20260824112831.073301F00A3E@smtp.kernel.org> (raw)
In-Reply-To: <20260824-unique-ref-v20-5-490735672187@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The `GpuVm` and `GpuVmBo` types in the DRM GPUVM subsystem were not updated to reflect the `AlwaysRefCounted` and `RefCounted` trait split, resulting in a compilation failure.
--
--- Patch [5]: [PATCH v20 5/8] rust: rename `AlwaysRefCounted` to `RefCounted`. ---
commit 7d343e09ba4b06050b444e30c1113ca349f25a78
Author: Oliver Mangold <oliver.mangold@pm.me>
rust: rename AlwaysRefCounted to RefCounted.
This commit splits the AlwaysRefCounted trait into RefCounted and a new
marker trait AlwaysRefCounted. It updates several subsystems to implement
the new RefCounted trait while preserving the AlwaysRefCounted marker where
appropriate.
> diff --git a/rust/kernel/sync/aref.rs b/rust/kernel/sync/aref.rs
> index 3bd5eb8a1a526..ea5a16b8163a6 100644
> --- a/rust/kernel/sync/aref.rs
> +++ b/rust/kernel/sync/aref.rs
[ ... ]
> @@ -45,9 +43,8 @@
> /// at least until matching decrements are performed.
> ///
> /// Implementers must also ensure that all instances are reference-counted. (Otherwise they
> -/// won't be able to honour the requirement that [`AlwaysRefCounted::inc_ref`] keep the object
> -/// alive.)
> -pub unsafe trait AlwaysRefCounted {
> +/// won't be able to honour the requirement that [`RefCounted::inc_ref`] keep the object alive.)
> +pub unsafe trait RefCounted {
> /// Increments the reference count on the object.
> fn inc_ref(&self);
[Severity: Low]
Did this patch miss updating the DRM GPUVM subsystem?
When CONFIG_RUST_DRM_GPUVM is enabled, the build fails because GpuVm and
GpuVmBo are still trying to implement inc_ref() and dec_ref() under the
AlwaysRefCounted trait instead of RefCounted.
For example, in rust/kernel/drm/gpuvm/mod.rs:
unsafe impl<T: DriverGpuVm> AlwaysRefCounted for GpuVm<T> {
fn inc_ref(&self) {
// SAFETY: By type invariants, the allocation is managed by the refcount in self.vm.
unsafe { bindings::drm_gpuvm_get(self.vm.get()) };
}
...
}
And similarly in rust/kernel/drm/gpuvm/vm_bo.rs for GpuVmBo:
unsafe impl<T: DriverGpuVm> AlwaysRefCounted for GpuVmBo<T> {
fn inc_ref(&self) {
// SAFETY: By type invariants, the allocation is managed by the refcount in self.inner.
unsafe { bindings::drm_gpuvm_bo_get(self.inner.get()) };
}
...
}
Should these implementations be updated to use the new RefCounted trait to
match the changes made to the other subsystems?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260824-unique-ref-v20-0-490735672187@kernel.org?part=5
next prev parent reply other threads:[~2026-08-24 11:28 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 11:17 [PATCH v20 0/8] rust: add `Ownable` trait and `Owned` type Andreas Hindborg
2026-08-24 11:17 ` [PATCH v20 1/8] rust: alloc: add `KBox::into_non_null` Andreas Hindborg
2026-08-24 11:22 ` sashiko-bot
2026-08-25 13:01 ` Danilo Krummrich
2026-08-24 11:17 ` [PATCH v20 2/8] rust: types: Add Ownable/Owned types Andreas Hindborg
2026-08-24 11:27 ` sashiko-bot
2026-08-24 11:17 ` [PATCH v20 3/8] rust: implement `ForeignOwnable` for `Owned` Andreas Hindborg
2026-08-24 11:24 ` sashiko-bot
2026-08-24 11:17 ` [PATCH v20 4/8] rust: page: convert to `Ownable` Andreas Hindborg
2026-08-24 11:26 ` sashiko-bot
2026-08-25 13:20 ` [PATCH v20 4/8] rust: page: convert to `Ownable`' Alice Ryhl
2026-08-25 13:34 ` [PATCH v20 4/8] rust: page: convert to `Ownable` Danilo Krummrich
2026-08-24 11:17 ` [PATCH v20 5/8] rust: rename `AlwaysRefCounted` to `RefCounted` Andreas Hindborg
2026-08-24 11:28 ` sashiko-bot [this message]
2026-08-24 12:26 ` Uwe Kleine-König
2026-08-24 11:17 ` [PATCH v20 6/8] rust: Add missing SAFETY documentation for `ARef` example Andreas Hindborg
2026-08-24 11:25 ` sashiko-bot
2026-08-24 11:36 ` Miguel Ojeda
2026-08-26 9:29 ` Andreas Hindborg
2026-08-24 11:17 ` [PATCH v20 7/8] rust: Add `OwnableRefCounted` Andreas Hindborg
2026-08-24 11:28 ` sashiko-bot
2026-08-25 13:16 ` Danilo Krummrich
2026-08-25 13:37 ` Gary Guo
2026-08-24 11:18 ` [PATCH v20 8/8] rust: page: add `from_raw()` Andreas Hindborg
2026-08-24 11:25 ` sashiko-bot
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=20260824112831.073301F00A3E@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-pci@vger.kernel.org \
--cc=ojeda@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox