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 X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD8ADC433E0 for ; Mon, 6 Jul 2020 08:29:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AC30320724 for ; Mon, 6 Jul 2020 08:29:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WI3wiu/N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC30320724 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=Huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+IYhsMDyyP+clmiUiJCTbEupX5/xcjr0sohHrYfFa3o=; b=WI3wiu/N3TtURB7V3/9s2Oyzc Cb9JH008OE0X3C9NNzewqt+47+zLZQ3NaLUU0K2AuQAtGd0cFmWGCqVsbhjoXgvvshCnWp43UMYOi XIzhMBchfcM9cIVBUuAZj6Ch7q59p1ngrRlMu9QpTXgH4M6jN9L8nWXoTIrcw9Ei0X+hSGGVzF86o fVdOBFOpsHfM6JoCGmSxhyuzst2qMiuwLsv3RGEq63jODj16ZSMal3T4KqklWWLALTtpN3cWRkzmq NXPWv34p2BYZdLkJJRha7q25WGyw+hFJu6vClUexq53+0lQrhDpMM3cq6wVYYAYLsZZLIIZwHSt5P v1+mwBxag==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jsMTx-0006oU-1v; Mon, 06 Jul 2020 08:28:09 +0000 Received: from lhrrgout.huawei.com ([185.176.76.210] helo=huawei.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jsMTt-0006nJ-8H for linux-arm-kernel@lists.infradead.org; Mon, 06 Jul 2020 08:28:06 +0000 Received: from lhreml710-chm.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id 2B8676C15A69DC7537E0; Mon, 6 Jul 2020 09:27:55 +0100 (IST) Received: from localhost (10.52.123.111) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Mon, 6 Jul 2020 09:27:54 +0100 Date: Mon, 6 Jul 2020 09:26:49 +0100 From: Jonathan Cameron To: "Song Bao Hua (Barry Song)" Subject: Re: [PATCH] iommu/arm-smmu-v3: expose numa_node attribute to users in sysfs Message-ID: <20200706092649.0000676d@Huawei.com> In-Reply-To: References: <20200530091505.56664-1-song.bao.hua@hisilicon.com> <20200703162137.GA19780@willie-the-truck> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.52.123.111] X-ClientProxiedBy: lhreml717-chm.china.huawei.com (10.201.108.68) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200706_042805_423832_306FE184 X-CRM114-Status: GOOD ( 27.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Will Deacon , Linuxarm , "iommu@lists.linux-foundation.org" , Brice Goglin , "robin.murphy@arm.com" , "hch@lst.de" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org +CC Brice. On Sun, 5 Jul 2020 09:53:58 +0000 "Song Bao Hua (Barry Song)" wrote: > > -----Original Message----- > > From: Will Deacon [mailto:will@kernel.org] > > Sent: Saturday, July 4, 2020 4:22 AM > > To: Song Bao Hua (Barry Song) > > Cc: robin.murphy@arm.com; hch@lst.de; m.szyprowski@samsung.com; > > iommu@lists.linux-foundation.org; linux-arm-kernel@lists.infradead.org; > > Linuxarm > > Subject: Re: [PATCH] iommu/arm-smmu-v3: expose numa_node attribute to > > users in sysfs > > > > On Sat, May 30, 2020 at 09:15:05PM +1200, Barry Song wrote: > > > As tests show the latency of dma_unmap can increase dramatically while > > > calling them cross NUMA nodes, especially cross CPU packages, eg. > > > 300ns vs 800ns while waiting for the completion of CMD_SYNC in an > > > empty command queue. The large latency causing by remote node will > > > in turn make contention of the command queue more serious, and enlarge > > > the latency of DMA users within local NUMA nodes. > > > > > > Users might intend to enforce NUMA locality with the consideration of > > > the position of SMMU. The patch provides minor benefit by presenting > > > this information to users directly, as they might want to know it without > > > checking hardware spec at all. > > > > I don't think that's a very good reason to expose things to userspace. > > I know sysfs shouldn't be treated as ABI, but the grim reality is that > > once somebody relies on this stuff then we can't change it, so I'd > > rather avoid exposing it unless it's absolutely necessary. > > Will, thanks for taking a look! > > I am not sure if it is absolutely necessary, but it is useful to users. The whole story started > from some users who wanted to know the hardware topology very clear by reading some > sysfs node just like they are able to do that for pci devices. The intention is that users can > know hardware topology of various devices easily from linux since they maybe don't know > all the hardware details. > > For pci devices, kernel has done that. And there are some other drivers out of pci > exposing numa_node as well. It seems it is hard to say it is absolutely necessary > for them too since sysfs shouldn't be treated as ABI. Brice, Given hwloc is probably the most demanding user of topology information currently... How useful would this info be for hwloc and hwloc users? Sort of feels like it might be useful in some cases. The very brief description of what we have here is exposing the numa node of an IOMMU. The discussion also diverted into whether it just makes sense to expose this for all platform devices or even do it at the device level. Jonathan > > I got some input from Linux users who also wanted to know the numa node for > other devices which are not PCI, for example, platform devices. And I thought the > requirement is kind of reasonable. So I also had another patch to generally support > this kind of requirements, with the below patch, this smmu patch is not necessary > any more: > https://lkml.org/lkml/2020/6/18/1257 > > for platform device created by ARM ACPI/IORT and general acpi_create_platform_device() > drivers/acpi/scan.c: > static void acpi_default_enumeration(struct acpi_device *device) > { > ... > if (!device->flags.enumeration_by_parent) { > acpi_create_platform_device(device, NULL); > acpi_device_set_enumerated(device); > } > } > > struct platform_device *acpi_create_platform_device(struct acpi_device *adev, > struct property_entry *properties) > { > ... > > pdev = platform_device_register_full(&pdevinfo); > if (IS_ERR(pdev)) > ... > else { > set_dev_node(&pdev->dev, acpi_get_node(adev->handle)); > ... > } > ... > } > numa_node is set for this kind of devices. > > Anyway, just want to explain to you the background some people want to know the > hardware topology from Linux in same simple way. And it seems it is a reasonable > requirement to me :-) > > > > > Thanks, > > > > Will > > Thanks > barry > _______________________________________________ > iommu mailing list > iommu@lists.linux-foundation.org > https://lists.linuxfoundation.org/mailman/listinfo/iommu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel