From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1353C79FB9 for ; Thu, 10 Sep 2026 09:18:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D8E5510E5CA; Thu, 10 Sep 2026 09:18:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="fLztRJ11"; dkim-atps=neutral Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 49FB110E5CA for ; Thu, 10 Sep 2026 09:18:50 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 82EB9600CB; Thu, 10 Sep 2026 09:18:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E58701F00893; Thu, 10 Sep 2026 09:18:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789031929; bh=b2rvGN8a/hwFRXqmD9Oi0dRRCMRXZ2H/tyXPbdR/QQI=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=fLztRJ11gMHHdPALILH78p9/vBilVUbuNADwY9UYJPcuYvXfVeHpdDMp1ITRZJvHe XjZcmya7kCFOVb/I3E54U/TBa5c2llec3pXOIRuhBWAkP8K5LhNJxKDa1mXuaYc+wn Ye346f3n2be6FUPBgxegE4vip4jrksD/4hyMfKc4cg1mfK5YTmL5iEV02dOCeeCPcE /Mux/23If7BltIhPEYGf1v/3usd/X+FMGCn/FOz0DRdFmgDL3Zy2+1H/EhdGmoQlVO EOUrz+SMvXC2VEzKxJ6CrUL2Ci/krNVkYdwOA0Yk+bKya0LZ/0lw6ocX1GKHjHS0+c XfrY6jdHEJ+kw== From: sashiko-bot@kernel.org Subject: Re: [PATCH v21 7/9] rust: page: convert to `AlwaysRefCounted` To: "Andreas Hindborg" Cc: linux-pci@vger.kernel.org, dri-devel@lists.freedesktop.org, gary@garyguo.net, ojeda@kernel.org In-Reply-To: <20260910-unique-ref-v21-7-e83257373062@kernel.org> References: <20260910-unique-ref-v21-0-e83257373062@kernel.org> <20260910-unique-ref-v21-7-e83257373062@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 10 Sep 2026 09:18:48 +0000 Message-Id: <20260910091848.E58701F00893@smtp.kernel.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" > `struct page` is managed by a native reference count, and kernel C > code routinely takes its own references to pages, for example when a > page is inserted into a VMA with `vm_insert_page()`. >=20 > Thus, implement `RefCounted` for `Page`, backed by `get_page()` and > `put_page()`, mark it `AlwaysRefCounted`, and return `ARef` from > `Page::alloc_page()`. The page is freed when the last reference to it is > dropped; for the order-0 pages allocated here, this is equivalent to > `__free_pages()`. >=20 > This also allows `Page` references to be returned as borrowed > references without owning the `struct page`. Remove `BorrowedPage` > and update users to use `&Page` and `ARef`. >=20 > Assisted-by: LLM > Suggested-by: Alice Ryhl > Signed-off-by: Andreas Hindborg Sashiko has reviewed this patch and found no issues. It looks great! --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260910-unique-ref= -v21-0-e83257373062@kernel.org?part=3D7