From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 02491A0547; Thu, 25 Aug 2022 17:12:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D339D40223; Thu, 25 Aug 2022 17:12:01 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id B516F40156 for ; Thu, 25 Aug 2022 17:12:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661440320; x=1692976320; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=2/14j8pG1dgc//hjAtTATX10unzykBhwO6lg5O/CeBE=; b=nv9ylaPCG8bu+ggx7IQmkZ4NlLvoSN9e5dowSjy/GbM5XLnJSv+Yr+eJ DbCNebwv1HIhp4mD+bb8W9F+tIq7Lm4FP4hWMUM4M7Jn8l1mIbm59fBhE E3SvEY2xOeSzCUydpw2qoIkZMHOBW9RpMQB1sHgfuuv7eowhU3n2bfovg 58aE7pIURfAVXv2+R0BxKuy6AfSsQ0gXNtX7xSszYorBwek9aBu9MVa+E inXhBapSbtI6jtTNGML9HixEJOoEN5/xR3mE5emZr9Z5A1ETtsE2ASqYQ bIPiJzcvRgAZhUcIOpbBJrOpmvg8+2ayLvD1gcteACcqBJAnTGE136F0k Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10450"; a="358230162" X-IronPort-AV: E=Sophos;i="5.93,263,1654585200"; d="scan'208";a="358230162" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2022 08:09:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,263,1654585200"; d="scan'208";a="699489583" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by FMSMGA003.fm.intel.com with ESMTP; 25 Aug 2022 08:09:38 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 25 Aug 2022 08:09:38 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Thu, 25 Aug 2022 08:09:38 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Thu, 25 Aug 2022 08:09:38 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UZSAnaCE6nROM82hPSwqBT7b9zo93HddDREbmS6HUlPlf35dmv+OxZhnn1l1B2lKLWWdv4lDPs6cmDW7RuCx87OATm0eZnxznPCNpO2jdjHG2qpVisq004jLNq+hXNtD8Mx8wSYF4Oru2/48mDbsDUWCsdbWbmjhiOeONTRKfoPo49jmGlWqfXzgltCf+7/G0b5N1CLoVdmHPUgZasC6GVxU4kjDkVF8RTmrWBxbX5MIVzRNWO8vk6p6SFGQq+HrZKH/D1tgEQpMgMMM7I19W8RmNa/jfoIAMob/fMDZQ66Ee0cJi8oWvxFirurGruDD4pp8kQWsnnCvUOMFvIJuKA== 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=lrIfBPnjLWckxNgMPYzggaRQMEZ94R6mLneY4tdKfFM=; b=ngZPOsdQC8barYAf7mCUk28oiPNX2c/HKd3CzxEm4amJpAhieqbGvedRVLHBfG2BAHf9lz8wpaZ//F4PVMK9xotjgKx2/X9tEvNCHihJ8JVrtmLkpYpaIIc2ZH5JdJssbZKY1KKcRc+c/ZO+z2O4XLQPdUVyX4vATPQjyTvf35a8KfxCX3xL4euWW19bQbnBjJoH/dKOR+MTbW6r/ZLWVtN2ad9boWa/U02vbXBCJBNZn2cq0KuDb3kBKgT1O+bPquChGnYHJyEJaY50gOaCMWB9D6E+JPMaDiRW6FOJ79nJBwPZUS+qVODlO8L3fdI7yKZIvVI2cydUis/dqQUBgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from BYAPR11MB3799.namprd11.prod.outlook.com (2603:10b6:a03:fb::19) by BN6PR11MB1937.namprd11.prod.outlook.com (2603:10b6:404:106::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.21; Thu, 25 Aug 2022 15:09:36 +0000 Received: from BYAPR11MB3799.namprd11.prod.outlook.com ([fe80::4959:604c:ca50:38b5]) by BYAPR11MB3799.namprd11.prod.outlook.com ([fe80::4959:604c:ca50:38b5%5]) with mapi id 15.20.5546.022; Thu, 25 Aug 2022 15:09:36 +0000 Message-ID: Date: Thu, 25 Aug 2022 16:09:31 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH] power: add unpriv. read of turbo % for pstate Content-Language: en-US To: Markus Theil CC: References: <20220824192859.66095-1-markus.theil@tu-ilmenau.de> From: "Hunt, David" In-Reply-To: <20220824192859.66095-1-markus.theil@tu-ilmenau.de> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB3PR08CA0013.eurprd08.prod.outlook.com (2603:10a6:8::26) To BYAPR11MB3799.namprd11.prod.outlook.com (2603:10b6:a03:fb::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1a303ea3-f8a8-4837-b590-08da86abd29d X-MS-TrafficTypeDiagnostic: BN6PR11MB1937:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rghaVpWHoIfmaAiH/Qnm73YmOsSEyzOSP8HFxvxN7byg1xzKZuFwsS9ka4FNC0jF+4HZydBe3Q/E84eKaJdt3wbRamsiIqHoNyq7VecywOn2+ndzSb6XwIjGMuXUNByn3/R+Uxno8mkrhg9fgtGNu3XAi79HAnCwM4vYiCiiZ7BQFL5xo6j7UrqcGLB3NSj3/zNIL2nm1yNiK1KKgdEuPYmB8jz5Q/ikmlNbWDAZRsOuXkQBCD+txWlOkRjkst1ClBBwnCTG4ieGf5gXiKGCZjCenVfrb8/TzvY6Buthu2PSxjGtZGwkSkTc20pC9yAV8kpxeu7j8obs9x+QrCxf6Fgk10ZjxE3rYqfwHZdzkrzuMXtsbsoVCtnOjQuK8rVaNSm/+UMaB0cMJXC3Y+kSkEpxENXX0jxoOwM1lKr0psnlgtAd8TtNG9D9ScYWljWeFNynfcXCMX7Fs4gNgFXBaCHP1lVSIiHrgEEbroDsLtzm0I/G5UQOv6PHc1IyInPB9m6cc/mRqODdy+vmXCN1RUtPoap+VyXllNe8owRFF3RYvQjWm6kaMmpnc5MVVRg88LvLa1MLis2j1PBLoJrPKrxVde0SxXUwZd22T2AOeHkYndfFJm+A/5m64k4Ss6jwC5AK+N1gx1PJR49LieHRRxLFvo3pk0T6X0rOKnoxTMRzB01wILma4gA/iKiArOA3jG//oNNRO0s1/K8+RoT67Xn8oDzTCvKDj/9woefX66JR/PCvhuLWlYQirOZw3dMrdyjqfDlDbeSjIZ0+roJkqcVlyCPJqvsLtS0HVb7ei9E= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3799.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(366004)(396003)(346002)(376002)(136003)(83380400001)(82960400001)(31696002)(86362001)(6512007)(6916009)(38100700002)(6506007)(316002)(8936002)(5660300002)(66946007)(53546011)(66556008)(2906002)(66476007)(4326008)(8676002)(41300700001)(186003)(26005)(478600001)(6486002)(31686004)(36756003)(2616005)(6666004)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YVZTVkN1ZDhSWnh4aCs0VjBVdHMyQWpZK2dZamtCOGQ2RXpObDJiV0hwTDhT?= =?utf-8?B?YnpDNEVJUXM1VmIra01YejRTZUlCbHdtR3FMdTB0RC9Dck5CVGFOYkNPNnov?= =?utf-8?B?RTZEZXF6aFZ4ZVRTNHhuVWEvT2pPc2FHOWFVZXYxdmswZkxBSGxxa1VkN1Fj?= =?utf-8?B?Vy80bDNQL1RJa1pNOW5tMDlXejV3Y0ZEb0E1TUN3dmM3cUlUK0wxNmZYTkJ5?= =?utf-8?B?ZlJhWmNBelI3RXhaMjg3Uk4vWWlRQklUT3piWTZrdFY4c2RqMEFCMTN5aW1L?= =?utf-8?B?ek5Gc2RCTC9ac2s1N1FMbmlBalRtOTk5SUEraHhtY1RSWk50R3JiMTlTa2V2?= =?utf-8?B?bGU0MDFuYkh4cDFGRkNqdngxNEJ4TGl1T0I1RFFkeXFkb0ZBT0JjMmUvVmpF?= =?utf-8?B?SXhsRXQ2aEhh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11MB3799.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2022 15:09:35.9770 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Pf/h7X0b5QDHbaGHXUs9t25VlnXEZFCzDzOZo9ReC82X2HzOPkazieVvNoY8TgHyI+1eW6Hz9rbIP6dQD0Carw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1937 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Markus, On 24/08/2022 20:28, Markus Theil wrote: > If DPDK applications should be used with a minimal set of privileges, > using the msr kernel module on linux should not be necessary. > > Since at least kernel 4.4 the rdmsr call to obtain the last non-turbo > boost frequency can be left out, if the sysfs interface is used. > Also RHEL 7 with recent kernel updates should include the sysfs interface > for this (I only looked this up for CentOS 7). > > Signed-off-by: Markus Theil > --- > lib/power/power_pstate_cpufreq.c | 69 ++++++++++++++++++-------------- > 1 file changed, 40 insertions(+), 29 deletions(-) > > diff --git a/lib/power/power_pstate_cpufreq.c b/lib/power/power_pstate_cpufreq.c > index 78c9197695..c3d66a8f68 100644 > --- a/lib/power/power_pstate_cpufreq.c > +++ b/lib/power/power_pstate_cpufreq.c > @@ -35,15 +35,9 @@ > "/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_min_freq" > #define POWER_SYSFILE_BASE_FREQ \ > "/sys/devices/system/cpu/cpu%u/cpufreq/base_frequency" > +#define POWER_SYSFILE_TURBO_PCT \ > + "/sys/devices/system/cpu/intel_pstate/turbo_pct" > #define POWER_PSTATE_DRIVER "intel_pstate" > -#define POWER_MSR_PATH "/dev/cpu/%u/msr" > - > -/* > - * MSR related > - */ > -#define PLATFORM_INFO 0x0CE > -#define NON_TURBO_MASK 0xFF00 > -#define NON_TURBO_OFFSET 0x8 > > > enum power_state { > @@ -74,37 +68,33 @@ struct pstate_power_info { > static struct pstate_power_info lcore_power_info[RTE_MAX_LCORE]; > > /** > - * It is to read the specific MSR. > + * It is to read the turbo mode percentage from sysfs > */ > - > static int32_t > -power_rdmsr(int msr, uint64_t *val, unsigned int lcore_id) > +power_read_turbo_pct(uint64_t *outVal) > { > int fd, ret; > - char fullpath[PATH_MAX]; > + char val[4] = {0}; > > - snprintf(fullpath, sizeof(fullpath), POWER_MSR_PATH, lcore_id); > - > - fd = open(fullpath, O_RDONLY); > + fd = open(POWER_SYSFILE_TURBO_PCT, O_RDONLY); > > if (fd < 0) { > - RTE_LOG(ERR, POWER, "Error opening '%s': %s\n", fullpath, > + RTE_LOG(ERR, POWER, "Error opening '%s': %s\n", POWER_SYSFILE_TURBO_PCT, > strerror(errno)); > return fd; > } > > - ret = pread(fd, val, sizeof(uint64_t), msr); > + ret = read(fd, val, sizeof(val)); > > if (ret < 0) { > - RTE_LOG(ERR, POWER, "Error reading '%s': %s\n", fullpath, > + RTE_LOG(ERR, POWER, "Error reading '%s': %s\n", POWER_SYSFILE_TURBO_PCT, > strerror(errno)); > goto out; > } > > - POWER_DEBUG_TRACE("MSR Path %s, offset 0x%X for lcore %u\n", > - fullpath, msr, lcore_id); > + *outVal = (uint64_t) atol(val); > I'd recommend replacing atol with strtol, it's a safer implementation. It's more commonly found in DPDK code than atol. > - POWER_DEBUG_TRACE("Ret value %d, content is 0x%"PRIx64"\n", ret, *val); > + POWER_DEBUG_TRACE("power turbo pct: %"PRIu64"\n", *outVal); > > out: close(fd); > return ret; > @@ -116,8 +106,9 @@ out: close(fd); > static int > power_init_for_setting_freq(struct pstate_power_info *pi) > { > - FILE *f_base = NULL, *f_base_max = NULL, *f_min = NULL, *f_max = NULL; > - uint32_t base_ratio, base_max_ratio; > + FILE *f_base = NULL, *f_base_min = NULL, *f_base_max = NULL, > + *f_min = NULL, *f_max = NULL; > + uint32_t base_ratio, base_min_ratio, base_max_ratio; > uint64_t max_non_turbo; > int ret; > > @@ -130,6 +121,14 @@ power_init_for_setting_freq(struct pstate_power_info *pi) > goto err; > } > > + open_core_sysfs_file(&f_base_min, "r", POWER_SYSFILE_BASE_MIN_FREQ, > + pi->lcore_id); > + if (f_base_min == NULL) { > + RTE_LOG(ERR, POWER, "failed to open %s\n", > + POWER_SYSFILE_BASE_MIN_FREQ); > + goto err; > + } > + > open_core_sysfs_file(&f_min, "rw+", POWER_SYSFILE_MIN_FREQ, > pi->lcore_id); > if (f_min == NULL) { > @@ -158,6 +157,14 @@ power_init_for_setting_freq(struct pstate_power_info *pi) > goto err; > } > > + /* read base min ratio */ > + ret = read_core_sysfs_u32(f_base_min, &base_min_ratio); > + if (ret < 0) { > + RTE_LOG(ERR, POWER, "Failed to read %s\n", > + POWER_SYSFILE_BASE_MIN_FREQ); > + goto err; > + } > + > /* base ratio may not exist */ > if (f_base != NULL) { > ret = read_core_sysfs_u32(f_base, &base_ratio); > @@ -170,20 +177,22 @@ power_init_for_setting_freq(struct pstate_power_info *pi) > base_ratio = 0; > } > > - /* Add MSR read to detect turbo status */ > - if (power_rdmsr(PLATFORM_INFO, &max_non_turbo, pi->lcore_id) < 0) > - goto err; > - /* no errors after this point */ > - > /* convert ratios to bins */ > base_max_ratio /= BUS_FREQ; > + base_min_ratio /= BUS_FREQ; > base_ratio /= BUS_FREQ; > > /* assign file handles */ > pi->f_cur_min = f_min; > pi->f_cur_max = f_max; > > - max_non_turbo = (max_non_turbo&NON_TURBO_MASK)>>NON_TURBO_OFFSET; > + /* try to get turbo from global sysfs entry for less privileges than from MSR */ > + if (power_read_turbo_pct(&max_non_turbo) < 0) > + goto err; > + /* no errors after this point */ > + > + max_non_turbo = base_min_ratio > + + (100 - max_non_turbo) * (base_max_ratio - base_min_ratio) / 100; > > POWER_DEBUG_TRACE("no turbo perf %"PRIu64"\n", max_non_turbo); > > @@ -220,6 +229,8 @@ power_init_for_setting_freq(struct pstate_power_info *pi) > err: > if (f_base != NULL) > fclose(f_base); > + if (f_base_min != NULL) > + fclose(f_base_min); > if (f_base_max != NULL) > fclose(f_base_max); > if (f_min != NULL) Nice patch. I've run the patched code and can confirm that the max_non_turbo value agrees with the relevant byte in the 0xCE MSR, so looks good. Tested-By: David Hunt Also, once the atol issue mentioned above is resolved: Acked-By: David Hunt Thanks!