From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B3F8472798 for ; Tue, 25 Aug 2026 13:21:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787664064; cv=none; b=GNqgE5IVw7S1WLHwVsMWOF5z6Cfl+HOxVhoPJrtbBTCbOMRKbrXgiGLF4GXsRu7NpqQ1m2L5L4qZFRNJ6+w4cs1RF7uPK1fTtrrdEGOwD2Oyg+kzfZ6fCZz0Gthu0bgPxAtSZBsifKZ4iA+nl8TX4Mshw7G8My+lBqvcXssV4ok= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787664064; c=relaxed/simple; bh=dZXT/FK7+tblCR4etoX/B8DPZXP4pkVpPaPoQ4mCAI4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=q1cLHa2rWqmwroU9LlekcQKmcbNErHi6elVUmpuxmsJIbz7ftP3G3wbABU1L5oGGzpwxC5ZSZAaod8lcZWzc5r5c6QtSV7WZeVWJn4XSEXI2zh8rbLz4FbeAGFygYpPPbBM5UDIdbRVmH95G82gM8xs+N95mWlhFrrevoEbV51U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=LUpNRjw/; arc=none smtp.client-ip=209.85.128.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="LUpNRjw/" Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-49808ea1b64so6536155e9.1 for ; Tue, 25 Aug 2026 06:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1787664059; x=1788268859; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/wDF0hN/FW6BAXrcHvW79QxhTrkNJERnJhXR31M87d4=; b=LUpNRjw/bDi1PJjzxflotWRksbTiWTYvDgQQ5KG55K3hmqXRo0bT8fo9bHkbgPE4ax g5SGSqtCC0FFSxNnCfZzxIT6+dcUPucNZ84l0NtbcxUMJIzzo/MNz7z7ej3E4cJ74+qo db0c413lo5dZ+c8gjq7c4AzzeMga7Kt1kEStbViOdwtxf2AsQsjU66RtnOTF56JiOiCh 3NpQz9LuUb0DEkzW1e/WVKTY8X7HRePmvIH1DvndSuwazDPJ5M65HnPI5c+DpV0luIU8 YIHHo7GUjL5G5ezhDRr7iScqT9Y4RqZf1wkC/7E87/FBfa3LgoK/FwPgwVlw/KqEZV8p Q9bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787664059; x=1788268859; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/wDF0hN/FW6BAXrcHvW79QxhTrkNJERnJhXR31M87d4=; b=oEHh16yPVuN32xM1XmNIREwfewquYCdusoOibp2D/cLjXRsB/By8A+1T6wsQEyusZc cj6AxCd5UdHalZk/RbIrykPeXFN/GJZPsbK2qM666xwyyIPSUDzwJ4MZQIOZvRcb6zB9 Mn8Um6O2a9EzDCOr4pCsBDCw5pH6LuYb2veG1RAGCbWtLvFLZm/J5EMVgZWO9mf3RQyU M097Sc2sQBtOIqJGvSIGnX04Zx+ojt5UWtKphXXHJimM/OzDkef6awAjTwQsRBjMhBMF goMMlwNHR/kFnEw7iGt/oUxLAxlkVwDDccgEzL4tbGSM5HapRwHX9zycxgAWMsGpekiT Hn1Q== X-Forwarded-Encrypted: i=1; AHgh+RrRZSGJ+8j3FnlOY/O7EjCBMtJjQT5Dr8hM5lrL/jJtfVJKHPfmwubiLa10+rtrLvBJXlH/TAtnxBF8Wc4=@vger.kernel.org X-Gm-Message-State: AFuF++k+EX3/IQ5dU98blZFVgYxskVj48OOhuvbRmQLHkYweUN6I3ZQg /9lsPREimIJBBz8Ow2yhrP8c+fF8RYhVHNNRrzHYuNdNbr+wtOUgjBczVB7YKgVMTklO6JStX+Q LUQTJwWN5aZZNNHY7gA== X-Received: from wmjs24.prod.google.com ([2002:a7b:c398:0:b0:499:9f79:18de]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:4f89:b0:493:f783:c46a with SMTP id 5b1f17b1804b1-499d63308fbmr60648795e9.6.1787664058484; Tue, 25 Aug 2026 06:20:58 -0700 (PDT) Date: Tue, 25 Aug 2026 13:20:57 +0000 In-Reply-To: <20260824-unique-ref-v20-4-490735672187@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260824-unique-ref-v20-0-490735672187@kernel.org> <20260824-unique-ref-v20-4-490735672187@kernel.org> Message-ID: Subject: Re: [PATCH v20 4/8] rust: page: convert to `Ownable`' From: Alice Ryhl To: Andreas Hindborg Cc: Danilo Krummrich , Lorenzo Stoakes , Vlastimil Babka , "Liam R. Howlett" , Uladzislau Rezki , Miguel Ojeda , Boqun Feng , Gary Guo , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Trevor Gross , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , "Onur =?utf-8?B?w5Z6a2Fu?=" , 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 , 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, Asahi Lina Content-Type: text/plain; charset="utf-8" On Mon, Aug 24, 2026 at 01:17:56PM +0200, Andreas Hindborg wrote: > + // SAFETY: We just successfully allocated a page, so we now have ownership of the newly > + // allocated page. We transfer that ownership to the new `Owned` object. > + // Since `Page` is transparent, we can cast the pointer directly. > + Ok(unsafe { Owned::from_raw(page.cast()) }) This doesn't satisfy the safety requirements of Owned::from_raw() because the page may be used with vm_insert_page(), which increments its refcount and causes it to be shared the vma system, and this occurs before Page::release() is called. Alice