Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1466333imw; Tue, 5 Jul 2022 09:59:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1utTQV+FAeECtgfVEmAmBFttNf5Zsfr+dtUe0BSQGtnnNPn5nKXQ3idotqwb8qPc2sURjz9 X-Received: by 2002:a05:6a00:3488:b0:528:3c8b:7b3a with SMTP id cp8-20020a056a00348800b005283c8b7b3amr22879543pfb.57.1657040347300; Tue, 05 Jul 2022 09:59:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657040347; cv=none; d=google.com; s=arc-20160816; b=BlWgl9L4G3f4xqQwFXpBw7ylprKTzlFIzdnpT1LVpTUjGSEQbcPFhNHfNRcDRbvrMr gW9rLVv/BWLMd8AHHLAtE8I0wHvG3S6+4t6wv6mPWCxALk+IFUpo5meQ5Ct0tG0QX+BO L1U2sLunXvxvKzo18O/bIY1qikF2eladwaNnaAefLwZZYObfwVIJXIeZDZUkznCiA1gB BLSGgFjRMRB0cHnVxUi2HLytJoO0el7EmQOEL5t9mdTPbZbQAbhI8USQ+yPwJIdyjEms FVjU8CpgAZEY41eng4MLYL72DX6dBfW3lNur9mYnSSd3t/j+YsEAz6dqmqcC10uyVg9N zoDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:in-reply-to :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=M9lshAzEWCp39q0M5lwlB1NZkjotUyijIzztbRqB0FM=; b=jgjb7d/WjgzeOTrHZzW34c/YsTN7T7EuMeCvZnCv79jmlh4kosjZ5ed/Cg1WKkdyA5 nE4P3S+tpXDcplC4u291Nx9zy7atUl7MWHj/sHkD4YRA9prVEjHjIPIv2ztGf47Estun OQ2yf2wghGl6fdYFwsOqkFYa3uMV5F2bIv7qgZG4HE/drEphsXJvHoj8LQxAWprh5dmR OwEKkz8IsrmhOxWw/ZHIh2ZmrDCivmueVtxbjPP/k2Jn1EHnOZnpA2oHIYqyePJNlZVa zNYBeopinMXoRYIKncjo6WBhUDsJ+9Vtw8z0d/130eXCsaM6yoxN8i60nUC6G+if+XyN 7BVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=Mo2zW9GH; 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=deltatee.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j9-20020a170903024900b0016388cdd5c0si20151241plh.310.2022.07.05.09.58.49; Tue, 05 Jul 2022 09:59:07 -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=@deltatee.com header.s=20200525 header.b=Mo2zW9GH; 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=deltatee.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233072AbiGEQo5 (ORCPT + 99 others); Tue, 5 Jul 2022 12:44:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbiGEQoz (ORCPT ); Tue, 5 Jul 2022 12:44:55 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90744192A1; Tue, 5 Jul 2022 09:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:In-Reply-To:From:References:Cc:To: MIME-Version:Date:Message-ID:content-disposition; bh=M9lshAzEWCp39q0M5lwlB1NZkjotUyijIzztbRqB0FM=; b=Mo2zW9GHbFuHB4N5lDT7TTpEFJ E/uvXhxH8NlLN3H7wf7jHeNIVGFBOn6kGpSwg9Q0PRmIT7B0NgN5HKfDvdWC/tq0oeR9ODWC5Sm8L 4VzdLVqrNlvua2BOOpPdKo9XZ4N4qOdl1ANdXJB8gt/aOC2BGSJa5bzebNQZsA2RjPwMB0RJHFmUu ngvrq/ALiGMZNQzw/HVXX/Nbl91952L71agzO9IOMIUVjPxPiUnA2kW/08/SbESEi8UnI7QL08gqh JwtZmMz5Fhga9ZahrHQMYr0rc5ZM4OOgbdcBm7aT4OzddKkaTzcWtw3cLXJKAm1h0uFRofCOED5Ae PuCBNcTQ==; Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1o8lfO-007Sy1-H9; Tue, 05 Jul 2022 10:44:51 -0600 Message-ID: Date: Tue, 5 Jul 2022 10:44:49 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Content-Language: en-CA To: Christoph Hellwig Cc: Jason Gunthorpe , 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 , Dan Williams , =?UTF-8?Q?Christian_K=c3=b6nig?= , John Hubbard , Don Dutile , Matthew Wilcox , Daniel Vetter , Minturn Dave B , Jason Ekstrand , Dave Hansen , Xiong Jianxin , Bjorn Helgaas , Ira Weiny , Robin Murphy , Martin Oliveira , Chaitanya Kulkarni , Ralph Campbell , Bjorn Helgaas References: <20220615161233.17527-1-logang@deltatee.com> <20220615161233.17527-21-logang@deltatee.com> <20220629064854.GD17576@lst.de> <99242789-66a6-bbd2-b56a-e47891f4522e@deltatee.com> <20220629175906.GU23621@ziepe.ca> <20220705075108.GB17451@lst.de> <20220705135102.GE23621@ziepe.ca> <20220705161240.GB13721@lst.de> <20220705164315.GB14484@lst.de> From: Logan Gunthorpe In-Reply-To: <20220705164315.GB14484@lst.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: hch@lst.de, jgg@ziepe.ca, 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, sbates@raithlin.com, dan.j.williams@intel.com, christian.koenig@amd.com, jhubbard@nvidia.com, ddutile@redhat.com, willy@infradead.org, daniel.vetter@ffwll.ch, dave.b.minturn@intel.com, jason@jlekstrand.net, dave.hansen@linux.intel.com, jianxin.xiong@intel.com, helgaas@kernel.org, ira.weiny@intel.com, robin.murphy@arm.com, martin.oliveira@eideticom.com, ckulkarnilinux@gmail.com, rcampbell@nvidia.com, bhelgaas@google.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: Re: [PATCH v7 20/21] PCI/P2PDMA: Introduce pci_mmap_p2pmem() X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-07-05 10:43, Christoph Hellwig wrote: > On Tue, Jul 05, 2022 at 10:41:52AM -0600, Logan Gunthorpe wrote: >> Using sysfs means we don't need all the messy callbacks from the nvme >> driver, which is a plus. But I'm not sure how we'd get or unmap the >> mapping of a sysfs file or avoid the anonymous inode. Seems with the >> existing PCI resources, it uses an bin_attribute->f_mapping() callback >> to pass back the iomem_get_mapping() mapping on file open. >> revoke_iomem() is then used to nuke the VMAs. I don't think we can use >> the same infrastructure here as that would add a dependency on >> CONFIG_IO_STRICT_DEVMEM; which would be odd. And I'm not sure whether >> there is a better way. > > Why can't we do the revoke on the actual sysfs inode? We might be able to. I'm not sure. I'll have to figure out how to find that inode from the p2pdma code. I haven't found an obvious interface to do that. Logan