Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753321AbeADWZq (ORCPT + 1 other); Thu, 4 Jan 2018 17:25:46 -0500 Received: from mail-eopbgr40047.outbound.protection.outlook.com ([40.107.4.47]:53024 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751952AbeADWZn (ORCPT ); Thu, 4 Jan 2018 17:25:43 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jgg@mellanox.com; Date: Thu, 4 Jan 2018 15:25:29 -0700 From: Jason Gunthorpe To: Bjorn Helgaas Cc: Logan Gunthorpe , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-nvdimm@lists.01.org, linux-block@vger.kernel.org, Stephen Bates , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Max Gurtovoy , Dan Williams , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Benjamin Herrenschmidt Subject: Re: [PATCH 02/12] pci-p2p: Add sysfs group to display p2pmem stats Message-ID: <20180104222529.GS11972@mellanox.com> References: <20180104190137.7654-1-logang@deltatee.com> <20180104190137.7654-3-logang@deltatee.com> <20180104215040.GE189897@bhelgaas-glaptop.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180104215040.GE189897@bhelgaas-glaptop.roam.corp.google.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [70.74.179.152] X-ClientProxiedBy: HE1PR07CA0004.eurprd07.prod.outlook.com (2603:10a6:7:67::14) To AM4PR0501MB2850.eurprd05.prod.outlook.com (2603:10a6:200:5c::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5eaa5f1e-88a2-4616-8ec2-08d553c215fb X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060);SRVR:AM4PR0501MB2850; X-Microsoft-Exchange-Diagnostics: 1;AM4PR0501MB2850;3:xHcJEwWyTIdrYxp16pTWLXg8EPfczvafDXBzweiqPFH6Gp3FelYwv/TXF9gRWeZpebd/+X/Y7/X577nUjaYwrzhT4rp5rk2eX24Hw7+VAsaxPM6FgY3gvp8m1gx7cBqnLwFWENPbxSzN93AUKfLXiiA+be+/WL2fTdLCt1ztlLnD9Np4RTrNmtaweJpd0i6IymixKHu3fXt08NkOTYufUoOS0m+kTw1Kf4DihM5/qP1tn9/i+B7kvSPUeZOu2TVM;25:EVDXUwTPKG60O5rxgg7bAAXwSLH5PYAqQYgFuXVMnFI68mzmtvbu8lJJ/egFMuxCDQn2xcGIgVctCKd/f9HU0mu7vAKxDVM1h1RrcmtRNTgysvhpiH3fiThBx6bzpr/3CwkgltvjfaZ4cRwK0HRUbUtJGVGQsCNjc6rWc9Vd9anGp/ZbtE3ywb49Q/PYe+VNcXrybHL8Q0Vsg098jM6lDzfW3kS5yH3nHn48t+ThMNeO0zqpCQYdFBw6TCk36FGJivtCUQz9swcdosqZSi7J1xRgvf2wVLIBCzgpOV/Gv2O5SlD+dWLqs3+YOrfAFgFQQhPxVcLwmCTg29YDWmdxZg==;31:58u9/XWNg8P5/hDPbgYbKx1EviO3HPSjnGyoriMvfgen/P/wuXfVb2bXqR8mS2ubp0f+Sm4PG3w3aFnKf6ed4odA3CwmF131R6LgnLw3Kf1fyLROAmjSHIUiPf3u0DPWYPNEgJM30BBQETFW6ctNgywRXd28KnBWaf+m5shUka5VWdOy3O92AQfCSkCMy+Bps52ZZRfZsajSlZmaDnuw/U2cycshxCEnOo6rFT/JkZE= X-MS-TrafficTypeDiagnostic: AM4PR0501MB2850: X-Microsoft-Exchange-Diagnostics: 1;AM4PR0501MB2850;20:TuDrochsnajd9PzZBPsf1QDCHKYw0kQVdi2WOeXHAGfae8mmfAnkBJ3t0RiD+BtadmZzXEH+cdFs46MbIw3jC5OzbqQKphqouRU9RY67NJQsuNmlOFYR8V7J9BGgghHOhNqZ2hImy3GOK2/zv6uKQjzAp1kU9+HtenRSWpBqr8nsspICJg4t4VGOX2RY5sAkjz5yy8lDOilqZDkeGMMFaMsNNhB4aUF/5xa7Vhm9NHjrP3EGdKaH97esB0Gny5BDYvlqzCYw/2dMFifaA1WD4GYplxHa3+uLxfAeQzE5LcCyvmUcAe9tYcr3+hTDSMToNkdpCY1z9MWHBtKuy8yLCjzbWWzX6MZcwuVNf4bB3hIvR8zAV77TWdgzCPr/nM3RUH24lIODrq2jTsH+saHElWXts0d4Oqh5g2Vr5NgtuY6D8ZR6F7Aj646EYzSZJp2IsdD90jexGV77E4l/4wFp4gF2mKlm7Hvj6jIIjmfvQ9C/jRByQSkSmsrl4YL1ylMN;4:00oaOrrSkg0WESW7CQys0ffUc2NksyxxV1M5ETMOWpaFjLw6X1rNV0+xzlHz00CgGyWPk4v9ll1TEXhfDiZWfDJGV7i2tvk7P2tHPOGTd+84uLKJInbNUYWW3rMQTWmnnoVZq9jhIfI4K7DNbEmUb5Oqd9hGCoHxdU1ihcQNz1yYJ3KPmnDR00ENs/cw4YxsPy37pEOjDIyLOYkN2kG9doMuW0jJb4HrGzXjA4ldSeQYqNUIXSA+3zMnTHpMDXOoofsC8IUntRjl3hV6W6D2i2OZ2c7AE0DNose63XDeMYz+XoYeFY4zCtJ0MVvBIsJo X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231023)(944501075)(93006095)(93001095)(6055026)(6041268)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:AM4PR0501MB2850;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:AM4PR0501MB2850; X-Forefront-PRVS: 054231DC40 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39860400002)(366004)(376002)(346002)(39380400002)(396003)(54094003)(199004)(189003)(24454002)(6916009)(2950100002)(316002)(8676002)(83796002)(54906003)(6246003)(83506002)(4326008)(57986006)(36756003)(1076002)(9786002)(9746002)(58126008)(8936002)(81166006)(3846002)(23726003)(5660300001)(81156014)(6116002)(86362001)(97736004)(68736007)(229853002)(2906002)(305945005)(7416002)(47776003)(106356001)(478600001)(53936002)(16586007)(46656002)(7736002)(66066001)(69596002)(33656002)(50466002)(52116002)(76176011)(386003)(59450400001)(105586002)(122856001)(18370500001)(24400500001)(42262002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR0501MB2850;H:mlx.ziepe.ca;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM4PR0501MB2850;23:wDH6mv5D1/zE506+tmuYpNy9O2jgsvaOv38SsfN?= =?us-ascii?Q?9NGKMaDXL6kf9XhIUDIqv49K3NOFyYiwN14Men95J7OUBrkEL6Z99Ae03hWv?= =?us-ascii?Q?IRidEXuRXp1P9ZFKQWXwRvJ2p2WaJWX6Yg8u0TUmt/Gw0ne0AYyzLxprQtRj?= =?us-ascii?Q?LPIE9YEb30tj+Zw/GsRNiHcd0tXIaNRlqrzjSwnvrHi0eubeKK9lieiWWzZS?= =?us-ascii?Q?1nK120kjvdmuGJwnoTabMhgGcr724FtSUIbNPo3M7Y6ZeFDtuCj1CZfFmv4k?= =?us-ascii?Q?PijR64VMdKwPu5yaC9GoTBpdxL0AMR0XYJPuiKPUOy417mICuipXIOzP214P?= =?us-ascii?Q?VNEDaF6UE1UXpjRYhi7I8RGasJ6abF8HrzuvpcKm8CHXHw0G2pGTrGAUFMmi?= =?us-ascii?Q?TNRWtTsvGCsBm8QjHHlOd5CNVL4SZBDX2wZohz/vt5i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-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2018 22:25:39.8174 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5eaa5f1e-88a2-4616-8ec2-08d553c215fb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2850 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Thu, Jan 04, 2018 at 03:50:40PM -0600, Bjorn Helgaas wrote: > > This is similar to /sys/bus/pci/drivers_autoprobe, but > > affects only the VFs associated with a specific PF. > > + > > +What: /sys/bus/pci/devices/.../p2pmem/available > > I wonder if "p2pdma" would be a more suggestive term? It's not really > the *memory* that is peer-to-peer; the peer-to-peer part is referring > to *access* to the memory. There have been out of tree patches using P2P DMA for a long time, and some of the use cases have nothing to do with 'memory' - eg DMA to 'registers' I notice that this series particularly focus on treating the target BAR as 'memory' - ie it puts genalloc on top of the BAR, and I guess treat all addresses as equal and interchangable. If this series gets accepted I would expect proposals to extend this infrastructure to allow for P2P for registers in some way as well. So I think the 'p2pmem' name is a good choice only when it is in places that talk about the genalloc part of this design. We should reserve p2pdma to talk about the generic infrastructure unrelated to the genalloc pool. Since these sysfs's seem to report the genalloc pool status, p2pmem seems like a good choice to me. > > @@ -82,6 +130,9 @@ static int pci_p2pmem_setup(struct pci_dev *pdev) > > if (error) > > goto out_pool_destroy; > > > > + if (sysfs_create_group(&pdev->dev.kobj, &p2pmem_group)) > > + dev_warn(&pdev->dev, "failed to create p2p sysfs group\n"); > > Not sure the warning (by itself) is worthwhile. If we were going to > disable the feature if sysfs_create_group() failed, that's one thing, > but we aren't doing anything except generating a warning, which the > user can't really do anything with. If the user is looking for the > sysfs file, its absence will be obvious even without the message. Don't most of the failure paths inside sysfs_create_group cause prints anyhow? Jason