Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751543AbdGZLUF (ORCPT ); Wed, 26 Jul 2017 07:20:05 -0400 Received: from mail-cys01nam02on0085.outbound.protection.outlook.com ([104.47.37.85]:11776 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751070AbdGZLUC (ORCPT ); Wed, 26 Jul 2017 07:20:02 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jan.Glauber@cavium.com; Date: Wed, 26 Jul 2017 13:19:46 +0200 From: Jan Glauber To: Suzuki K Poulose Cc: Mark Rutland , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 1/3] perf: cavium: Support memory controller PMU counters Message-ID: <20170726111946.GA6273@hc> References: <20170725150422.4775-1-jglauber@cavium.com> <20170725150422.4775-2-jglauber@cavium.com> <72145781-e9ec-036f-f752-b4756fef08ee@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <72145781-e9ec-036f-f752-b4756fef08ee@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [88.67.130.225] X-ClientProxiedBy: AM5PR0701CA0001.eurprd07.prod.outlook.com (10.168.161.11) To SN2PR07MB2589.namprd07.prod.outlook.com (10.167.15.19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 73115974-9329-4e24-1355-08d4d4184061 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:SN2PR07MB2589; X-Microsoft-Exchange-Diagnostics: 1;SN2PR07MB2589;3:SHeCMQgyXbW9SBIf82viHx5PBS40GWhavd0rEuhl16ozcBz8T9Y+VZO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g9BBHzQxkLYPLakVs5h+H71c6aLXSOAfUhpWBTH3B3WzvEJP65fLFWffZlLzvm+MwAs6eVgwQJR7yh/jM2f6e1SFP6PA/zzCjM2hCzRHup61KBth2JM8shL0MQoMvtDsf0SLQ3rNI3l9gGvEqdXgBa1AhTBFYAYnydmymjm0Fso68tvhTnJmIvEOnv8N6bUvHtfdENGvYJAAB1RX3OeCH3C0D5Zh/b2BxQn9SGsS2nWvjCcJVQO0NqPQlx4GwUUenFu1avE0R/bJiryup8LwN9ltmLWQHhZR6g/WxzDVsgomVE1KU6p9Cr4NwtXj09Xkv1xy3TYnaG/JbSERojQMLw== X-Microsoft-Exchange-Diagnostics: 1;SN2PR07MB2589;20:jNPaBolY//Pnn966yjvZQgH3t9jMV8/zcL82Na++Ud3OIeV3lwzw/KjN3Sebx5JY//yORzsEzH7hk1unrAA11b4sz2D0y01fgfBWXkLT3qslPcY4xALnBOYaV+nDmGneL/mBgo+YdNadGWVbfNaoNIR9YgnPx/in1Yan3X7XnyUkDc4aSjT+nPUNqWa3VUoYCZhG9N+F6KwGUkftv4u5Fa6N9LsliyT5q2KqfGVs/G343u6Uf3v1BSuqTCiXeErrypP00mBLfK4IjbU97PCz8lhrHOkms+w577bTk2lMLjbxlY1SMqJ69n7WXokztytqhsXNqxbAs4fwrXah4Gs8hROBl8V4lf3O9st802HL1LHKsVMKcjBhSw2Ghkhy2L6S83DEPLpSjQuzH6FgFJBnucFRjSPudGfZr8B5ySHZXF19c7v40UhV9HsHlInvrQETAjGo+TjPj8qNzMR4LCHFvp7a5NeB4T72N8W5DIEz4+GHojEvk0Y8sEQwum4eYxZQCnTJlQmv/lEJwV6diWiTI5henPFMxO/Pc7BxFeKirkgnMEYc+7I7lmUFmVS0KCFZCInp6+B3bPGtinKOc74DC3g8ps6thVgS+OpWGQ6FFQA= X-Exchange-Antispam-Report-Test: UriScan:(258649278758335); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(93006095)(100000703101)(100105400095)(3002001)(6041248)(20161123562025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN2PR07MB2589;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN2PR07MB2589; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN2PR07MB2589;4:NbEObhhLRn8/xMjHf7NRSPcojknY0bEl83zcuXef2B?= =?us-ascii?Q?C73hA+baBzs2d2XzmOkwuCHD3WJrrpia06GxDPwNP+UO9AKNpj+Ig1PpGKGh?= =?us-ascii?Q?yPluREYJ7vyuaMT+4GKXLJKCG4MwjNzsc0UvXfSsFvV4mdWIJ/9sktmYB9Gp?= =?us-ascii?Q?kdh9cIM3211K4PDCPKA5K0zkV9GezZjSVKy3eGiGYw4liDgcD4Gvl4kz9qFa?= =?us-ascii?Q?XJpwShBLerTLnZlQ4F31I285msxY7q39X/Bvf0jPt5N06jKC2YUPQ0HMepaB?= =?us-ascii?Q?oXr7vSe6EVmlSYeHvIVjse2uPIuNtKhJ7FB01ztZarFvGZ0EDAHL1nrGbtv7?= =?us-ascii?Q?DSXVo+lnD2jxnZzd8A6simktei6wfiEaqo2fwQoY8ex7xIHx97KD0PL65q/x?= =?us-ascii?Q?r+0mhjUuIglejDw1vnr/K/DFrFB8oSPoZ2dr/gkQ8nJMibLPN0a4aPJavi1E?= =?us-ascii?Q?K7kL6coZcIxmmUgGruR988+9bTrOJeoK7sS96zy2zXxdzJsAEApLqiDtp/yY?= =?us-ascii?Q?UgpWavSHJ2F/WG9aC11kkha1TfwtolsaD+T5GtJC+s3YQ13GZN/g206Bq/Qz?= =?us-ascii?Q?YllszXZCM24q59euGDFXWRyNq5NPLsBY2iWD9YYjr8Tk9SjHUkYVGAj37rfd?= =?us-ascii?Q?0XBoPaSzmVH9EuasnOfk+AbQybwuFiMQ4vhNpxx5RPxqQUgWbBfDVOjgdNER?= =?us-ascii?Q?582YJTasER3focGR+Gfa5KfXXM+zyNlS+MNPaVwzLmx9QfVYGMP2EGmVzGgt?= =?us-ascii?Q?0udhILmWSLEirc8uOvSWtOo/366ZDfHu8+D1uEVzheQqMErHMCLq06KdYmDv?= =?us-ascii?Q?/hBBzIH2RQuvRnmMN89wzrqGSv5U5ctlViDjjSgetycbephskYa5RnKyC1bs?= =?us-ascii?Q?O5TNaNkNEY8mn4W1dhdatrwgJ7zu95HLPcmk/NGzhBk2NnLxZV/AXvH9i+1p?= =?us-ascii?Q?YSXWcHNh3jxP2as3R6Q4fQCB5LE1zorTdVXtAKiHlRZUtlMVYj1q/w66N+e2?= =?us-ascii?Q?hfL6OLHNRaMeJEn2eqNyJeqmd+OmVwTg0t9niSpSsVMxAgX2PyqINTRrmEIT?= =?us-ascii?Q?LMI/+L0hQJiemEewjqT8+d2SN0kWT2Jzbtp7s68lKeOfLuM4HphvWU+NXCMc?= =?us-ascii?Q?NeT1gBe7Zsbd/yBP52L1Ta8CAURXa5PvyC9w2gK+o4brm+IOlHGg=3D=3D?= X-Forefront-PRVS: 038002787A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(39860400002)(39840400002)(39450400003)(39850400002)(39400400002)(39410400002)(199003)(189002)(24454002)(57704003)(23726003)(54906002)(110136004)(105586002)(1076002)(55016002)(3846002)(6116002)(106356001)(38730400002)(33716001)(42186005)(229853002)(4001350100001)(6496005)(6916009)(42882006)(189998001)(2950100002)(6666003)(97736004)(101416001)(6246003)(50986999)(76176999)(54356999)(53936002)(33656002)(66066001)(47776003)(6306002)(9686003)(2906002)(5660300001)(25786009)(478600001)(7736002)(966005)(83506001)(50466002)(305945005)(8676002)(53546010)(72206003)(68736007)(4326008)(81156014)(7350300001)(81166006)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN2PR07MB2589;H:hc;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN2PR07MB2589;23:BeKbv0GLjl5u4Zl90r3/2elLbQyySXs16XnMXtLsV?= =?us-ascii?Q?qqF0YWu/C3mXR0qA/DP4NZWGp+C47ewxr9L6NIYEQrw5LsdUA7QbNlCN5Sym?= =?us-ascii?Q?Qj9jII8ooAkXjP21pC1vrjVbmvfMKaZewpbdi5X1QTMRklZhu3fMKM3kb3ti?= =?us-ascii?Q?9z1zMCauzkL0m/d5zQS3dDlPECBPr7YDG2YzhW4tA4SLMBY58V0QSawc7uns?= =?us-ascii?Q?uqrwK2v+2cHhWmFA6y/ZmPUJm1T1X3EcqLm2pJCUUaDNGS52qKRJEqVdpPcG?= =?us-ascii?Q?eSTABKdyVI69GquZFhikxmr3QH5fJkWV22eFNtowxcPtVmoUQAeFilmWPNMd?= =?us-ascii?Q?gKjCeTFCTxheiTsgwa89eNz2KVPpmVwZ62cQbPqeIMoqYOALLGcR//90BF3R?= =?us-ascii?Q?/t+hdHoJACWa/v4ddLmXX4UsZdturfggcA2dG3x+n3Y1bvonqogRDJgwIdvP?= =?us-ascii?Q?OpHM/lRSPUxzrIr5sTBHPQkB8kWtUduj4Zj2Pn5vNWBOom1dapYXIoSAFMAO?= =?us-ascii?Q?Hure0yyrKRcEEwquZsmg6CEb9H9eNGF2zv+G48qcQQQhJKSHmR/JE+zp23ut?= =?us-ascii?Q?ksVao3ozV8UER8Yw/i+707F4Bu1a0daUoHeDqu/XgsgW4yOZCANinz46Aci6?= =?us-ascii?Q?Kjdcc9v0VGRHXQBgf1Q9kjNAs8B78YEAh2BfCyzUj4BYeIZv7iuiIpNRZj/W?= =?us-ascii?Q?fq0iXYtLUcYDaCSZv+vuHEGaZtzOB60wCfo92uaM7AK64SgX6SRNxpxwdImp?= =?us-ascii?Q?XKE7a5dEiQ5lVH94zd0MisO4Txe2jgEGmyv//WyKIceHtX8l3Y/ZGDCZvQSt?= =?us-ascii?Q?RB+h914/8P0JuHC97hSAJPGK2UWdAe4iwTSkB7hKb8wPWJsemawrShcxy9vn?= =?us-ascii?Q?vsdJ8TYNc0mhkLSAfco2Wbgp3eXo2vQDlWkgK+o8Un2jUuQ71SW8TpvoH3/V?= =?us-ascii?Q?CVzhRuUXrYST0U9QRxMHW/zBu+sxe/R43jQa5UNgFHkovGw798vaUooORiGz?= =?us-ascii?Q?GQZ+hY4tV1MpybtkU9rzMNRaj4WWhf1cU8i1rOYiNkFCf3GUuy1NSfdlVQm0?= =?us-ascii?Q?jqT9zbFsV0X1v7Vq6MrYkwbfABe7ninlcYL/m7PWrRLhccymB5pgy5EJKphV?= =?us-ascii?Q?HFPk7bXADD0JFF0Va7kA1hcLULFYHZjXp76umRhbrnPm0MOuEoU3fhSB/O2e?= =?us-ascii?Q?QAt/73eNNHLavGHDiUByOiqqjtTHi5dGenO/rG1LVRmhOkGUn/of+0axg68F?= =?us-ascii?Q?SIdb0dMba8vMA2sZab4GmpJEqvkL8nEUjXw1pBt2gVJB3yYPkifO5jSX+MNZ?= =?us-ascii?Q?ys8CWSG/1rbQV4sx8yZCSp9R0xJeMV76PK/hUaIT3rNjGSfG0ccnFnAVqi/m?= =?us-ascii?Q?TqxP24T+qsVDjUKuFOo+7FQRXOIRDhumz0X60XylGzzBwBq1/ckjyHlcDg49?= =?us-ascii?Q?ksQVAeuQLfgD/maIiDjMj1HK8+yKykswovcflfhFNuf02EVqX5d78FbkNhCn?= =?us-ascii?Q?F2LkOe++vd/12jjp99o33Rn/61H/kH17iwOXWo97KWRX1uNStA+AxZP?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN2PR07MB2589;6:0umiySM+byFqPvew/vQb3VZ/iXadyhaS/LFON9x5wd?= =?us-ascii?Q?dHNdC59gq4Ky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c9UrLc0BD8U/vo+RCHgJjPuEAk27Bw3XNXFuH3dmIfBDJv3IwgaZO2mnidZdO1QQyGL6ugATLX5F1XCqbtB6Vvoaa09zW06QgrZWeNbYOLjHeEQue2/LKwoDIxuYIISt+wHAnFslmrS1rHqu/znELfHFrLDNYNR8sBTgxbzGdXv2emEmFU+Q5WgSba4EefNx/nRS6kLZQGy5DC+GTG++U+vIW6VL2VuZHAsZZuAssEwcXr69prLC7ev6tITmP4W67WAtlHZ6leG6WtnU8ZbIgSTgOPGhuvlT8IejeLlxcwK+iYX3jNmdcRFGL5lYofgfA6XWvMcbpF3d88o8snBchlScuz7NjUsn3ZSo1Id+eOgDx/WSfGg54cfCaMORcISGje91Gb6Cgax3Aq5LoSNiXxkE7ePxFYqg0VncC40XmbsQZYgky7e3emaJSVy9b+PcLoypgSvH1uYV+BBZpt9whqCzE3Jh1zFMkcWTz9Si5kZVp0lj5xCaUThCpUpbAAz/q74enTP1/VqjTduyOVJ0fF4nWzrkk4wa4EnuFBMHQ/4GhOxrPkAecQhDhzrxTjunDfXOs1TYLQ= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2017 11:19:57.6114 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2589 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5553 Lines: 175 On Tue, Jul 25, 2017 at 04:39:18PM +0100, Suzuki K Poulose wrote: > On 25/07/17 16:04, Jan Glauber wrote: > >Add support for the PMU counters on Cavium SOC memory controllers. > > > >This patch also adds generic functions to allow supporting more > >devices with PMU counters. > > > >Properties of the LMC PMU counters: > >- not stoppable > >- fixed purpose > >- read-only > >- one PCI device per memory controller > > > >Signed-off-by: Jan Glauber > >--- > > drivers/perf/Kconfig | 8 + > > drivers/perf/Makefile | 1 + > > drivers/perf/cavium_pmu.c | 424 +++++++++++++++++++++++++++++++++++++++++++++ > > include/linux/cpuhotplug.h | 1 + > > 4 files changed, 434 insertions(+) > > create mode 100644 drivers/perf/cavium_pmu.c > > > >diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig > >index e5197ff..a46c3f0 100644 > >--- a/drivers/perf/Kconfig > >+++ b/drivers/perf/Kconfig > >@@ -43,4 +43,12 @@ config XGENE_PMU > > help > > Say y if you want to use APM X-Gene SoC performance monitors. > > > >+config CAVIUM_PMU > >+ bool "Cavium SOC PMU" > > Is there any specific reason why this can't be built as a module ? Yes. I don't know how to load the module automatically. I can't make it a pci driver as the EDAC driver "owns" the device (and having two drivers for one device wont work as far as I know). I tried to hook into the EDAC driver but the EDAC maintainer was not overly welcoming that approach. And while it would be possible to have it a s a module I think it is of no use if it requires manualy loading. But maybe there is a simple solution I'm missing here? > > >+#define to_pmu_dev(x) container_of((x), struct cvm_pmu_dev, pmu) > >+ > >+static int cvm_pmu_event_init(struct perf_event *event) > >+{ > >+ struct hw_perf_event *hwc = &event->hw; > >+ struct cvm_pmu_dev *pmu_dev; > >+ struct perf_event *sibling; > >+ > >+ if (event->attr.type != event->pmu->type) > >+ return -ENOENT; > >+ > >+ /* we do not support sampling */ > >+ if (is_sampling_event(event)) > >+ return -EINVAL; > >+ > >+ /* PMU counters do not support any these bits */ > >+ if (event->attr.exclude_user || > >+ event->attr.exclude_kernel || > >+ event->attr.exclude_host || > >+ event->attr.exclude_guest || > >+ event->attr.exclude_hv || > >+ event->attr.exclude_idle) > >+ return -EINVAL; > >+ > >+ pmu_dev = to_pmu_dev(event->pmu); > >+ if (!pmu_dev->event_valid(event->attr.config)) > >+ return -EINVAL; > >+ > >+ /* > >+ * Forbid groups containing mixed PMUs, software events are acceptable. > >+ */ > >+ if (event->group_leader->pmu != event->pmu && > >+ !is_software_event(event->group_leader)) > >+ return -EINVAL; > >+ > >+ list_for_each_entry(sibling, &event->group_leader->sibling_list, > >+ group_entry) > >+ if (sibling->pmu != event->pmu && > >+ !is_software_event(sibling)) > >+ return -EINVAL; > > Do we also need to check if the events in the same group can be scheduled > at once ? i.e, there is enough resources to schedule the requested events from > the group. > Not sure what you mean, do I need to check for programmable counters that no more counters are programmed than available? > >+ > >+ hwc->config = event->attr.config; > >+ hwc->idx = -1; > >+ return 0; > >+} > >+ > ... > > >+static int cvm_pmu_add(struct perf_event *event, int flags, u64 config_base, > >+ u64 event_base) > >+{ > >+ struct cvm_pmu_dev *pmu_dev = to_pmu_dev(event->pmu); > >+ struct hw_perf_event *hwc = &event->hw; > >+ > >+ if (!cmpxchg(&pmu_dev->events[hwc->config], NULL, event)) > >+ hwc->idx = hwc->config; > >+ > >+ if (hwc->idx == -1) > >+ return -EBUSY; > >+ > >+ hwc->config_base = config_base; > >+ hwc->event_base = event_base; > >+ hwc->state = PERF_HES_UPTODATE | PERF_HES_STOPPED; > >+ > >+ if (flags & PERF_EF_START) > >+ pmu_dev->pmu.start(event, PERF_EF_RELOAD); > >+ > >+ return 0; > >+} > >+ > >+static void cvm_pmu_del(struct perf_event *event, int flags) > >+{ > >+ struct cvm_pmu_dev *pmu_dev = to_pmu_dev(event->pmu); > >+ struct hw_perf_event *hwc = &event->hw; > >+ int i; > >+ > >+ event->pmu->stop(event, PERF_EF_UPDATE); > >+ > >+ /* > >+ * For programmable counters we need to check where we installed it. > >+ * To keep this function generic always test the more complicated > >+ * case (free running counters won't need the loop). > >+ */ > >+ for (i = 0; i < pmu_dev->num_counters; i++) > >+ if (cmpxchg(&pmu_dev->events[i], event, NULL) == event) > >+ break; > > I couldn't see why hwc->config wouldn't give us the index where we installed > the event in pmu_dev->events. What am I missing ? Did you see the comment above? It is not yet needed but will be when I add support for programmable counters. If it is still confusing I can also remove that for now and add it back later when it is needed. > >+static int __init cvm_pmu_init(void) > >+{ > >+ unsigned long implementor = read_cpuid_implementor(); > >+ unsigned int vendor_id = PCI_VENDOR_ID_CAVIUM; > >+ struct pci_dev *pdev = NULL; > >+ int rc; > >+ > >+ if (implementor != ARM_CPU_IMP_CAVIUM) > >+ return -ENODEV; > > As I mentioned in the beginning, it would be better to modularize it right > from the start, when we can, than coming back to this at a later point in time. > > Btw, perf_event_update_userpage() is being exported for use from module. > See [0]. > > [0] http://lists.infradead.org/pipermail/linux-arm-kernel/2017-July/520682.html Nice, I think I proposed something similar :) thanks, Jan > Cheers > > Suzuki