Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5201792pxb; Tue, 28 Sep 2021 12:49:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2MvVs4vB0YZA7mBdVl1QRPJuVVRFzKMfbg8x+aBYY2GjES5Fk/re48pSndtc0dqLIdZcs X-Received: by 2002:a17:90a:708e:: with SMTP id g14mr1932367pjk.214.1632858561246; Tue, 28 Sep 2021 12:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632858561; cv=none; d=google.com; s=arc-20160816; b=XZ2YLTclfF8Eg82o7ZRItjQ4VjQDL8iMaQioSwP6K0njD9ChtS70p/6gJsNkfvPIso 7Hry+Z/EhlBRl7g1DYOi8RcJoII6yPefkCQeJGW+k0n5uu9OGdWPd6gtBtTSr3cZzZVn cyQ5fEm/jxGZ/2mXz3D+BCFDKHCzoZIyE8AvoSgse9e2eSa267cpk06iO/oIUP5QISqd 5Upz4Rp/dfF6sSrW+nrvAXz38RAGdJoApbjqqIt0ASWJslii/fGcJSvCHoGUbBaH9gT3 ztEzRcGQJOylF8y07vy2qfD/a/BVgxEJqIN+L0Eg3ChZuX73Ty6HU2k0NWrAx6TdXwIw XjEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=EVzDoSDqJZmi4ToqJEIddbvRD+vlWsRISaT7f2OXukE=; b=X/iViX4DSQVAY4M75qHFkEpUGdHeW0sBuMga5+69L2xebQ4PeTJdKRePCTURPxE2/7 M7IYi6b35uOXG+RUMO3Ydmknw7fbsv7QoEeYp3ueJa2vXeNbUafmxhuFc801roQofE94 89VqFlMTCCRpf5OP42svnxbq3KJMDutZ2TJjHCWZbGEHvuGzQQkpcTGQBsniMQ80nnwX X2k9CGxyO30S1+LUAlO3F+Pk1JiuKzREM3RzSvPgAumemNUi0/nisOuIeEckrM0hPIYA SC8MiDZ9Yz8Bc90w84Kf99C0xe5JzwizUU46j7xDMt+rS1ScU6ZvBIsYWrZbxrnSYxG7 Hxjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=EO1kDwze; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gm23si2784814pjb.104.2021.09.28.12.49.07; Tue, 28 Sep 2021 12:49:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=EO1kDwze; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242470AbhI1Tsu (ORCPT + 99 others); Tue, 28 Sep 2021 15:48:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242529AbhI1Tst (ORCPT ); Tue, 28 Sep 2021 15:48:49 -0400 Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6341BC061745 for ; Tue, 28 Sep 2021 12:47:09 -0700 (PDT) Received: by mail-qk1-x72c.google.com with SMTP id i132so42115355qke.1 for ; Tue, 28 Sep 2021 12:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=EVzDoSDqJZmi4ToqJEIddbvRD+vlWsRISaT7f2OXukE=; b=EO1kDwzeZuMv1jUFt2pmKX8GvyZQAUMBJiLy1x1SVytxwcplVnv2ywT1ffuJvbGzDe SqreChLnqXdZ3bmpOGx1lq6jv+yPr/cOeERvwxCekQ+2pAL/hPpshqhIf/ZGdT33EAIM lOon8sIgHYjE/rwWroGijsvQ3Sfl16uYtuTJKv69ByO+2IJKaQCkRs4E+itlOn/VuGnJ ObcFwFaFhFQuJrFju9q8374g29cj0NSSZZgWhx88Ckt7Rqd+521BC3qoxSNjSsHzeMSW tdbGfXJrW/lc1jL/isk876EABn7Hc3z0lVBV5inoZjNRJpGnlQE9c49iUQf8C8yixnTL 5Dyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=EVzDoSDqJZmi4ToqJEIddbvRD+vlWsRISaT7f2OXukE=; b=EX7gjz3VzkNrRPnVf/nFQN61Icl67WV5LsGj3renixyZbkuFmxAq0aT8xv/xsV4Mq7 m0OCqqgXBBsRdgL4LoWbsmuIAD1FHMkrMjIQuCp/M6yVhNNWLP3oS+sN07weRgmZHzHj VFVCx8NyKXBeygk6gAoPQHa/wi8R7vSZZyvL+Z1nFcuXzKzkPzeVa2VBQGNcjPtIYAfC YMMcSlMz/mg/vR/InRKIUvW1lwhyegCuDg1L1sdnzFizM/cG9gYAl1JIEjnWYUNfYxV4 MO0/iJ33fpGyzjqL5bbrAJVLay5+bwTWouyvAu7ZC2BKxSoqsP0iyR8Ho56oyhEO7xZF KwoQ== X-Gm-Message-State: AOAM5324JGHugzwb55w4UvKYOG7e4gw63yxGqOVGgmPYgqRlDb4bZ4r2 GroS1bQJKzB2act4lgQ7dbsMdg== X-Received: by 2002:a37:8242:: with SMTP id e63mr1886625qkd.294.1632858428465; Tue, 28 Sep 2021 12:47:08 -0700 (PDT) Received: from ziepe.ca ([206.223.160.26]) by smtp.gmail.com with ESMTPSA id d14sm79297qkg.49.2021.09.28.12.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 12:47:08 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1mVJ4F-007GbK-31; Tue, 28 Sep 2021 16:47:07 -0300 Date: Tue, 28 Sep 2021 16:47:07 -0300 From: Jason Gunthorpe To: Logan Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-pci@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Stephen Bates , Christoph Hellwig , Dan Williams , Christian =?utf-8?B?S8O2bmln?= , John Hubbard , Don Dutile , Matthew Wilcox , Daniel Vetter , Jakowski Andrzej , Minturn Dave B , Jason Ekstrand , Dave Hansen , Xiong Jianxin , Bjorn Helgaas , Ira Weiny , Robin Murphy , Martin Oliveira , Chaitanya Kulkarni Subject: Re: [PATCH v3 14/20] mm: introduce FOLL_PCI_P2PDMA to gate getting PCI P2PDMA pages Message-ID: <20210928194707.GU3544071@ziepe.ca> References: <20210916234100.122368-1-logang@deltatee.com> <20210916234100.122368-15-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210916234100.122368-15-logang@deltatee.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 16, 2021 at 05:40:54PM -0600, Logan Gunthorpe wrote: > Callers that expect PCI P2PDMA pages can now set FOLL_PCI_P2PDMA to > allow obtaining P2PDMA pages. If a caller does not set this flag > and tries to map P2PDMA pages it will fail. > > This is implemented by adding a flag and a check to get_dev_pagemap(). I would like to see the get_dev_pagemap() deleted from GUP in the first place. Why isn't this just a simple check of the page->pgmap type after acquiring a valid page reference? See my prior note Jason