Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936560AbcKKHwN (ORCPT ); Fri, 11 Nov 2016 02:52:13 -0500 Received: from mail-bn3nam01on0074.outbound.protection.outlook.com ([104.47.33.74]:40352 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751606AbcKKHwL (ORCPT ); Fri, 11 Nov 2016 02:52:11 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jan.Glauber@cavium.com; Date: Fri, 11 Nov 2016 08:37:35 +0100 From: Jan Glauber To: Mark Rutland CC: Will Deacon , , Subject: Re: [PATCH v4 1/5] arm64: perf: Basic uncore counter support for Cavium ThunderX SOC Message-ID: <20161111073735.GB16907@hardcore> References: <73173d6ad2430eead5e9da40564a90a60961b6d9.1477741719.git.jglauber@cavium.com> <20161110165405.GH4418@leverpostej> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20161110165405.GH4418@leverpostej> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [46.223.65.110] X-ClientProxiedBy: DB6PR0601CA0006.eurprd06.prod.outlook.com (10.168.88.144) To SN2PR07MB2592.namprd07.prod.outlook.com (10.167.15.22) X-Microsoft-Exchange-Diagnostics: 1;SN2PR07MB2592;2:DxIdvs6fwru61oAle87ObqIHAyWiw6VMyVeoTHUvlUkALHASNWU9tQDnZ8MWAd7/OKxSXRL9DW/K6Ui0aUVzP5xxaE4wWx3yiMvrx8NeyY3jIpS05MPLGeUwmbb85fypMcYcD5ngUCCXZ3ENMaIFIDPe4U16JYDDgUd4s4p//s8=;3:2rG0XjIMFGX8EsTeGzpj9QkHKE9Weviv6R+A5c1MrGTclR81Qvv5iOHZNRcSnoQh3xLUmijNUwUi3omST6m0qTE0WBRojBOn8DSbuuDPWK0tY5dZuZRGGRLt6o2qD0XzJHbEpPnDx6LTed+IXr4NuL7pGvJJeGH/P1D6huvUAWY=;25:pTP8pZd3cv4wulZZYoZZi4nEhz9jsCIMnIyrm/7Lq+f+3MFiEOV1VBD0nxgNg36whkF34S9wedB6sIi5/w6/eKOu+cO2UiXVQQ6VA0q17g1HMHyE1OwswFSug0ppaMIjPirmyhwuF+++E+/iNehpSaSkYLHmoclANEH6+lgtcPT0KmSmoNtKrMPQz07x8EyHraVH+lr817UHabBNn34gO3TvuveXOmEFcNvuTPRM+5fFfvA0eitcwXw9RT/p+Ck2bjeVgCunGr2p7dN8pEilFmCXw1X9LFVA1Apv+yaB/+Oh0y4acMq2U1uf1mbuiSMPqkRnbQounDhoIQc2fLCu83PGzBk6QKnAUnNrpiAmWiUL61eQVtQE4cQ2uFgn2iMl6v62il0bu9B1w0IoVOvEWmOoj/5heFQwsFbsdzBir4WdQ/d9Qkj/3M12ebLsL/f5 X-MS-Office365-Filtering-Correlation-Id: 38f9e95c-a930-432a-0467-08d40a05a152 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN2PR07MB2592; X-Microsoft-Exchange-Diagnostics: 1;SN2PR07MB2592;31:uJuidsq9DmNm9A+s07lm39ZlllEqN1iyEXfNtS6FDZqBcbiEMxPwrO1sHuDvq13yeDy9TotzbV6hqAGIBtRzcMvP/L0k3/X3rboxwDTwbV63a1bLD/yTuIMiQpOHG7RGi/0rFqCtelXtFjg4Tf2D3R48nFpLbn0a32RJBzbi8Mh2KT5r+ZLs7lXn6wfksGNaqP+sp3fcP4QOhanwa5zKWnC0sH1UIiPBQJ2WIaHYkXEOEphCr1SvY04ENVR3Ig1f;20:pkghwkMYDgnx3MX78xiNx6R/YsOlXw7JsER7sbGB2lbdNppr81JlyDCo//tOcAMfqmA6E5HIhGiwpln7+JESAh++OIpd1NXYoGjcUFpRIFHmIzAcYQizOB9w/HxBPABaAmuoq3bCkv4tqrRJ59bHFGJ3RXt+MJRXNAtu1T2UdQt/cQW7EpPzh1zyhfPxgkAbW2u21zNyN+hZ59a5MyJfc0J690f2019qr12diqoYXF/yFZgj9H25l1wn0bm9oQkJnkIEHBxSLa7AdeWBsgGDy4drbeMCC6ApJvvLEXiFERkR3zpaup26EbSpjrvNX9URWm2IWpk8T1YO6ooBmeWeJ7oqHQw+c3q1oChqVAgJwLx5rSnZngAQWa7Ew0EzOGo42EZLj9PWALjfT5MwPwGnGiKdq8vOlz6JnFgew4knzraM+BaPUF//J7W/cp5I+k+oiEI2pzQB1mppWVoDr0n4rj5YS1K9LputayZdRzr0XPpxcJfAyGCpXIqQQSQk/tqY1egEdY5D8TbpKXgW0saUriFYkcZbVLDJzqCYTA/SHA/ryH2jItdDjIFo9vxAnpgluTEyiklAoJCQ75mtN+J2IVf+Jc9YbmDowaVQVp28rDw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:SN2PR07MB2592;BCL:0;PCL:0;RULEID:;SRVR:SN2PR07MB2592; X-Microsoft-Exchange-Diagnostics: 1;SN2PR07MB2592;4:0n8Mj/V94bf2Rgiay4x4eJ64ib5dwoSma7wXq6a0EYkMG+34mEGRXSBNUZA4eTlslMotZ1MPJcFD94We/e71l4z+C6eHLg4is6jOVSKMIn2k3r7ScjOtSeMsFXNmbYMpGdj58RX01SMlfoU7gk7CA09tW375m/uLWqqhNi6+2Yca8fHXcfETkiANgG5y/a7xC/wZb4N8ipivnxAek9/YP86ILFCa2mFgxJULOlOkflXcfHNlds15BahkEiYiMAFitMd+ecBe6H7okL2QRwZZmpTtOPklyQWKLTgL3WyVn1mbnB+/4mb1n6ndqvSBQPKPJ9Py1GF9l1K+psXX564nRaa5OJj4vcqecmwbweykttgSiVUkHVTt6KLRYOflkmcnD1F7uiA+gDICrV/ITV0H+Q== X-Forefront-PRVS: 012349AD1C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(199003)(24454002)(189002)(66066001)(50986999)(97736004)(6116002)(586003)(3846002)(4326007)(189998001)(47776003)(2906002)(4001350100001)(81166006)(23726003)(1076002)(77096005)(68736007)(54356999)(9686002)(101416001)(33656002)(7736002)(42882006)(6916009)(2950100002)(7846002)(305945005)(106356001)(105586002)(46406003)(76176999)(110136003)(8676002)(81156014)(33716001)(42186005)(5660300001)(92566002)(50466002)(6666003)(97756001)(83506001)(229853002)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN2PR07MB2592;H:hardcore;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN2PR07MB2592;23:7fxZGVbXqEmLzA57m3oZxRG+jgX0PjzJvLzSq/PhG?= =?us-ascii?Q?+XJCoTHPxIQDNORTcEUEbr9xL1fGQ1CdttrB9CJ0WGX3u9/pbNO6yeOgxRcF?= =?us-ascii?Q?8NknZZ+A03Mr7p9MvOeWagdSgqs/jBGzhpo/lGiUAXnej1fCLwHCX26Cu3KV?= =?us-ascii?Q?ovOupIATg5zudZFV4ex45dhMJWDd+UPqyNDspuN/28+tdlNOFJ/gNvgeO+eS?= =?us-ascii?Q?Ce8tAUTMg6abThlE3KZanIZkWLWvM9Nv68PUtlpU/4LU/nkItHZr6gBuH9NJ?= =?us-ascii?Q?wPuJleWeA5LYXii0DCzcwSv268gtNDs3ETA0+f2+pTaaCyM/1sf+Fm52n5su?= =?us-ascii?Q?Ndw0075LhA3IpcxqyPxuHSMW2GqQcmTNhhXr00whhg6rFPOt2tgOE+bSy+A1?= =?us-ascii?Q?PPimEw7a9bupuBEVDFI3oqo8ebf8GwfMfKxwjnu/jUZftfvjt1bFpkwDa6j+?= =?us-ascii?Q?omxWup918s2tW9ruPym+Emsb90wFMGsya/zYVOLj70LiX0Gj3bvdzvJt0gcg?= =?us-ascii?Q?HtarCR4LvdpNg+UnuDj3A+C9qnk9qGpF9y82oRNtFwBxTLd9zH++bNT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adnmRB9X2mU1qrHBcl0ZQsdVGRaUamKkeVfsstkM8PVOtoCPr6Dslc0z64oqYgq7eXr2TpvFGDS08c;5:bdwxPmNPcl0trL22NxMQg1HHMEbcep0aEXD2T/NGeNaIZm1j/sDojnasIzXHIfoasuOaZbNPA5QMT0cd+iPPPYjd9eE+gZlGz47ImR7o8ZwbiAI8E25IOI3UFHnKAR09Zy/XDG4WKGYP0dyOVO5wl6O+oxN3F1m6uGC2CQ58o9s=;24:NgtGb1RlxzWISJihb8JGu64JCaIhi7or8U+lbEQA/o4a9GTiWD2UCBBFKA1IPg+pZQMtrX4W2Os63p7opEEOEbQOLR71e6yU39AIrNVFri0=;7:X2fui/SFCU4KeiGuBuj/usTMC7rAQOGIGMrgyObx/Qwz6UTbVD5x6cCthw1TUyErhS7OSWSG0hG/1oqNxHDowGBvRU9mvZcABuV6R/ItMD+Upq/dwslxNqrzlj7myQX66NiL4QHMXkivKotAYI4hlMOurgGgic5quvYNa+NC54Nsqs/Akirp9M7wBniDSzlB7wjZfiOXeY3wZpxbpl8pXyX2J6OKYOPlNDM5A3aWzEk/ZtD3YASB4eHfEJP7x5duu3eY9t/J4l/TdBpNEJdL/aD4S1K93VW9j0TrkiOIF0zfx8Jk6eyCeRx/UfgOVCuqAt589+QGjMPRv0ruwLUbtjHFhnSSVjqhetkDW0DTMuE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2016 07:37:45.2922 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2592 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1584 Lines: 35 On Thu, Nov 10, 2016 at 04:54:06PM +0000, Mark Rutland wrote: > > +/* > > + * Some notes about the various counters supported by this "uncore" PMU > > + * and the design: > > + * > > + * All counters are 64 bit long. > > + * There are no overflow interrupts. > > + * Counters are summarized per node/socket. > > + * Most devices appear as separate PCI devices per socket with the exception > > + * of OCX TLK which appears as one PCI device per socket and contains several > > + * units with counters that are merged. > > As a general note, as I commented on the QC L2 PMU driver [1,2], we need > to figure out if we should be aggregating physical PMUs or not. As said before, although it would be possible to create separate PMUs for each unit, the individual counters are not interesting. For example we are not interested in individual counters of Tag-and-data unit 0..7, we just want the global view. > Judging by subsequent patches, each unit has individual counters and > controls, and thus we cannot atomically read/write counters or controls > across them. As such, I do not think we should aggregate them, and > should expose them separately to userspace. That sounds like just moving the problem of aggregating the counters to user-space. And would make the results even worse, if the user needs several calls to summarize the counters, given how slow a perf counter read is. > That will simplify a number of things (e.g. the CPU migration code no > longer has to iterate over a list of units). Sure, it simplifies the kernel part, but it moves the cost to the user.