Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1442015imw; Tue, 5 Jul 2022 09:30:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sk8pBhTYsR2d4ZliCtHvmKnz2zHFalWQCjqUZkjUOShsrxFz2YP/+bAIFHFkRDoGbnPB6g X-Received: by 2002:a17:903:124e:b0:16b:e975:232f with SMTP id u14-20020a170903124e00b0016be975232fmr8256145plh.165.1657038638736; Tue, 05 Jul 2022 09:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657038638; cv=none; d=google.com; s=arc-20160816; b=sk7GrGpPfrqEDwF81Z3wr/SF5+L8UqGCU3gDUm0wjT79o2QjM9ziKQSqqvokljFmXH RilD5BdEpZVQqtHqvEDpQr0A+uAIxjo0iM4veEwO74ohfxTG4im0+HfG1CZTKudunFfv 3mddt3n5Ot6SFZzoXYmzjdfVH/Si1YgYRjMqJBiA4TSRqKe1hOMtltHGisjaYioELgis 7Z31I2sNKfuaC9+dVcmeRDy+IPakE98iJ6fz4Hgvihm6drwXj7PJ+qobKSfa0XVKwVCn GBYBV8mh29Ap4kzqRTSD9iLJMWJfmgC4RAIsw8LskkXS292L3BUj6yeKfSbUNNtmHC6R nvAg== 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=LfidzsRhpq5PFrYr0wjyVtBtgUgg1IId9b2eimOy6Iw=; b=yQ9G3/Oqcc1M7XrcWdfqqcJVyJGERyqi0aUOGZz+w6mCMCZy0pCxhDrAEyqHpiimrf LJvYTtr3fCC9toHnF3E1sxJkku4lIgcih81fxCl2K5BzSdcKoXcJ0kyQS7A9JDkFUrAG aXRcAeypS0UbWn0XMAs4PQelf2OqccYHI0vK4cg5i1h+jmNozE4NrkvvlFkVW3/SaF3o J9bmUm+bzm0QiqDiYGl5F9bdRrkLKbvH71eJQQZUtbpvixriCjd/XjFtzGo8OnD4aWEj vPfKIfeq7DTxEcA6G+3oJQU6njZAdEj7FKnK0pOsRAd6friR6WRBUDuLWEZQ5IFNuPfA iE2Q== 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 l69-20020a638848000000b003fcb45d2c86si2115322pgd.485.2022.07.05.09.30.26; Tue, 05 Jul 2022 09:30:38 -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 S230427AbiGEQMq (ORCPT + 99 others); Tue, 5 Jul 2022 12:12:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbiGEQMp (ORCPT ); Tue, 5 Jul 2022 12:12:45 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C89F1A3A5; Tue, 5 Jul 2022 09:12:44 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id B875B67373; Tue, 5 Jul 2022 18:12:40 +0200 (CEST) Date: Tue, 5 Jul 2022 18:12:40 +0200 From: Christoph Hellwig To: Jason Gunthorpe Cc: Christoph Hellwig , Logan 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 , 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: <20220705161240.GB13721@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> <20220705075108.GB17451@lst.de> <20220705135102.GE23621@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220705135102.GE23621@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 Tue, Jul 05, 2022 at 10:51:02AM -0300, Jason Gunthorpe wrote: > > 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. > > Shouldn't there be an allocator here? It feels a bit weird that the > entire CMB is given to a single process, it is a sharable resource, > isn't it? Making the entire area given by the device to the p2p allocator available to user space seems sensible to me. That is what the current series does, and what a sysfs interface would do as well.