Message ID | 20230301181449.14647-1-wyes.karny@amd.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3792779wrd; Wed, 1 Mar 2023 10:25:46 -0800 (PST) X-Google-Smtp-Source: AK7set/rEU76EINO5mY1dxsqm0HQEYuhza8rqGAtrv0A3mC7ASFOfr1xFaeMLnizYY2H5O27o1C0 X-Received: by 2002:aa7:cc0e:0:b0:4af:6c25:ed6a with SMTP id q14-20020aa7cc0e000000b004af6c25ed6amr7135878edt.3.1677695146562; Wed, 01 Mar 2023 10:25:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677695146; cv=pass; d=google.com; s=arc-20160816; b=GeVFedFbkuvszJr8F7IiiCGFkMLVtS3M8HghfZ7CpBVPvZjPb2L7YLZDrg5cu0Ub83 WrqiarsH6oR1sQ9bXkcjDG7TIe4lDKrWdyy3bNVtY5/mj7qjqxL2bTnGmHqsaQtCnd9d jNPlXmXe5EUfxSLGdmMq6VGKkgjF5IijwdtkKSuQnK+9OG/W8jx8LhYW65Kz4aZV4zgN XURMtBW/WKvltL9d9ZVyvyS68TpzBcGehWOYEmcp2mQo0VDmjm8KLLoBTU56bgm8bb33 E4Sb1ZLJSERuFuVa0BW47zBazCcgw/tRBkRUB0SlnQYq5CoN+PvWY+Yd39SnCqjo4Jwx rCtA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=aOcBlym5TcADetOq53dWoslVw2WdZKQWtgC35MQBsDw=; b=YBBoXkEisRjBfbp+uGCr3ejfUDT7noinSAZ0cCt8iL+m0jsd1YGKtS6GIT28u1WrPu UMjDv4OblHiPhYMonq8SWIfEf/QWpqAWg4hScUcGfzu7cCDyoJiNxeIXz2LHaUjgGdfc NKZZrIlaaxPhiPSAHP4UJUbL30+ONdNQedpkvM8X4rIucxVIz1Q0ke4dnQjBJ2Ndp+/d uLagj+eUzOk5R/DHavkGhbyJ/M4ndnXxO3pcfyZJS2KWdjZN/Ce88sZ9WEM4gh2mvgYN qVdBUBKZvKwSKUudPp3sRJ1H8y/3mOXqxZD4cCG7eVhosiItiUFzeahOr7hFYG9zgjH9 Y8Pg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=3D7PB+Aj; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h17-20020aa7c611000000b004acc81dbd6asi2920450edq.588.2023.03.01.10.25.20; Wed, 01 Mar 2023 10:25:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=3D7PB+Aj; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbjCASPd (ORCPT <rfc822;david.simonyants@gmail.com> + 99 others); Wed, 1 Mar 2023 13:15:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230131AbjCASPb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 1 Mar 2023 13:15:31 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2059.outbound.protection.outlook.com [40.107.220.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 562AB28207; Wed, 1 Mar 2023 10:15:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wo2QCNQ3USi1Uwz3CcV6p1uJ2Tegfb1BcEIGiMfMYPUcrmfnEYeasMJu2lx6Egd1KzlFSsv9htifNqM4jeLd+eiwoQANb3uO2z6Hk/CfGxOIGe8BKZQIMTS1fVMJCeTj+0/jrVlKknax0TwHZFs6Cm5tKD5uGog9M6jUYnYce+y81DjMtCAvADr8n94wEASzOfab4vYfpFfzgSwzrhqAIlNz5YLyNdYE433iPMd0+YLkmaTq7+qgW6/+xvXRq/sgYN9clhAzeNSPIVk4dvRcXBanfec4XbXtjhFwZ2FvhEWyxu6OUnt6XXAmoJei5CDgcaw0uYMUDoE5d+7386bE/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aOcBlym5TcADetOq53dWoslVw2WdZKQWtgC35MQBsDw=; b=KWX/ZetzAY1tzY4YMbAu6l/nYIpYZWF5v2cBWMPgpcG1EB5QQbY6wJHUQMC0ZwYqRgQlxcxmxgqlCM9jWm9JbVbeDh+w+ovsGfn4W2Zz/piTvfkwTVqlRB+MAsPkVBuC4EfcM98o9OLRRO6d47kWZ6hxBh/AOKppKLKHevFwpqWz79RJd/UZ62XOXQdDOEwG6Gr2RlUQitSgucjLcnbOMcCeKBTL6YGB3p265bkY7+ddDchQjB2OY0GhNW5jOwVPdR+1K6BI/FUgMypcL5cAeGre9NVsuAxkOIn0Ih1t6inktK5wf+s5bFaiagrKxVf93UMsMJHFhU2vNMYtFI2ClQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=infradead.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aOcBlym5TcADetOq53dWoslVw2WdZKQWtgC35MQBsDw=; b=3D7PB+AjmqtaN4F+R6N0qqc9zjFo3Q0m+CNsQ23Fkq6Y5ahRsZpLBQQhxIFiXcJlvtyWJhT0GJy5BN0+EWGlo//xcrshG6dLoMI61yRUnmIY5VL23jFueCPp0kqF1COCv7ibwng8tDD0RsKtOMrrf3XSZAKk099DS3aLxIkRaNc= Received: from DM5PR07CA0080.namprd07.prod.outlook.com (2603:10b6:4:ad::45) by IA1PR12MB7662.namprd12.prod.outlook.com (2603:10b6:208:425::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29; Wed, 1 Mar 2023 18:15:16 +0000 Received: from DS1PEPF0000E651.namprd02.prod.outlook.com (2603:10b6:4:ad:cafe::a1) by DM5PR07CA0080.outlook.office365.com (2603:10b6:4:ad::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.18 via Frontend Transport; Wed, 1 Mar 2023 18:15:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF0000E651.mail.protection.outlook.com (10.167.18.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6156.12 via Frontend Transport; Wed, 1 Mar 2023 18:15:16 +0000 Received: from beas.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 1 Mar 2023 12:15:10 -0600 From: Wyes Karny <wyes.karny@amd.com> To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, "Namhyung Kim" <namhyung@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, "Borislav Petkov" <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, <hpa@zytor.com>, Stephane Eranian <eranian@google.com>, Oleksandr Natalenko <oleksandr@natalenko.name> CC: <x86@kernel.org>, <linux-perf-users@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <gautham.shenoy@amd.com>, <ananth.narayan@amd.com>, Muhammad Usama Anjum <usama.anjum@collabora.com>, Wyes Karny <wyes.karny@amd.com> Subject: [RFC PATCH v2 0/2] Enable Core RAPL for AMD Date: Wed, 1 Mar 2023 18:14:47 +0000 Message-ID: <20230301181449.14647-1-wyes.karny@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E651:EE_|IA1PR12MB7662:EE_ X-MS-Office365-Filtering-Correlation-Id: 24f1c78a-ff67-41b2-8df3-08db1a80e8a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k8qKLaXN0g+fR6CSd7IWBHrDrLpOfQrO2AXXK39nZJyyL5W3DS72ndAIvNOdEM46CnVZwZFYnaM+oWkTvXCxT5w6AS4eMezmt0mX5kZ5Dz7nfHjrEqFrB/DRVVKsypDVv1GzXda8E/UuBMdJf3hu3+VZK9WBRNbIt/4UfhcUHw76m0K12jKn6FQafIw+RKh8GhELUZSR+ydYs/4iPOx3NjzclTd+JmMfpsN003RSiTT8y096zp5mnz+DeR0BkfI7VRe69twvdnpjd4AqioZbiNbBWIlUhXlS1rNHu2ywIbLtffx+dE25B4rvIXJd/FOT+VjRE0Bi6sXb/RfpujD8qcDDstz4LbjSBqrp63NKxFOQeYfNH0JaKACdvvWiS5EISPuOa1PQSltBUfvecMWEXoufYHJBsFwkL6IgsQD0l/xJDeFcxmbLZ6SDweGXoHcOt1x0rxQ8CthnC1p4MPg/mdd8QfuqOAPDnKDpwsGffQscr5P/+mC7ME/1MjnQJYimXx6qNRdrj7BAGkFjsMMBOrZndpLEu60LylFDB7zi50bhfSSRhz7YAtQS9bDlDasR48tlbHk3SCDv/m13GIzFUQSs9cXdoYNMT2YLiwuEZifrYQAoMoclKA3CvcHez0kKEXiBxZ09wtpNYvs/R95lhpjoHHNrEwZgnJUlU138/a83GTH4IockuWrQDNJ62IDlVPnyskzmLNb3fxmXIE7AvaXk1h+5judQmugdknqtC8cLuwS7O6AjsLy3MqQdfkEefKS8cbGDrYR3EoEnN7nyuA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(396003)(376002)(346002)(136003)(39860400002)(451199018)(46966006)(40470700004)(36840700001)(40480700001)(356005)(921005)(336012)(1076003)(2616005)(316002)(86362001)(966005)(70206006)(36756003)(7696005)(70586007)(54906003)(478600001)(40460700003)(6666004)(41300700001)(110136005)(82740400003)(8676002)(16526019)(26005)(186003)(4326008)(36860700001)(2906002)(8936002)(47076005)(426003)(44832011)(4744005)(7416002)(82310400005)(5660300002)(81166007)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2023 18:15:16.3223 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 24f1c78a-ff67-41b2-8df3-08db1a80e8a2 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0000E651.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7662 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759190866330969468?= X-GMAIL-MSGID: =?utf-8?q?1759190866330969468?= |
Series |
Enable Core RAPL for AMD
|
|
Message
Wyes Karny
March 1, 2023, 6:14 p.m. UTC
This is v2 patch set for enabling per-core RAPL counters through energy-cores event on RAPL PMU. Added RFC tag because a new patch is added and this additional patch may need clarification from the community. While enabling this support with v1 patch [1], Stephane reported an issue where for the first reading of energy-cores event for every core was invalid [2]. This issue is addressed with patch 1 of this series. There is no change in patch 2. [1]: https://lore.kernel.org/lkml/20230217161354.129442-1-wyes.karny@amd.com/ [2]: https://lore.kernel.org/lkml/CABPqkBQ_bSTC-OEe_LrgUrpj2VsseX1ThvO-yLcEtF8vb4+AAw@mail.gmail.com/ Change log: v1 -> v2: - Added new patch to fix the issue reported by Stephane - Added RFC tag Wyes Karny (2): perf/x86/rapl: Fix energy-cores event perf/x86/rapl: Enable Core RAPL for AMD arch/x86/events/rapl.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
Comments
Hello. On středa 1. března 2023 19:14:47 CET Wyes Karny wrote: > This is v2 patch set for enabling per-core RAPL counters through > energy-cores event on RAPL PMU. Added RFC tag because a new patch is > added and this additional patch may need clarification from the > community. > > While enabling this support with v1 patch [1], Stephane reported an > issue where for the first reading of energy-cores event for every core was > invalid [2]. This issue is addressed with patch 1 of this series. There > is no change in patch 2. > > [1]: https://lore.kernel.org/lkml/20230217161354.129442-1-wyes.karny@amd.com/ > [2]: https://lore.kernel.org/lkml/CABPqkBQ_bSTC-OEe_LrgUrpj2VsseX1ThvO-yLcEtF8vb4+AAw@mail.gmail.com/ > > Change log: > v1 -> v2: > - Added new patch to fix the issue reported by Stephane > - Added RFC tag > > Wyes Karny (2): > perf/x86/rapl: Fix energy-cores event > perf/x86/rapl: Enable Core RAPL for AMD > > arch/x86/events/rapl.c | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) Since I was asked to re-test v2: ``` $ sudo perf stat -a --per-core -C 0-15 -e power/energy-cores/ -- dd if=/dev/zero of=/dev/null bs=1M count=1000000 1000000+0 records in 1000000+0 records out 1048576000000 bytes (1,0 TB, 977 GiB) copied, 17,0321 s, 61,6 GB/s Performance counter stats for 'system wide': S0-D0-C0 1 6,67 Joules power/energy-cores/ S0-D0-C1 1 197,93 Joules power/energy-cores/ S0-D0-C2 1 11,32 Joules power/energy-cores/ S0-D0-C3 1 13,88 Joules power/energy-cores/ S0-D0-C4 1 12,40 Joules power/energy-cores/ S0-D0-C5 1 5,10 Joules power/energy-cores/ S0-D0-C6 1 3,92 Joules power/energy-cores/ S0-D0-C7 1 5,65 Joules power/energy-cores/ S0-D0-C8 1 4,91 Joules power/energy-cores/ S0-D0-C9 1 57,18 Joules power/energy-cores/ S0-D0-C10 1 174,95 Joules power/energy-cores/ S0-D0-C11 1 3,58 Joules power/energy-cores/ S0-D0-C12 1 5,41 Joules power/energy-cores/ S0-D0-C13 1 5,33 Joules power/energy-cores/ S0-D0-C14 1 2,89 Joules power/energy-cores/ S0-D0-C15 1 5,61 Joules power/energy-cores/ 17,034519241 seconds time elapsed ``` Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name> Thanks.