Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp881081rdb; Tue, 30 Jan 2024 01:03:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHoWar0NOkpolu2pcSkhbKUqOPlM98EJkj/DxqzqWhy4fr6sF7z5qSxQEp6lxJH5JPZIZTL X-Received: by 2002:aa7:d052:0:b0:55f:3cb:9cfa with SMTP id n18-20020aa7d052000000b0055f03cb9cfamr3100175edo.30.1706605397994; Tue, 30 Jan 2024 01:03:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706605397; cv=pass; d=google.com; s=arc-20160816; b=J3L+4f2Q7G/jK4CWENd552CX3Rn0gEwHm50ziVirZcSEtLnF+RFDyZbFQgrGAuCsiS RA92q41QuT2NaSmBs5GOPKz0KCn3cDnKD7bNGPcmQt7y/wlEpqXF+fYNIuRVMXXmNVT8 xmE6u5k6NUuhKHdbw0m+/rVG3WVtLWE9MrbzlZbMBBiNQPg+BBjF3A40+EI8XMv0hGhr LnHmED0EPReFe/cbq833xMWGb1RHTToM0JwmjTOh28gRleZ9+yex2Pk74wTtckkHLSIv sl9e2cKuFMzpj9DBgBj7c+6XdtyuC2+17Ej9hEx1gH3NYReQ7oUhouENFF5C7q6XgbtP JuHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:cms-type:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:content-transfer-encoding:content-language :accept-language:in-reply-to:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature:dkim-filter; bh=u5skJTC1NiSxxvHS0YUB/jwBwTXaDHnBS1B0psxcAog=; fh=S2LdejTsADTXKdzPE3DwTtAPD1gbKkmFaY6CJwgttI4=; b=O6x22lYYl/g7VGWWXGzrj/YFR1N80D7BYAZJUy+2cO2c9gQgM8wMGyn0QJCveQBXG6 baX/JV4iajTWibstZ2xPElrODrLGXMXLcsDHi9fc6vABKLNg6rnyT+v/cZs2SEfaVa05 naQYD7jWIVVhOWFsobmexCz/L6lNSH4AYXyIpdhjJRRghAr0SiVROq8LwPgn1DbHwEsE DqT/WI0ZIwysYNY1+GPsJFSKc8YfBGO8tGGDg1+f9tcGXjNcZA7Hj1dFuySBc2oO/MpS /+fPfQ4R+mJhtln2FC5OBjg/Q84ijVWgCWy5BvF9uan0iAd//rNy1KFgnC5LAargCBue b/6Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=femepWid; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-44192-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44192-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q30-20020a056402249e00b0055ced896819si4640012eda.212.2024.01.30.01.03.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 01:03:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44192-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=femepWid; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-44192-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44192-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 927651F2AF22 for ; Tue, 30 Jan 2024 09:03:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C72515823F; Tue, 30 Jan 2024 09:03:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="femepWid" Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (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 96FCC5813B for ; Tue, 30 Jan 2024 09:03:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706605388; cv=none; b=Dd/xMGj1I4qlq5shVzfLl3B3mkfPhjZUvsxxUlD3CS9zREHypu5c5bLGww+hfZxKCs+yjy3AILKBT1gspH5ALs/PLRRIrQUBoGOv6Znc4m0Iu+5TXtbG+q2idH8spTFNnLz6uLR9Pps4Ii++uxGdJ7pbSOoiP+/v1BJZA/X4U48= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706605388; c=relaxed/simple; bh=BEcq/qhqoqGZggGlJrW/V6J25+ggKvqtaGOMG4iq9qI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:Content-Type: MIME-Version:References; b=tCeBw/YGZG3wQS2SsxUw32S5B4EysUqDzKH6ibMXGAeGToLdVUuIiPBRzSqVsli8blMXJ2ygiZ4+qhLVXCFexC2IxhLU4T5+zX1X6+7/MxM9zVY3N8rKqD2uTwu3FB/hu/7G5VPfK37MEJ886TqQK2tXsZ68aspfw3HJcYSZX2k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=femepWid; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20240130090258euoutp02ef20137f78992f8e38578891ba0dbe7f~vFIzOX6SQ2650926509euoutp02f for ; Tue, 30 Jan 2024 09:02:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20240130090258euoutp02ef20137f78992f8e38578891ba0dbe7f~vFIzOX6SQ2650926509euoutp02f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1706605378; bh=u5skJTC1NiSxxvHS0YUB/jwBwTXaDHnBS1B0psxcAog=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=femepWidQ6EJHN5Aj267qrGtF2Jj7X6duSAVhyRkcrvlFpZIedfxS0i9+vGOsH9mH CLvI/Rr1lyfxVC0AdGP3i5yLHHTN3/vIXPxXWveiGws8JsTewSgggmcU1ijYvcYvHc 9Fx00Ywvq0bR/hzzDjpxC1SQam69EF/PqyoYvwDs= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20240130090257eucas1p1c595c555b393cc3c01079203e10f2e1c~vFIxnu7vV1567115671eucas1p1E; Tue, 30 Jan 2024 09:02:57 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 67.24.09539.04BB8B56; Tue, 30 Jan 2024 09:02:56 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240130090256eucas1p1f65f4e34dbbd7dec2ac619b7b60ae073~vFIxJt5-O1387013870eucas1p1S; Tue, 30 Jan 2024 09:02:56 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240130090256eusmtrp11bc05448befd85e707a393fc56944407~vFIxIkU4C3128631286eusmtrp1E; Tue, 30 Jan 2024 09:02:56 +0000 (GMT) X-AuditID: cbfec7f2-515ff70000002543-bd-65b8bb40e463 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id DF.1E.10702.04BB8B56; Tue, 30 Jan 2024 09:02:56 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240130090256eusmtip10e72268538ab337e757e9fc1dd96fbbd~vFIw7uTDP2109621096eusmtip1F; Tue, 30 Jan 2024 09:02:56 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 30 Jan 2024 09:02:55 +0000 Received: from CAMSVWEXC02.scsc.local ([::1]) by CAMSVWEXC02.scsc.local ([fe80::3c08:6c51:fa0a:6384%13]) with mapi id 15.00.1497.012; Tue, 30 Jan 2024 09:02:55 +0000 From: Andreas Hindborg To: Matthew Wilcox CC: Alice Ryhl , Miguel Ojeda , "Alex Gaynor" , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn_Roy_Baron?= , Benno Lossin , Kees Cook , Al Viro , Andrew Morton , "Greg Kroah-Hartman" , =?iso-8859-1?Q?Arve_Hj=F8nnev=E5g?= , 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 Subject: Re: [PATCH 3/3] rust: add abstraction for `struct page` Thread-Topic: [PATCH 3/3] rust: add abstraction for `struct page` Thread-Index: AQHaUD8NVXQbcxmBfkinu8UJuZg2mrDxGW2AgAD5TwA= Date: Tue, 30 Jan 2024 09:02:54 +0000 Message-ID: <87mssngpnc.fsf@samsung.com> In-Reply-To: Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02Sf1CTdRzH+z579jwPQ66HgfIVJyV3ZOkaQv3xPTQk666n6Ad6R2dJxpQn kDagjcHUrgZ4mLQ8AzthoJskILQFzW2YgzYH8UN+GGADOTDjViegKaAZEBjbgx3/vT73fX/e n/fnc1+KJ6wjQqkDGdmsIkMqCycEuK1t9urzcfaL7BZD71ZUUW8k0EJ5I4k6BvNxtFDcRqK7 C78R6J47n4+GfnHwkNGSh6HJlmmA7jv7SdTXPQlQwbf1BKrWRKDuL+Vo4FIFgW4YH/GRzajh o1p9DUD1f7bwUEm/gUAG9xyJri6081FDtQmg+X8qiDjI2Ow2PjM/VwyYck0fzpw7NocxP+pG ScZgVjEXzm9izk4/4DPmumMEY54uJpmO0nmccZw2kszDo00Eoy00Y8yMOYwxe+5gCfT7gm0p rOxADquIjE0WpLmGvsOz9H7qL0xTQANmiSLgR0H6RVhZ1IkXAQElpM8DaLOdAVxxH0D98PcY V8wAON44Ax63LBoKMC8L6RoAr5k++l800HOD5Ip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1f65f4e34dbbd7dec2ac619b7b60ae073 X-Msg-Generator: CA X-RootMTR: 20240129180005eucas1p1c1962ece31e6b9619f9e22dc95f54087 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240129180005eucas1p1c1962ece31e6b9619f9e22dc95f54087 References: <20240124-alice-mm-v1-0-d1abcec83c44@google.com> <20240124-alice-mm-v1-3-d1abcec83c44@google.com> Matthew Wilcox writes: > On Wed, Jan 24, 2024 at 11:20:23AM +0000, Alice Ryhl wrote: >> +impl Page { >> + /// Allocates a new set of contiguous pages. >> + pub fn new() -> Result { >> + // SAFETY: These are the correct arguments to allocate a single= page. >> + let page =3D unsafe { >> + bindings::alloc_pages( >> + bindings::GFP_KERNEL | bindings::__GFP_ZERO | bindings:= :__GFP_HIGHMEM, >> + 0, >> + ) >> + }; > > This feels too Binder-specific to be 'Page'. Pages are not necessarily > allocated with GFP_HIGHMEM, nor are they necessarily zeroed. Maybe you > want a BinderPage type? Rust null block uses the same definition of these flags [1], so there is at least that synergy. I feel like we had the discussion of the flags before, although I can't find the thread now. I think the conclusion was that we fix them until we have code that need to actually change them (as to not add dead code). BR Andreas [1] https://github.com/metaspace/linux/blob/702026e6645193fc89b7d55e00dac75= fd492bfb8/rust/kernel/pages.rs#L28=