Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1283467rwd; Thu, 25 May 2023 10:18:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4DiaswmHr1oEVuD3Xgb9ypayD4NbeOcFRh7YlBcv+mLd97MiTMysLC65EqW174+hvYz8Cf X-Received: by 2002:a17:90a:f308:b0:255:2dde:17cc with SMTP id ca8-20020a17090af30800b002552dde17ccmr2376258pjb.47.1685035138928; Thu, 25 May 2023 10:18:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685035138; cv=none; d=google.com; s=arc-20160816; b=H6E4ttnPsV/PcTJXVlauwmPcuvm+wM5tq8WesnG/3a/Sh15pMHLpEBHW7f2So2K0/2 Mf4l69Vm1y9//Nl3VMoc+PDsGn0PCFhXJ0bindExCf+1h1rcLdoQ8+ay3pzYSW1kL0rz wGVJ200DN9awx1krv8vxWsbTUXl1ZkUxyXm06UXm5A1uxiY2Vd1njgaG2F1fCnT4lweb He0thCNw83/ZB+0hu9lro3/c97oVgkdxQviR+0QuqCewAB08a6Dx7N85dkTvg4gfJTE7 t8+2i50Pn76kICVhes8DPUMG8i/I2JUC2YVu/RcOlwOfFoN6gEP+sGhzto1ntBXNEC+q 5HpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=L96rFIYpIHHwiFX7796wWwBgjlxyxPuCZajU63kNJnw=; b=C0zx6NLBChc/QRRINyPpt6cfBGCE7EdW7z2oiu0Ch/goFvww/yhiWNbcdGV/GkyiZM XIsgbDOj4BQ00FCWfU0JZDfF7H4V6bHfMLHpzz60wLld79+n8P0OPu5zmpd3NTggTtBJ kzeZkOYJ28f8A07pdYg7NMS3/NZz8bssUGlBG5b6L2oc83y0d+BCzq7Ufaa2lpCG4wrn 578Jb0bXJwitTf2PBTVJlH22uJ6gmFB7Wg/wmsy8fknmf/WID9BkNcFTntBnSQrsKd5K IJ31zQb3CtzmFkcJT9MCsl9WKgGg+gyAdFhDkxq6ZKRUrhtEFOzjLoM+BekN17Vsch3i EIiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GbsQLmHz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y13-20020a17090aca8d00b002533873625dsi3206238pjt.24.2023.05.25.10.18.46; Thu, 25 May 2023 10:18:58 -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=@redhat.com header.s=mimecast20190719 header.b=GbsQLmHz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233441AbjEYRQI (ORCPT + 99 others); Thu, 25 May 2023 13:16:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233736AbjEYRQG (ORCPT ); Thu, 25 May 2023 13:16:06 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4EFC194 for ; Thu, 25 May 2023 10:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685034923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=L96rFIYpIHHwiFX7796wWwBgjlxyxPuCZajU63kNJnw=; b=GbsQLmHzJxACqSzpFybByzi6FOE8TeD6AO2kmVKseuA+EP4m81tep9AbFPO48T8U3ToJil XzVhNHVT7dL1xcsKnwZM1z3UOjjVoIrMT3BHiF32vBWwS+tmmRDdxtjZH/8AfVepL5I+oO fgDf5qcW87q0vyQX/iQfyM6PRl34Kio= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-119-ucjSGAbKP2aGgyvrpvU2oQ-1; Thu, 25 May 2023 13:15:19 -0400 X-MC-Unique: ucjSGAbKP2aGgyvrpvU2oQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 16E508030D8; Thu, 25 May 2023 17:15:18 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.39.192.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0A8D492B0A; Thu, 25 May 2023 17:15:15 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20230522205744.2825689-1-dhowells@redhat.com> <3068545.1684872971@warthog.procyon.org.uk> <3215177.1684918030@warthog.procyon.org.uk> To: Linus Torvalds Cc: dhowells@redhat.com, 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 Subject: Re: Extending page pinning into fs/direct-io.c MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <144596.1685034915.1@warthog.procyon.org.uk> Date: Thu, 25 May 2023 18:15:15 +0100 Message-ID: <144598.1685034915@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Linus Torvalds wrote: > So I suspect we should add that > > is_zero_pfn(page_to_pfn(page)) > > as a helper inline function rather than write it out even more times > (that "is this 'struct page' a zero page" pattern already exists in > /proc and a few other places. > > is_longterm_pinnable_page() already has it, so adding it as a helper > there in is probably a good idea. I just added: static inline bool IS_ZERO_PAGE(const struct page *page) { return is_zero_pfn(page_to_pfn(page)); } static inline bool IS_ZERO_FOLIO(const struct folio *folio) { return is_zero_pfn(page_to_pfn((const struct page *)folio)); } to include/linux/pgtable.h. It doesn't seem I can add it to mm.h as an inline function. David