Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1188665lqe; Mon, 8 Apr 2024 01:00:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWP0k1Y8OUVrV9dmyuvzaus5tbiEcuvsmrOLkLvEkrTApfSPK7tAXioeMdoCoXGD5QwA/6aWMdvp5lDRTI9T58z2JalMBK/H2eqzKj+FA== X-Google-Smtp-Source: AGHT+IHul6irxx/sNqAEfys1hW/aL2OH0WCxHCK8htjXyU4Ch6MHmZeRMHfRs6+W/Tp8Rsl1t3tp X-Received: by 2002:a17:90b:30c2:b0:29d:eea9:c800 with SMTP id hi2-20020a17090b30c200b0029deea9c800mr5299774pjb.7.1712563242258; Mon, 08 Apr 2024 01:00:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712563242; cv=pass; d=google.com; s=arc-20160816; b=ElvsvAEsnBxDVM7e4W3Nk3jyO+NgK9hD7kB+VHDazUHdDt5lMsW6XekIv7KfFwZ8H0 ftA8GJCr9GzR6vxgqJeTJhcBTw9UXhELVSCu2zb0aL56swX7dqCuj8DOkODtTinx8GYM Iyv3X2GqnF5Qc2wEQr7F+rAofeuPvoEj1+QPSQu2sholSYEocZIWnVqcPyakYfgiBKUS Q356jOHFdRFJSCGCydpqfs2PvAbHzcF5NNDYaoL+FMAi59AjUZ05Wp5oNtfUfRP5+lE8 T1Wq+5zt+zU3u3vNrklUWDPXXU9f411D6VOHJXgOxLB5rfGKQ2IvlA+r3Qx87u4oO+x9 BDNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=RVtr28lBoOHvIvD1ov1ffDQZp850k5qzsqBjP0G6FrM=; fh=W+arU2zkfkHPWkHJM7M3EUXxbxUH2Ol/THlL/p6Dn8g=; b=XYMQjdWmILCejh+kozsQfpQM2D1xM/z8FitXuRwTkNFsMIMB93p3eYyQlQ1IhOaguM 2b12bMaRvedS3utEdNEn6tZXwtqRDFqP1CUtJEl6DBIe71J2snbNI+pn5aonrluMrexK v7xYDTdmzeWx+13tOZUj57df4ooW0L50ezi1WHPNJ3B8XMKQQB/+L86pPa8Vw2rCbcAr MIOPhwndSNrOVefh0/tjVwpetA7viIxem2fjaNTnWYX3o85ODk0pptI8hu+CMACMf2cu q7ZbFmxzvJM7uJvmBNUG7wFcZG2xv5bS6AiZ0i+n/+AAIWHDf+dP/C0YjkITyp2K4a1y rUbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=A7bDWPUo; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-134971-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134971-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e15-20020a17090a9a8f00b002a29ea7aae2si7807198pjp.15.2024.04.08.01.00.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 01:00:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134971-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=A7bDWPUo; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-134971-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134971-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 94EF6B23227 for ; Mon, 8 Apr 2024 07:57:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE28C2E400; Mon, 8 Apr 2024 07:54:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="A7bDWPUo" Received: from mail-vk1-f176.google.com (mail-vk1-f176.google.com [209.85.221.176]) (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 5027028DDE for ; Mon, 8 Apr 2024 07:54:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712562894; cv=none; b=Ui5eQ4y9S276asmKeAMmZx2B0glWntY7ZOIyfSw3jWDJEz+aKcdOBx1JlfNbQEqdSpwoYijFZdQY9X31R0PriNhpJxMcRtKajHhFAwRExkE/hz8XJg0XCbBBkVDPxls7txQEC3tQxf+Gqd+SGUR51yyVyLyKZ4dcASvmSe1xvKE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712562894; c=relaxed/simple; bh=RVtr28lBoOHvIvD1ov1ffDQZp850k5qzsqBjP0G6FrM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=NhTW/+/4hWcF2vqwvonBbG9JB1j2umhRWTANzirXxrQT8lQV3LDlzTV2vKHjC2ECgWN78ZJudaFwAuTi4RH5UWpAQlctCtfrX+FtNMJbVlTTqWzjOjuoY2tHGxPiMmltqCAEBB7OLrUsMNyZVPILr28mYk5FyWYrdIYAqNviTic= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=A7bDWPUo; arc=none smtp.client-ip=209.85.221.176 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=google.com Received: by mail-vk1-f176.google.com with SMTP id 71dfb90a1353d-4da702e48e0so1850879e0c.0 for ; Mon, 08 Apr 2024 00:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712562892; x=1713167692; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=RVtr28lBoOHvIvD1ov1ffDQZp850k5qzsqBjP0G6FrM=; b=A7bDWPUoDhvn5fZDNyearHGhAII4mPhc3cGJW563d17s4FuspTuYzV3Fg+f2INji8c nS54eAg/vj8wLHW9lpa+UnkrYuwcwPsgUUCOABqtfzoXMNyYwhxcbikgp2EhiVSXwVJg A1/clYFgtidaZmwS9LleenIPRHjRWrW8pXnGUUaHWaf8ZWURu2A0XhDRCnm3U8fr/rCD ym3GF9j8wcTdKftZNO8n5Pq0qgJ6EW81B6MBTjLKvtiVaBYsZrBzwQUfYBSi6thY0yV7 iH5536FEl3HxS+kxG77TOFVNUdvsHQy9LOgAlaLQXBDL7RzOtUKgbANY1XuIE5neyg53 lk0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712562892; x=1713167692; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RVtr28lBoOHvIvD1ov1ffDQZp850k5qzsqBjP0G6FrM=; b=SdMgFhDlKuz1TyN7m/M0m7c+h2mO0kjyCjUQYd8/KSrn0d8YiByUFVyODUhwarctTC vTUODxrjmpcR9F5uOwZ/YIl4uXaZdLP2qDhPX1yzOrmD3vw2HJVrBb8OMHTXQu8yIfZS 4KVb/XOSkhF1J059r6IP1OOgQIJf7rrnwE1Wq0Aix35VRneSrfxypiOeKLO1smTlgBud 9u0ouF30FU1gkPiC1ZBnPnr28K2O1FkO+HMKCXVdmUCQrufQJS2dEiAprFkmywKoHl7V uKNiETgk51VAquHTh3RSEJVh1+ORCLcs1Arff4cB4XrzIpe6FI1sITS/sN7CpHisCJbl zOHg== X-Forwarded-Encrypted: i=1; AJvYcCXg5WzHFWLi2rxCh4Llvd2mPl2jVO3iB8XMXV0ynxiXZgXkwFM/I6cUI6wY7NNmGZXagwYDWMXqzC18IW7LHoX6seuyurBTQAHmaPHj X-Gm-Message-State: AOJu0Yyyv1bnerywFiauTrhsNrXBBsojoFfW0QCi0jbYvbWrZapMCddY v5sPlweiouSVB/7czuxER0Mip8/SeFOixUoxC3eOZWdTvyoV0DS4kLFmWClDUXmR7oyJDdbV/aA fBLXeozN0YDQZfWZiUiQj0B0pm0Ek6GLBK/Ki X-Received: by 2002:a05:6122:a0b:b0:4d3:36b9:2c26 with SMTP id 11-20020a0561220a0b00b004d336b92c26mr5325895vkn.14.1712562892077; Mon, 08 Apr 2024 00:54:52 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240404-alice-mm-v4-0-49a84242cf02@google.com> <20240404-alice-mm-v4-4-49a84242cf02@google.com> In-Reply-To: From: Alice Ryhl Date: Mon, 8 Apr 2024 09:54:40 +0200 Message-ID: Subject: Re: [PATCH v4 4/4] rust: add abstraction for `struct page` To: Benno Lossin Cc: Miguel Ojeda , Matthew Wilcox , Al Viro , Andrew Morton , Kees Cook , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg , Greg Kroah-Hartman , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Carlos Llamas , Suren Baghdasaryan , Arnd Bergmann , linux-mm@kvack.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, Christian Brauner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Apr 7, 2024 at 10:59=E2=80=AFAM Benno Lossin wrote: > > On 05.04.24 09:44, Alice Ryhl wrote: > > On Fri, Apr 5, 2024 at 12:33=E2=80=AFAM Benno Lossin wrote: > >> > >> On 04.04.24 14:31, Alice Ryhl wrote: > >>> +/// A bitwise shift for the page size. > >>> +#[allow(clippy::unnecessary_cast)] > >> > >> Why can't you remove the cast? > > > > Bindgen could decide to use a different type in the future or on > > different platforms. > > Did that already happen? > > I think that we might want to know if the type changes, since then the > value might change? I mean, it's quite unlikely that the page size will not fit in an usize, even if it changes? From bindgen's point of view, this constant is just an integer literal with no type information. So I don't see how we can expect it to always be generated as a usize? Alice