From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F9C0C433EF for ; Tue, 5 Jul 2022 16:12:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F0AAC6B0073; Tue, 5 Jul 2022 12:12:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EE21D8E0002; Tue, 5 Jul 2022 12:12:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD3848E0001; Tue, 5 Jul 2022 12:12:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id CE64B6B0073 for ; Tue, 5 Jul 2022 12:12:44 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 9D4D3347E2 for ; Tue, 5 Jul 2022 16:12:44 +0000 (UTC) X-FDA: 79653539448.29.4FC0A14 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf25.hostedemail.com (Postfix) with ESMTP id 0929CA004E for ; Tue, 5 Jul 2022 16:12:43 +0000 (UTC) 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) ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; dmarc=none; spf=none (imf25.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657037564; a=rsa-sha256; cv=none; b=lYYyOOwdbxHeGAhHVDHXjr5VqJsdo7/V6FUqCClrYIFh/atdzT3CXvrPmJHQWHlpflwYRc 5wljay1ZHaETb3gWvg4iJUTBx0wo52JEHY4TowyY7S9KQGop6q+9otYiglQ/1UpKNSyDDw Iy5VOjCnR9hZ5p+HThR5Wif/2SMNBTQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657037564; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LfidzsRhpq5PFrYr0wjyVtBtgUgg1IId9b2eimOy6Iw=; b=TsV97QVg/pe0PXr16kAGujVlf86pNjwhFpUvHC4pJN4uaqATkJyoBOhMRwgw4F8dbWstFO 0vJpQ+1u9LsSZlux2kmuYTfp7wEKS5rEXhR9gsmHAClPD41zrzHnFzdiVG6LwY9B4L4Z1A BM44QC3kG2bf8z5u5lhvVzYOQxCymWU= Authentication-Results: imf25.hostedemail.com; dkim=none; dmarc=none; spf=none (imf25.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: sxd8t6f97purj9wiu8piprq5t1awen8o X-Rspamd-Queue-Id: 0929CA004E X-HE-Tag: 1657037563-74902 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.