Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1309738rwd; Thu, 25 May 2023 10:41:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5JfUXPzE/nnq+yTxAgfGt/crsCSNNLS7FOZhRMb+13P1hM4UqcJ1WwQiC4uC4w19M8Vbo0 X-Received: by 2002:a17:903:1109:b0:1af:f64c:f357 with SMTP id n9-20020a170903110900b001aff64cf357mr2977055plh.28.1685036470258; Thu, 25 May 2023 10:41:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685036470; cv=none; d=google.com; s=arc-20160816; b=k4DILEh2wPd7J/L9FiDQcIamkg46l64XqA/U9XC3nPQ1qUn7vWCryHyKIUmxv1WDWG rvFGvdQqxm8+K6ePy5XY1bsLdW5v6iptSX6AZDReO+qPnJjM8DY8ETW5YlxQ/b4Qld/m GSVXH0ICLYEeekOufi8a6rv3JKWuaEdpS63BHrfdoE2RjdHk1SqoX21BCsaFHFoQTZRY 8es6CaS/8BO8/cw6BAaIzD7TwnFZv59MRfDyGU9DHmOeCoekO99SMsVyuekdXZWpyz/b SsGIBXKzHivwcCrjlJEX9S4vFoV6jg9loNI6kWIcUAl4T4cPOVGQ+JfEY8oFxAHIQp4K tdgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=3TG2KiabOTIRDETeuidPveq5vd/DC84WzmbIAz8Xbn0=; b=V2sFh8aCUyT59C3GSSaDet2x+83lZbiWgsksBjjT9acnl5XaExYuNNb/Qe+CkCG8ZF lMnB/uBvqU0maAwH3ei/woEfY6H5k/7xZMQsA/aD7Et6qO0iUUBPq5YcQnTSMrNaISF6 FwCtKoRDHHKfqe1rbpJF4gHPWU+V8/eSFEh5YxCLQrbiO/bxN0J5bH9RGbo+miteZ6sc r/wSHDh4La2u8zEE2WMjsAaPE5nyJNIpvv0boHsxZYEXYnkgRY/KRIhryr1LeDZO4LZR CiU2FCYPwrZ5T2J6sqO0GvYzR+WoJiascQ8mpQLTlqSwjV6TkJEq8sqkrrl0N/6HVidp fJBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="g/c3t+Jt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d19-20020a170902c19300b001afdc400219si1834541pld.588.2023.05.25.10.40.55; Thu, 25 May 2023 10:41:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="g/c3t+Jt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235058AbjEYRZI (ORCPT + 99 others); Thu, 25 May 2023 13:25:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbjEYRZG (ORCPT ); Thu, 25 May 2023 13:25:06 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2D9AE64 for ; Thu, 25 May 2023 10:24:48 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-50bcb229adaso4633160a12.2 for ; Thu, 25 May 2023 10:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1685035487; x=1687627487; 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=3TG2KiabOTIRDETeuidPveq5vd/DC84WzmbIAz8Xbn0=; b=g/c3t+Jte85Hauun7NR2559wp9vRtlwRU1Ir9tnqHBR+XkmM/1G6dp1+QIxHdLgmXq 28vM+W/gx3SIJDmWcdsX6p5+IoNP7VHmHQ376lp+7Qjo6QoTOmHqFd+Zj0m6V4rbhHvZ Q7GotxjIyWBLkDgHBUBxG1XTAnwI7PQa3ApdA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685035487; x=1687627487; 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=3TG2KiabOTIRDETeuidPveq5vd/DC84WzmbIAz8Xbn0=; b=GADSzl8/UHWLtNr/NDS2slzdLddpi09yKw/uJykYKzuPud1t/Q8T+s32bf8Xcid5Wb Z79espVKIZRFeG17CFuXae3VAoImUHozh5uYs+A81vtSQ99+O+LSju7Evknl1P6m7ro+ yJavY13HMeOU7rDyHmgXZWKcjUd2Fa2w/lswj4M9rbl9OKub+/9wWJiCrcRoW4HcQQIJ ff4XQKKJifjyZJHIekOk0RUK2iS701Ffgwvo21XNsfuAQBxdBQkYVe5TTOJwsFhl6Ivk cLZfShYvofAhUZwzeDqOuS3uUmDiUOhNMcnaLyOzxwMc8MafrFY5lnsFsRN8WSflRKr3 9tCw== X-Gm-Message-State: AC+VfDyQQhHzwxLir9OEmpU/77g3Joz7bYdbKY9FgyIuHqd7zZ4Qsw3F e0NlttG82fSvJ4Mkd9bFwbkgZBDBNyP4mTu86mqljppQ X-Received: by 2002:a17:907:9618:b0:96f:2b40:4503 with SMTP id gb24-20020a170907961800b0096f2b404503mr2394030ejc.74.1685035486942; Thu, 25 May 2023 10:24:46 -0700 (PDT) Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com. [209.85.218.46]) by smtp.gmail.com with ESMTPSA id lz13-20020a170906fb0d00b0094f67ea6598sm1096418ejb.193.2023.05.25.10.24.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 May 2023 10:24:46 -0700 (PDT) Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-96f53c06babso163476166b.3 for ; Thu, 25 May 2023 10:24:46 -0700 (PDT) X-Received: by 2002:a17:907:9289:b0:96a:6723:da48 with SMTP id bw9-20020a170907928900b0096a6723da48mr1860929ejc.75.1685035054236; Thu, 25 May 2023 10:17:34 -0700 (PDT) MIME-Version: 1.0 References: <20230522205744.2825689-1-dhowells@redhat.com> <3068545.1684872971@warthog.procyon.org.uk> <3215177.1684918030@warthog.procyon.org.uk> <98511.1685034443@warthog.procyon.org.uk> In-Reply-To: <98511.1685034443@warthog.procyon.org.uk> From: Linus Torvalds Date: Thu, 25 May 2023 10:17:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Extending page pinning into fs/direct-io.c To: David Howells Cc: David Hildenbrand , Christoph Hellwig , Jens Axboe , Al Viro , Matthew Wilcox , Jan Kara , Jeff Layton , Jason Gunthorpe , Logan Gunthorpe , Hillf Danton , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 25, 2023 at 10:07=E2=80=AFAM David Howells wrote: > > Should everywhere that is using ZERO_PAGE(0) actually be using my_zero_pf= n()? No, that would just make code uglier for no reason, because then you have to turn that pfn into a virtual address. So if what you *want* is a pfn to begin with, then use, use my_zero_pfn(). But if what you want is just the virtual address, use ZERO_PAGE(). And if you are going to map it at some address, give it the address you're going to use, otherwise just do zero for "whatever". The only thing you can't use ZERO_PAGE(0) for is literally that "is this a zero page" address comparison, because ZERO_PAGE(0) is just _one_ address. Linus