From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B2111A6816; Sun, 13 Sep 2026 09:49:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789292969; cv=none; b=GExvjF2FS6EeXrEs0CgDO4m0/mAwR3iGvMMtG+bcTMWWRuqNz6Oz+sTf7zoxoqIkFNxU8cYFGfvnEUdmfdyCU6AiLJYs5BPdw0AcrNZqjyTGPL/YRwX7EXjUeJ5dga8TtMfkg+c9IZWEsHfjbyE2xYGSKaXhP9J1ww3Lp0E1N4Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789292969; c=relaxed/simple; bh=mGAg4rKunkIul1QDQuUassVbQndYIl+aQxGofMURzUU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=j1e5p6dHcuhzvGG3zBN5qpb7Syoo4ew9znIajUKqZavGbH5IOrAT6bSYOdasCqrTpVgVS17Lwle6H370aL1VSlW/kHfAYbLrmMPooG20oR0c3qsWEH7EwhXg1dP+jBHeruJlPWBd0XFkky/wgYgky197VPX1Tox9FjpsOaNO/Vo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PfBvxpKE; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PfBvxpKE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1DC51F000FF; Sun, 13 Sep 2026 09:49:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789292967; bh=Tg5IU0+H9KMkSOpIVEYusfjm6bIb4fQEllwynyz0EVc=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=PfBvxpKEvpJ5VLvXhFNDyHaYXB+ow/oOmmQUHohuPRTQ5OidCuKr72NVna21Lhj74 r5JNth+EicGcrCC7nWRPU3KP7VvVO3pSw3SMgGmOSz4IhFnNf6O4Pe/2yjIehooC1j V5gfQBN3V7CSTiFObippk57pdzCBTAaYjhpBs8h86PcRmrAVE5mHCe8CBXR8sdZ9lI hOiIl8GhtQRUZJhWmq4v0gpGo2yCDfi4JJ5+JCDbKJMzUMLQpHEY7eL23wcPEXXOYK YUZArZv4sXfKDhvHqKab4q5jTSS5LAjaBXREtzk2jtVz45lYaQ3li0P61UqlG1ww9i AGBthjzkxuVUQ== From: Andreas Hindborg To: Gary Guo , Alice Ryhl Cc: Danilo Krummrich , Lorenzo Stoakes , Vlastimil Babka , "Liam R. Howlett" , Uladzislau Rezki , Miguel Ojeda , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn?= Roy Baron , Benno Lossin , Trevor Gross , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , Onur =?utf-8?Q?=C3=96zkan?= , Lyude Paul , Greg Kroah-Hartman , Arve =?utf-8?B?SGrDuG5uZXbDpWc=?= , Todd Kjos , Christian Brauner , Carlos Llamas , "Rafael J. Wysocki" , Dave Ertman , Leon Romanovsky , Paul Moore , Serge Hallyn , David Airlie , Simona Vetter , Alexander Viro , Jan Kara , Igor Korotin , Viresh Kumar , Nishanth Menon , Stephen Boyd , Bjorn Helgaas , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Pavel Tikhomirov , Michal Wilczynski , Ira Weiny , Matthew Brost , Thomas =?utf-8?Q?Hellstr=C3=B6m?= , Philipp Stanner , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, driver-core@lists.linux.dev, linux-block@vger.kernel.org, linux-security-module@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fsdevel@vger.kernel.org, linux-pm@vger.kernel.org, linux-pci@vger.kernel.org, linux-pwm@vger.kernel.org, linux-usb@vger.kernel.org, Oliver Mangold , Viresh Kumar Subject: Re: [PATCH v21 4/9] rust: rename `AlwaysRefCounted` to `RefCounted`. In-Reply-To: References: <20260910-unique-ref-v21-0-e83257373062@kernel.org> <20260910-unique-ref-v21-4-e83257373062@kernel.org> Date: Sun, 13 Sep 2026 11:49:12 +0200 Message-ID: <875x09v5uv.fsf@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable "Gary Guo" writes: > On Fri Sep 11, 2026 at 10:08 AM BST, Alice Ryhl wrote: >> On Thu, Sep 10, 2026 at 11:01=E2=80=AFAM Andreas Hindborg wrote: >>> >>> From: Oliver Mangold >>> >>> There are types where it may both be reference counted in some cases and >>> owned in others. In such cases, obtaining `ARef` from `&T` would be >>> unsound as it allows creation of `ARef` copy from `&Owned`. >>> >>> Therefore, we split `AlwaysRefCounted` into `RefCounted` (which `ARef` >>> would require) and a marker trait to indicate that the type is always >>> reference counted (and not `Ownable`) so the `&T` -> `ARef` conversi= on >>> is possible. >>> >>> - Rename `AlwaysRefCounted` to `RefCounted`. >>> - Add a new unsafe trait `AlwaysRefCounted`. >>> - Implement the new trait `AlwaysRefCounted` for the newly renamed >>> `RefCounted` implementations. This leaves functionality of existing >>> implementers of `AlwaysRefCounted` intact. >>> >>> Suggested-by: Alice Ryhl >>> Reviewed-by: Daniel Almeida >>> Signed-off-by: Oliver Mangold >>> [ Andreas: Updated commit message and rebase on rust-next (7.2) ] >>> Acked-by: Igor Korotin >>> Acked-by: Danilo Krummrich >>> Acked-by: Viresh Kumar >>> Reviewed-by: Gary Guo >>> Assisted-by: LLM >>> Co-developed-by: Andreas Hindborg >>> Signed-off-by: Andreas Hindborg >> >> This has a lot of safety comments of the form "This does not implement >> Ownable, *therefore* it can implement AlwaysRefcounted". But I think >> the safety comment should instead explain that it's okay to create an >> ARef<_> from an &_ for this type. The fact that Ownable is not >> implemented is not sufficient argument. >> >> Alice > > Yeah, I think for types that currently implement `AlwaysRefCounted` and d= oes not > have a new `Ownable` form, it should keep saying that "this is always ref= erence > counted". Makes sense, I will fix them. Best regards, Andreas Hindborg