Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1997063rbb; Tue, 27 Feb 2024 07:37:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVMH49RzMXX2THL6e0Ag9ImlZtegd1rri3YE8/MS0ZzCbuoqTaIPDw0ahF686FtqiddQsBsKsDhy2ERhPdIFBQFa8L+nWCYlfSpwLR01g== X-Google-Smtp-Source: AGHT+IGLUu3MiFKWdxlUYFmI/qonTPzLzZ2+qh1mKNaTPxA5/yYw2DtzIwHg11ShAAzANqJrixqu X-Received: by 2002:a05:6512:4886:b0:513:1496:1db8 with SMTP id eq6-20020a056512488600b0051314961db8mr541043lfb.14.1709048257179; Tue, 27 Feb 2024 07:37:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709048257; cv=pass; d=google.com; s=arc-20160816; b=lxnXI2zxGPsHNvERNhZrJzt093YIrlGwbNEUJVwPeJpurebfxYXkUnSMUVhirGyUXy Wg835+e/QEKksshd/S7M7OklrWIif0hWeny4iBoZYpTsyApLF07IZVZF/h69Lb4THnNe pChbx0sysNU7aTeiSlVPdYGZ+S9LW4rdC/4OAkcjeIJlPTNusp+QSDbhRRn9mTgOW8u9 p7yD0lw2fZ1w+NHwd5GCGl0wmy3WiIC3Bfw1H8IfwYmOaRBScoR3d7HmNSYowM10KgPj xPIPt4MlzDQXVwfD9Z0FtARv8voLScSY72YRwotRqy4QcoDji0rsRXK/fI2aNNS7nm4m 41tQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=048Rd0Tnfw7wUdrVUDBOkaiJ20Lu58pUzR90H15XFkE=; fh=R9ibHqoYt6eAt1zKC36cMJvCC6DaJ3zeNey4nZBr24k=; b=McNPanfJoCwry351VrhXZQ2nhk6JGqWc5HdL3UNmY6PpXt08eQIU0/DcCIpFkmxyNA LUc2v/sTCGgkaYUcEVVjuQrrHoHGg6Ny873m9fbmmcf3VTTnFqpG9/92dy8n9djUNkDZ rc3JfB9zJYYpuJvSDesw4vC8LhXGIXJVeT233xv/eT8mp9cECkZVJl8ModNySGtsRAoR wQw1lEru6NEHl15YrbJ2U4M5NscszNd/No1RzrwJ/Xw8SlRtzwnXR5vMDMV/j6NUtgDr i9/+GHTADGfinU2Og6D9ME13bwaFNJKnykbc8nQvpjGpWUlhalRYg/aNcHdzCmq3sbcR OiMg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=CE81Ecs2; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-83514-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83514-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z39-20020a509e2a000000b005661825a230si781634ede.521.2024.02.27.07.37.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 07:37:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83514-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=@infradead.org header.s=casper.20170209 header.b=CE81Ecs2; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-83514-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83514-linux.lists.archive=gmail.com@vger.kernel.org" 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 E24D71F2225E for ; Tue, 27 Feb 2024 15:37:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F4134145B24; Tue, 27 Feb 2024 15:37:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="CE81Ecs2" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 BC2F3145337; Tue, 27 Feb 2024 15:37:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709048248; cv=none; b=OYjvTX04eLCdFDAuvXGP8xxt0WGIWu5TrrD6G/ZkJE/qhonF9MgAR3W82aeCOW/cQV7o4Yy8GKYW2I2WUWSBhcXqF4JLDC6gUwYO08rSKju60IjeIwW7wGyx9q01GR0cUW1Mb7oUkI7sPZE+9/rKEFqO44tKxziiUzmRkw62+VQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709048248; c=relaxed/simple; bh=X81n8MnRy+roWIGU70795zeVAGENQmKZ8zQ4q9p1YG8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CguvW4fiM0ZGs2uyKqDawRbni12PAJN91QfOiSWQMvawqC232RUB13J/Wy38lNVuLJIS8e8QkUkEqRENVo5sVTzzOjDURsu2vv61Gl0UILtMYPbSVS9UNfrsrAhzPMrpgK4O5lv38U3sDazX2pinqbKYg2oo+esmXWeOt6LXE8o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=CE81Ecs2; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=048Rd0Tnfw7wUdrVUDBOkaiJ20Lu58pUzR90H15XFkE=; b=CE81Ecs2WMvq5uJ4+l/IRss8nC cPO8AUcaqJV/X10HslcSeuRVYnBOqXQC7AeQYm6nPeryy/k+r7WspXf23n2wHzDQ1j9kX5GrSbwyP liiVgkvDPg/CTZL7M9vvERLT52Smk7Vpjeyx0ieaj4WtsukEUykYWpTCkxzHYmVEj/pTE2sLNLPv5 z+7+tf2QUpUy3QdICA+EgCoN6pNma9oXxOjyostxHd8gmAB3HKiiM//a3K+Ombv4i/PND2Q9Xe3rj FgWfrqlgYPkOKTBpZMtGSOQsbRldl66R/rSQ5AvpHG7IOiPMe6serX2FTErKR8jo0INoJz4wZm8SY dFbvABwQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rezW3-00000002jiD-46dS; Tue, 27 Feb 2024 15:37:12 +0000 Date: Tue, 27 Feb 2024 15:37:11 +0000 From: Matthew Wilcox To: Alice Ryhl Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Kees Cook , Al Viro , Andrew Morton , Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , 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 v2 4/4] rust: add abstraction for `struct page` Message-ID: References: <20240208-alice-mm-v2-0-d821250204a6@google.com> <20240208-alice-mm-v2-4-d821250204a6@google.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240208-alice-mm-v2-4-d821250204a6@google.com> On Thu, Feb 08, 2024 at 03:47:54PM +0000, Alice Ryhl wrote: > +impl Page { > + /// Allocates a new page. > + pub fn new() -> Result { > + // SAFETY: These are the correct arguments to allocate a single page. > + let page = unsafe { > + bindings::alloc_pages( > + bindings::GFP_KERNEL | bindings::__GFP_ZERO | bindings::__GFP_HIGHMEM, I thought I raised this last time, but this is over-specialised for Binder's purposes. Many places that want to allocate a page want different GFP flags from this; they shouldn't even be the default flags. So either what you're defining here is a BinderPage, or new() needs to take GFP flags.