From patchwork Sat Sep 24 05:47:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Rui X-Patchwork-Id: 609058 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 512A8C6FA8E for ; Sat, 24 Sep 2022 05:45:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233414AbiIXFpC (ORCPT ); Sat, 24 Sep 2022 01:45:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233392AbiIXFo6 (ORCPT ); Sat, 24 Sep 2022 01:44:58 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C520622538; Fri, 23 Sep 2022 22:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663998279; x=1695534279; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=QqXva2JUu/RQnDI1kxBjde7cPAYIQfasEASf2LkrJPY=; b=LVmyC7Dn6PG0M2lkYuVjgdtbAxDjI3gDvlJAdJHtM4s0dJnntljWIyq4 iimY9W4/NpBZcfj82g25oi3sJrzgl2NRv8T5KeGQB5Ft5pj/PrtHR/vLT 6KadGRt96fPmcHIBFU+VTnPxNZ05a+AsShd5P9Zz7yIQx6phb7cKOc4ME meyJVy3Xu51khlyqBGF+SLGCf0Xn+ncwLv7c1ybJ0bhmqRhnGaNFLd4MK 4pyFfrSXh0+PbrXM87JcvD0gLv3Klx8aCtGrn+OEeMNONCVH7pN3PSDb0 dhR35FENaiFkWwn4hs0RHHLmF6ecLhhnHorhaOwJQuKe9bPScHSw/mXLP g==; X-IronPort-AV: E=McAfee;i="6500,9779,10479"; a="299470286" X-IronPort-AV: E=Sophos;i="5.93,341,1654585200"; d="scan'208";a="299470286" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 22:44:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,341,1654585200"; d="scan'208";a="651207763" Received: from power-sh.sh.intel.com ([10.239.183.122]) by orsmga008.jf.intel.com with ESMTP; 23 Sep 2022 22:44:36 -0700 From: Zhang Rui To: peterz@infradead.org, rjw@rjwysocki.net, len.brown@intel.com Cc: mingo@redhat.com, linux-pm@vger.kernel.org, x86@kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@linux.intel.com, artem.bityutskiy@linux.intel.com Subject: [PATCH 1/3] powercap: intel_rapl: Use standard Energy Unit for SPR Dram RAPL domain Date: Sat, 24 Sep 2022 13:47:36 +0800 Message-Id: <20220924054738.12076-2-rui.zhang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220924054738.12076-1-rui.zhang@intel.com> References: <20220924054738.12076-1-rui.zhang@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Intel Xeon servers used to use a fixed energy resolution (15.3uj) for Dram RAPL domain. But on SPR, Dram RAPL domain follows the standard energy resolution as described in MSR_RAPL_POWER_UNIT. Remove the SPR dram_domain_energy_unit quirk. Fixes: 2d798d9f5967 ("powercap: intel_rapl: add support for Sapphire Rapids") Signed-off-by: Zhang Rui Tested-by: Wang Wendy --- drivers/powercap/intel_rapl_common.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c index 949eb90f5733..d8eaa04bf2af 100644 --- a/drivers/powercap/intel_rapl_common.c +++ b/drivers/powercap/intel_rapl_common.c @@ -1035,7 +1035,6 @@ static const struct rapl_defaults rapl_defaults_spr_server = { .check_unit = rapl_check_unit_core, .set_floor_freq = set_floor_freq_default, .compute_time_window = rapl_compute_time_window_core, - .dram_domain_energy_unit = 15300, .psys_domain_energy_unit = 1000000000, .spr_psys_bits = true, }; From patchwork Sat Sep 24 05:47:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Rui X-Patchwork-Id: 609296 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30B73C6FA82 for ; Sat, 24 Sep 2022 05:45:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233383AbiIXFpD (ORCPT ); Sat, 24 Sep 2022 01:45:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233396AbiIXFo7 (ORCPT ); Sat, 24 Sep 2022 01:44:59 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EED3D303EE; Fri, 23 Sep 2022 22:44:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663998282; x=1695534282; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=QrNQIZ0qq8HRIyiV/4AC87Fjnz2QKG8N162m/6PAQCA=; b=cvzLKvIOGrlqVaYiV3nvqNbVFk3PS0gdm2MCFB6KLKNWpPRtzpRQWZ0K p2x0dBz5HABJ/X8aSAMKzPYolEPQ72Q30YxGCOsEohJvl85RnVr5iNG6I ECwwsgLXiCe2gQeGk/wIwMlXJGN83Zb7RyN31wo4VI3lJyeyZBtp4SsCK KgruK2lwOUQsyr44I6JL7cEtIdxlTd4t3jd5fZMRWrkyjCK9BPrKZlMtp pjKHi868X70rX3/16odWMxse0QC3EaanR97vTJlaDw0kx7R90C0sMZX9t hBiHPGSeD5kdaestRtyv7LorMica5gmgRBPGYUVxcY9aeC9TCUr6Wj4aC w==; X-IronPort-AV: E=McAfee;i="6500,9779,10479"; a="299470291" X-IronPort-AV: E=Sophos;i="5.93,341,1654585200"; d="scan'208";a="299470291" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 22:44:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,341,1654585200"; d="scan'208";a="651207770" Received: from power-sh.sh.intel.com ([10.239.183.122]) by orsmga008.jf.intel.com with ESMTP; 23 Sep 2022 22:44:39 -0700 From: Zhang Rui To: peterz@infradead.org, rjw@rjwysocki.net, len.brown@intel.com Cc: mingo@redhat.com, linux-pm@vger.kernel.org, x86@kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@linux.intel.com, artem.bityutskiy@linux.intel.com Subject: [PATCH 2/3] perf/x86/rapl: Use standard Energy Unit for SPR Dram RAPL domain Date: Sat, 24 Sep 2022 13:47:37 +0800 Message-Id: <20220924054738.12076-3-rui.zhang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220924054738.12076-1-rui.zhang@intel.com> References: <20220924054738.12076-1-rui.zhang@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Intel Xeon servers used to use a fixed energy resolution (15.3uj) for Dram RAPL domain. But on SPR, Dram RAPL domain follows the standard energy resolution as described in MSR_RAPL_POWER_UNIT. Remove the SPR Dram energy unit quirk. Fixes: bcfd218b6679 ("perf/x86/rapl: Add support for Intel SPR platform") Signed-off-by: Zhang Rui Tested-by: Wang Wendy Reviewed-by: Kan Liang --- arch/x86/events/rapl.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c index 77e3a47af5ad..7d8db681880d 100644 --- a/arch/x86/events/rapl.c +++ b/arch/x86/events/rapl.c @@ -619,12 +619,8 @@ static int rapl_check_hw_unit(struct rapl_model *rm) case RAPL_UNIT_QUIRK_INTEL_HSW: rapl_hw_unit[PERF_RAPL_RAM] = 16; break; - /* - * SPR shares the same DRAM domain energy unit as HSW, plus it - * also has a fixed energy unit for Psys domain. - */ + /* SPR uses a fixed energy unit for Psys domain. */ case RAPL_UNIT_QUIRK_INTEL_SPR: - rapl_hw_unit[PERF_RAPL_RAM] = 16; rapl_hw_unit[PERF_RAPL_PSYS] = 0; break; default: From patchwork Sat Sep 24 05:47:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Rui X-Patchwork-Id: 609057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A0A3C6FA82 for ; Sat, 24 Sep 2022 05:45:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233373AbiIXFpH (ORCPT ); Sat, 24 Sep 2022 01:45:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233399AbiIXFo7 (ORCPT ); Sat, 24 Sep 2022 01:44:59 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B501F3BC79; Fri, 23 Sep 2022 22:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663998285; x=1695534285; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=aktu51+28FaoJRxOu94f10+s9e/A7ngnX7byejD6d3s=; b=RG9cFJmIH+/DoOYn3J7gULp7D3lf29qWNkJgxSm8Op91MCsxmwGEWgaP feSYJRDGJpWPPdqGyP8bM5g+U7FWJagvKt/5+d0Iqupq/nJZXBzW1welX kXwytf6+QBPSOfn+h4bHEiC0wG1KwHMi8i1HCwJ38hI9IontS/W7tmDz4 PJUP4xVRR2bQ3QGjh202Md0YUjrHQ/JHNyxIuQY2wC9M7c4ycES61P0lK l/5eqqD/hN/6LPpe3n4vOZOUnlnRcTMSNfPKRhSwm95ictJWgQK3GMzG8 zViBOIIHuzaGNSquQDxR1FoYQ9wYg3Y5v8FC3NmKNG5U5wZMvTJ0d4NL9 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10479"; a="299470293" X-IronPort-AV: E=Sophos;i="5.93,341,1654585200"; d="scan'208";a="299470293" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 22:44:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,341,1654585200"; d="scan'208";a="651207779" Received: from power-sh.sh.intel.com ([10.239.183.122]) by orsmga008.jf.intel.com with ESMTP; 23 Sep 2022 22:44:42 -0700 From: Zhang Rui To: peterz@infradead.org, rjw@rjwysocki.net, len.brown@intel.com Cc: mingo@redhat.com, linux-pm@vger.kernel.org, x86@kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@linux.intel.com, artem.bityutskiy@linux.intel.com Subject: [PATCH 3/3] tools/power turbostat: Use standard Energy Unit for SPR Dram RAPL domain Date: Sat, 24 Sep 2022 13:47:38 +0800 Message-Id: <20220924054738.12076-4-rui.zhang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220924054738.12076-1-rui.zhang@intel.com> References: <20220924054738.12076-1-rui.zhang@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Intel Xeon servers used to use a fixed energy resolution (15.3uj) for Dram RAPL domain. But on SPR, Dram RAPL domain follows the standard energy resolution as described in MSR_RAPL_POWER_UNIT. Remove the SPR rapl_dram_energy_units quirk. Fixes: e7af1ed3fa47 ("tools/power turbostat: Support additional CPU model numbers") Signed-off-by: Zhang Rui Tested-by: Wang Wendy --- tools/power/x86/turbostat/turbostat.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 597cc2dbc456..e3e357df2a51 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -4560,7 +4560,6 @@ static double rapl_dram_energy_units_probe(int model, double rapl_energy_units) case INTEL_FAM6_SKYLAKE_X: /* SKX */ case INTEL_FAM6_XEON_PHI_KNL: /* KNL */ case INTEL_FAM6_ICELAKE_X: /* ICX */ - case INTEL_FAM6_SAPPHIRERAPIDS_X: /* SPR */ return (rapl_dram_energy_units = 15.3 / 1000000); default: return (rapl_energy_units);