Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp957584imw; Tue, 5 Jul 2022 00:57:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t0+GGh9CvN86BXx5s43xoulq8Raczs9xMpqEqgVdx5DPIgd0V5nuvTw5hsUkv9LHwdMDV3 X-Received: by 2002:a05:6402:50c7:b0:435:923b:9b23 with SMTP id h7-20020a05640250c700b00435923b9b23mr45357768edb.336.1657007877887; Tue, 05 Jul 2022 00:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657007877; cv=none; d=google.com; s=arc-20160816; b=W7WH+TXwjQNEtGoIYlVry8VXN5f+ogx4PpUif6gBwg31VrEzE1ZSpm+9C7F3W4dsXn 6Qyi+FDLaslVJoP8oz12xwZI58NMODhcpjuo6oqM5H9akgFDrK+EoTS28pI0MDPGMA0d MU6dBeq6rzsQjpsgggjTiVTRyglz1Jiat6hOiMpwEY4+WvOC+I3EMScRAAU5WXM7yFcM 0eEAmlA4sePrKMexOidDZuoPkJVnWgsHz8pQ04bq3YamBWB7WPrFAvCAqNa7hP2yxzfu 4Cj78hvl2pZQwkXAkVQDjLpAf7bcYq43rixm9vnGJdyCaddAJigg4nPMsbEi0KnvahFJ cybw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=J1B6KU4RqQ75A+QkPts2j5YhHfWA4F26bHFXjCNuj/8=; b=HfMo3TnaBH+1r8YxmhcgNYnG8RsK4aewTxJaR4wI7J/b2a1GwzysYvfa/GEvBPMdl1 jphub4g23NZFCuUD9H6UqhzgSepVu5dV0I518l08FaPqgOvcwGtt0WXzpTAkw/IgSxUs H8k2klEUhDcfDOMg6Ad/mzWVCYaXJ0IDBljstkqCs/KXjLoF1yaVECLaB7sWtEbuicj+ h3yyCE2rUoQsPYiO7YDeifRY4LuH4CSIllWWId6f6uM/MDXlCsNPkQMihs13g6yZ1SWC Na34jHJIwfv1MQHPIPLrze9hPbJHtOP37PzlbAmv8sKnanuXbj7OU1l0bH2BcOLd+3Xw qBGQ== ARC-Authentication-Results: i=1; mx.google.com; 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 z19-20020a056402275300b0042e1a7667f7si18279291edd.613.2022.07.05.00.57.33; Tue, 05 Jul 2022 00:57:57 -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; 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 S231154AbiGEHvQ (ORCPT + 99 others); Tue, 5 Jul 2022 03:51:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230510AbiGEHvP (ORCPT ); Tue, 5 Jul 2022 03:51:15 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E0C5DF4B; Tue, 5 Jul 2022 00:51:14 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 7CBB668AA6; Tue, 5 Jul 2022 09:51:08 +0200 (CEST) Date: Tue, 5 Jul 2022 09:51:08 +0200 From: Christoph Hellwig To: Jason Gunthorpe Cc: Logan Gunthorpe , Christoph Hellwig , 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 , Christian =?iso-8859-1?Q?K=F6nig?= , 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 Subject: Re: [PATCH v7 20/21] PCI/P2PDMA: Introduce pci_mmap_p2pmem() Message-ID: <20220705075108.GB17451@lst.de> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220629175906.GU23621@ziepe.ca> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Wed, Jun 29, 2022 at 02:59:06PM -0300, Jason Gunthorpe wrote: > I've tried in the past, this is not a good idea. There is no way to > handle failures when a VMA is dup'd and if you rely on private_data > you almost certainly have to alloc here. > > Then there is the issue of making the locking work on invalidation > which is crazy ugly. > > > I was not a fan of the extra code for this either, but I was given to > > understand that it was the standard way to collect and cleanup VMAs. > > Christoph you tried tried to clean it once globally, what happened to > that? Al pointed out that there are various places that rely on having a separate file system. I might be able to go back to it and see if we could at least do it for some users. But what also really matters here: I don't want every user that wants to be able to mmap a character device to do all this work. The layering is simply wrong, it needs some character device based helpers, not be open code everywhere. In fact I'm not even sure this should be a character device, it seems to fit it way better with the PCI sysfs hierchacy, just like how we map MMIO resources, which these are anyway. And once it is on sysfs we do have a uniqueue inode and need none of the pseudofs stuff, and don't need all the glue code in nvme either.