Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp720037lqb; Fri, 15 Mar 2024 04:55:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXQYqkkyr8DsAhc2HXvq+es6vaVbO2IdueuEiS4ZCipGTawgLQ+ev22XZTGkd/jJcnLfIvGOPb1kkhW8rUsUr81rfjEV7fe7AhgSSzKRg== X-Google-Smtp-Source: AGHT+IEGnhYQYEaua7xldZQqL8Dye/YlD2lnNeQ7VAgdUbT73CmoPKXmxXQBWXWfXBVW5m8F8oz4 X-Received: by 2002:a05:6358:d5aa:b0:17b:416a:38ba with SMTP id ms42-20020a056358d5aa00b0017b416a38bamr5304090rwb.26.1710503724049; Fri, 15 Mar 2024 04:55:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710503724; cv=pass; d=google.com; s=arc-20160816; b=yZ4e5dwoq81/RQnTqpfFhJ90kRTKvAbzUUb6rPpLIGnGiBmvO3ysmezt+xrOt+TEAR 5Wo+TMJTTXvqr5VpUG8EhYd5TihnlTracv3oEfMhlqAcNBcmjjthC5jw8yUm7Kj0dkSG retcLmA+mGWcCW2R20R50Blpa8DV5a6pHpf+WP0yh6L/pCUuoMJwHRw/m1MUhZCqPQq7 Q2L9y8xUIvSGe4iLwO1AW5MjLkAmrkO3GwFjgPESjHFzBMVys40Uvgkz91vOQ0LHWq/V jGee55gbsAd3rE23CoyndM7Lcqf9HwohDDZ/9eHetAHsfpwjJmJJ1O8Aaxr9jiMpDujt MOWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:user-agent:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=G3LXo/8SAPK1qMap7q7cDulVLMuCk5g6x5WEmLjyGwA=; fh=he9QfjxpHargKNNrWk4bs+MSnNcyIw+8of5oB5q4uBc=; b=KhnVisXRc6G2ISwHWgAFpyJMOvDKMjXBo53lcpo1FW3QzhJHHc3cJCDFUMMk3iCdMT g2HloSEqtfAWX9+nElfI/OfQgw5ezE6iiUpuDrAdhmaA7EKiS2svgx/sp/NcelyfoeC5 kBt7HGsPYMyQd3/gbB2vfpbQ4WzQvJ4kX63Ed9Gqtt31lfwjoDkveRbsfqC4mriBT0Yr zt6UZVQrwOG8mw7Fp+CmjCctfyDWHmrIZpeeB/6R4WDrf6o8e7hmzyVCZ4sLZGbtnfzQ cNhFhORPMl/9xoAnRtb0ohM02QPZCxY/n1Uar9TKE404y/6VgbfvMzn4Vd1//AXbPQgp 0sFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@metaspace-dk.20230601.gappssmtp.com header.s=20230601 header.b=JqQvmBGC; arc=pass (i=1 dkim=pass dkdomain=metaspace-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-104150-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104150-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z27-20020a630a5b000000b005d4cd6a0aaesi2140504pgk.398.2024.03.15.04.55.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 04:55:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104150-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=@metaspace-dk.20230601.gappssmtp.com header.s=20230601 header.b=JqQvmBGC; arc=pass (i=1 dkim=pass dkdomain=metaspace-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-104150-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104150-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C3ED9B22592 for ; Fri, 15 Mar 2024 08:16:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0B985168B1; Fri, 15 Mar 2024 08:16:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=metaspace-dk.20230601.gappssmtp.com header.i=@metaspace-dk.20230601.gappssmtp.com header.b="JqQvmBGC" Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (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 69DDD15E88 for ; Fri, 15 Mar 2024 08:16:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710490604; cv=none; b=PUrhzd/ni5kAvslSRnTfT2OGHCo1WywEBS1NkfEuMaMPgrgbPL0rMFwsSu6Q5zh4sYMxntLrLlZ93LrPn9SoVlfeQmUCyPPTsmMJzdVqmLmAsPt4XSz4QLOpmwwW5YyNm3z3//nS+qezx/WSx4pcbLoy93msz+bYigCGdD/gBi0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710490604; c=relaxed/simple; bh=G3LXo/8SAPK1qMap7q7cDulVLMuCk5g6x5WEmLjyGwA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=dgQmcGt+EaJka2pTiOkjNJZsQ3ukCfGx/B6n+aysOH9mjfQSNR4v5X+Cf01ietyIstir59agKi8OvjkpL62ZNArCtOCKpRYjwElMKLDHcZD4/SmP6j53perNqSsbbwaLbhfLVLWo0LZk46iOJ+6i/hibVfbYBRbb/QzF7GXt6ms= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=metaspace.dk; spf=none smtp.mailfrom=metaspace.dk; dkim=pass (2048-bit key) header.d=metaspace-dk.20230601.gappssmtp.com header.i=@metaspace-dk.20230601.gappssmtp.com header.b=JqQvmBGC; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=metaspace.dk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=metaspace.dk Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5687feeb1feso2069936a12.2 for ; Fri, 15 Mar 2024 01:16:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metaspace-dk.20230601.gappssmtp.com; s=20230601; t=1710490600; x=1711095400; darn=vger.kernel.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=G3LXo/8SAPK1qMap7q7cDulVLMuCk5g6x5WEmLjyGwA=; b=JqQvmBGC84yhzO7ANXvhDbUV9lL95F4ySMxh/FXyCOv/UB5QBIBL1QmNLi+KEUbev4 XJ0QbmSeYaBDhCA+nfqAtH8xt5Y7m3TmelTJ01pQQX79KhzHOurXWs34y0d4Xk0cReZc nQV3MYyrhEik/+r1dN9BhZNY1Q4bXH0ktIbT/QruxnULyCrPb9NEFVz+PL6TzcQFERUC zbwGNhoFaiPeRseTBN5z5Q5ttUTCFH3ODM3E/G+kjzFVrS/yATQKSp2JblBmZeyntgsJ TeCIO1fnah58GaoSPFGoDBL1W3WUQmXiy3WLzTTNhMnrv9zSz33ONI8pSO/QRxy96kDK gD2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710490600; x=1711095400; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=G3LXo/8SAPK1qMap7q7cDulVLMuCk5g6x5WEmLjyGwA=; b=In+6dWGFUUJhhKMVQ91b22JF2NxRaLCmpvW86sN/G2ABui2ZpAbCxchGtX/VEKN+rU DOEAUr0rRfcygfn4t+vlXx/1qD5qnqwyE0DwitxFn84fJe+2zPsp2Pa1A0oKNolUkdMs 3g5pzlV0WqVeQhL130g/VER0J52W2MCLk+VljJMrLbX7tmvnLGBG0VD6ayYlA1wDknIj cQp6QJF3EbY6a8toycMwExyznLMkbeo6oNYrwHqJVpeDe0zGtiel+Ulmux4CcJYp5q8b +8tL0aviI257KrG9hXY3nN6InyYg28AF0kgHg03EM1TrBFPaFdSTQ1TgWgtXLta0Eo7/ /15A== X-Forwarded-Encrypted: i=1; AJvYcCVp3h3RGDZlerg3A+Z8NYFXzHG6E0qFVNK+VnIQEYDxcPVjcqx30DgCU3Ln00ZnIu+ArG84xNUaYBF5oL5xiL/oKSKQKZrTLZD9xPYW X-Gm-Message-State: AOJu0YxE1ZOx+suRAVgFXRaY3pr3WRe1/Jo03W44p8jbHeUEJWIB40cn 12bD0kbWU+KHb+bV7YM/t4uyGkQJFWI9sEFcZvscDJd88wEMIAoCRVn9uS/Q+3o= X-Received: by 2002:a05:6402:28c9:b0:568:9e92:2847 with SMTP id ef9-20020a05640228c900b005689e922847mr2213502edb.40.1710490599758; Fri, 15 Mar 2024 01:16:39 -0700 (PDT) Received: from localhost ([194.62.217.2]) by smtp.gmail.com with ESMTPSA id q12-20020a056402248c00b005676dc74568sm1451876eda.92.2024.03.15.01.16.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 01:16:39 -0700 (PDT) From: Andreas Hindborg To: Alice Ryhl Cc: Matthew Wilcox , Andreas Hindborg , akpm@linux-foundation.org, alex.gaynor@gmail.com, arnd@arndb.de, arve@android.com, benno.lossin@proton.me, bjorn3_gh@protonmail.com, boqun.feng@gmail.com, brauner@kernel.org, cmllamas@google.com, gary@garyguo.net, gregkh@linuxfoundation.org, joel@joelfernandes.org, keescook@chromium.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, maco@android.com, ojeda@kernel.org, rust-for-linux@vger.kernel.org, surenb@google.com, tkjos@android.com, viro@zeniv.linux.org.uk, wedsonaf@gmail.com Subject: Re: [PATCH v3 4/4] rust: add abstraction for `struct page` In-Reply-To: <20240311105056.122734-1-aliceryhl@google.com> (Alice Ryhl's message of "Mon, 11 Mar 2024 10:50:56 +0000") References: <20240311-alice-mm-v3-4-cdf7b3a2049c@google.com> <20240311105056.122734-1-aliceryhl@google.com> User-Agent: mu4e 1.12.0; emacs 29.2 Date: Fri, 15 Mar 2024 09:16:32 +0100 Message-ID: <87ttl7rjtr.fsf@metaspace.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Alice Ryhl writes: > Alice Ryhl writes: > > Andreas Hindborg: I recall you mentioning that you also needed an > abstraction for pages. To what extent do these abstractions fit your > needs? Which gfp flags do you need? > I based the block device driver API and null block driver series on v1 of this patch and v3 should still be good for that. The null block driver uses `Page` indirectly through `UniqueFolio` with `GFP_KERNEL` alloc flags. I do not need to customize the flags outside of that. As an aside, I added methods to safely operate on the page contents [1]. `kernel::block::vec::Segment` indirectly uses this to move data to and from pages [2]. Best regards, Andreas [1] https://github.com/metaspace/linux/commit/e88f4dc928233fcedcb0afec40be9bc2f8f74e3b [2] https://lore.kernel.org/rust-for-linux/87y1akso83.fsf@metaspace.dk/T/#me6497ec69544efd21908f1acc6b3a1ab8b148ba0