Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2006843rbb; Tue, 27 Feb 2024 07:57:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWOLHzQUp1+Cr51kcJsARf6cb1uRxoUDi6B1IWcD7oAjYXX6x/ggcVsHq2oq+pATiqx1n07znOV1E09lFk3fEO8wX8JmEe+MheZS/2xdw== X-Google-Smtp-Source: AGHT+IFFMB0BytcxtTf6l19bHPg+cePG7Cetx4A52bO6ikq8zh+CtmlbKtbQRXATpkjjrSs5VqAV X-Received: by 2002:a05:6870:1591:b0:21e:b315:ca47 with SMTP id j17-20020a056870159100b0021eb315ca47mr13320789oab.12.1709049434792; Tue, 27 Feb 2024 07:57:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709049434; cv=pass; d=google.com; s=arc-20160816; b=gSi5PxhFXfm+k0AOuy2n/QJD8I/rh1uOTGtvrd3pefxsseOb9U2XZLQKRsblZg/bAw JW8btMBFP8/lc+hTNbs00QPV1zCAuiJhI7iGvnpdg7IrU8ENEW7frUWFAZuhfApv3GfS +Fhuw/CCNKszaP5afYS0NkDmC9S02THlr+bcVKGLPx4VGlIAsp/QznNhnGfkdq4MPKbc sOk1qCSlnw86bZG8peL9p/zXvY3M9H0es+0YIBTAZqAh9ngLv/H7nyyZjcg6lXqEfzDk F6U2Tuhu8+3ZWoNBbTJosYXmN6wyJCO3w/tbYNEkGM7z4iB5bBmwak5YmfBx88aZeg3E 8kQg== 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=Zz63I5jGJam9ziTsehsBfrmLZXVDff45p8Sdh7Rb40k=; fh=QNba9vwEtVhNyDXieZboqC+qxtEjQlHhgQUC9kYrgNs=; b=e38PAme7eCZtH0RDzHs5A+ccMMJmDXtTVQOSXrnyweVOkxSrlipzuSUc99XUu+AJzv 2axWFk6lwBKFRCRjC4ySmZTZnc3EhWlBtaUWeUxbewmuWHvWa6cKFTuaR1RODOGws06X OMCSdXOAyE4MeRaQPJ7+vA7OGr3h07bwkPajSw9dCp9nGb4LAgiFHHs3Wx2tzYY83kla G0ikhPL5Z2gKKlnyWxx37dfNZCWwl01AZG38lDW3TZWIIpccFjXLFatvz9I80lTcSRP7 I1lY74pvq9Wnx4mTFZq0woodRUvmdH3nqcP80HoIyrgknJA6vO6Ll9N5MWviWAIyMtqL v0QA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=jbtFR3yS; 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-83557-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83557-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g22-20020ae9e116000000b0078553d900c4si7422824qkm.73.2024.02.27.07.57.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 07:57:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83557-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=jbtFR3yS; 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-83557-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83557-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 878681C221AF for ; Tue, 27 Feb 2024 15:57:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6DF0F146915; Tue, 27 Feb 2024 15:57:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jbtFR3yS" Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.47]) (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 C56D51468F1 for ; Tue, 27 Feb 2024 15:57:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709049425; cv=none; b=UNAxh3FQ1YLY4kMpI/DOvPRO832Jbhc5iIIwUi8h4HRT7gBs2xDzSYuoU0v3229piUnwumP6tYccHqOzlfy0UK06Yx0eVa2hrVD3hMVEbSoFusdeB1kZ/KDaRz0uMCsTrlxX717UwoGykccIQuTF3bQuiJf6JshbeZIdL2Sp6Lo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709049425; c=relaxed/simple; bh=T8GmRBHe54nbmuaPkv00EKb3E1ieTIbnwEGf8I18sXw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=NA6M0setqe50vrvCzgIXMAVPOCnlIwGv8jy5VyB1ndFRwanFQ2QIHF2Ky2IvWRz3TE7LY1rK0Yjdepe5f9PKl5/02TrGKa1tK8hmgMebRM3giz/4/1i5uOaaC/RssASsFqgsxEwJerDuZ4oTvLXBy7/bt54aTzY6Aw8UpydKkXg= 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=jbtFR3yS; arc=none smtp.client-ip=209.85.217.47 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-vs1-f47.google.com with SMTP id ada2fe7eead31-47048ea1b17so536413137.0 for ; Tue, 27 Feb 2024 07:57:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709049423; x=1709654223; 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=Zz63I5jGJam9ziTsehsBfrmLZXVDff45p8Sdh7Rb40k=; b=jbtFR3ySdR2r1CYCDZrNEI1eSFVDrOtIVvMc+mFCzmBcA42twZojGMt6JqTBIYO46R ythFyksTfqlHsfx6rkSf/NadLNff2gvVeJMLHPuJN+9y04c6OmWtbPAWiJJyOz+lZZmy ZQ4Svi5lkV7blL1xJUWpuBEmhSEqqzRXhr8UAJ58SCmcoM/DuHGr+1FWRfb8D6upyhHe 3Qoyz7BGeZJYPmA/mSj5y8ZSIanwrwZ2MULJWm2vGxECIpwtGpsbLpSFiCZ7w1DeyOiO t9BuODeTeLALNY8YmO8r74/9TC0ajRsy4F3vFCfbacBEln0Zl71gWMQfC75RwCFF6gra Qkyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709049423; x=1709654223; 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=Zz63I5jGJam9ziTsehsBfrmLZXVDff45p8Sdh7Rb40k=; b=PKAqmejEoN3lslorUAc9ewKnkJA5sHhJpA0TX4II0tsctIiHODUV3whIOKkZiKldTB csWWGgFc9MDgGQrqLNYZDxQOGko9l7ZRkxgf5L/8xMfamk298r/7+EBC9XB9ZH3CuYyA ewMZMNwQW6nuJk7Xc4CjfKZn8tWDPSaY+oMuEFKiMU9Rpko0KU/nEqf7pkxz0Qk6tDeR Eb2Onv/ypqt0eWiXU+T6DrqQw4J5quNqpxEhXDafjLRTiXtFjgWUf5hIhV7UN79jQ3fA fuc2kGBj+V/AsmOItc91PBwsYq4HxCu6PiUiumEeaFz4gH/nmPOx7s2y0+J6FgkRwKHA 5FPA== X-Forwarded-Encrypted: i=1; AJvYcCXr4PekP5qucQzMyANZ1QalMhoGzoWAicdgrFA8alMNyqqbTouGlxFsdiMUamU7W6teYZR8mhNT2/tT/JZll2Bnasp/3fIXiO6qg09k X-Gm-Message-State: AOJu0YzfsxqnASuMX29SCPNJ6k8hKSwCfaNKpDThmdtxKK23zsEoTcDJ etzWHy710z/9Y2GAH87arncgAtnSHZV2k+9BeOSNUn6dyGe4z9d4j41aPDjVxMtsFW17kyBFEgv /5KYpxW78q43+CPLU/evKFnm6CscPQ4rZM4ac X-Received: by 2002:a05:6102:f12:b0:470:3eff:e755 with SMTP id v18-20020a0561020f1200b004703effe755mr9887738vss.24.1709049422611; Tue, 27 Feb 2024 07:57:02 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240208-alice-mm-v2-0-d821250204a6@google.com> <20240208-alice-mm-v2-4-d821250204a6@google.com> In-Reply-To: From: Alice Ryhl Date: Tue, 27 Feb 2024 16:56:51 +0100 Message-ID: Subject: Re: [PATCH v2 4/4] rust: add abstraction for `struct page` To: Matthew Wilcox Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Kees Cook , Al Viro , Andrew Morton , 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 Tue, Feb 27, 2024 at 4:37=E2=80=AFPM Matthew Wilcox wrote: > > 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 singl= e page. > > + let page =3D 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. Ah, yeah, sorry. I never got around to figuring that out. I can change it to take GFP flags. Thank you for taking another look! Alice