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 71FEFA0C4C for ; Wed, 14 Jul 2021 12:14:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D5DF412FD; Wed, 14 Jul 2021 12:14:06 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id CD9F740140; Wed, 14 Jul 2021 12:14:02 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10044"; a="210299514" X-IronPort-AV: E=Sophos;i="5.84,238,1620716400"; d="scan'208";a="210299514" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2021 03:14:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,238,1620716400"; d="scan'208";a="505207701" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga002.fm.intel.com with ESMTP; 14 Jul 2021 03:14:00 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Wed, 14 Jul 2021 03:14:00 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Wed, 14 Jul 2021 03:14:00 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.45) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Wed, 14 Jul 2021 03:14:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HMgjfJMvcZv05PzU+sE+GIeovlhx+MCvEoyzoAxxHqNiYmU6713Z4OBZK1jaAjKCsrtDH2r8fYPLwRQfVWJ94crwzc7ti7nxulTZaYpDCXTqPWqiw/MdFNHCx3d3S16VaeZ0gc89wXsTaGJp7IutrcQAUSbGcUki/wf3GAtF2WjBR5EL87i/mMuoi7DKnDhPuxdSPl2gAHQMEbGeWGjYETtg1uST77WbTnq+I7Hwxe3Zw5crVAFZimXvhbh1ywgtKoJAaXmpz+PJafdRjz72AZ+4iyNYTEoDGJ7L0JpdMcaGWF8dC7dJLAcI27dzl7iDpZ279XT4X9Ek7O4rx43YmA== 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-SenderADCheck; bh=iX3+MRvqvWR3q+Xug/KTqgcnfUVbzmhi0V8JJd3gXio=; b=R5XdgWzCmLlAiJdUa8IIVG3P/hi4GBVE3jVrOj+MRaGhQ0PBqqirf8Xt3FriQ4rsuxv3qNV/xj6O+SgFlScE82tu9Vs4AjOjeABP4L5GdI+oO/rbvcPMPiBWBqkKXPgM0UFT/Rem+mbJLK74gMlqtSF9QGAfGHnsZQSAjAfDtxBJrKvC+lvnryfC/BytxKCY2CAcQmTispQ6Tb3yPeXMZz+w1VUpp+2pkeazLVL2ZTZ6WCvg3kELXfjZ3PyVDbOgJZUcwyUz6icGLJjgygMSx28YgJuDgSX4FbjmAN0N4+mZ7Xl+TQRnkH1KLjniMIDQE2j34f3MGS9mcBEma0PedA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iX3+MRvqvWR3q+Xug/KTqgcnfUVbzmhi0V8JJd3gXio=; b=OmKw8k70FTTAv8HyKDdV/yzdSDmIA2gL/DodICNy86FuOfjII9/gfpnC8F62wPmJhN2vT5L1rMhPQYwvOIUGxf8aZ2m/yZgBzPfHM5aw4Bw645vYNqrzw2XgvRNwQ7s5W4Y/raDQLgfQ2LjdPv59sOx6WcqqmqUROPzM5O2e+II= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5047.namprd11.prod.outlook.com (2603:10b6:510:3c::18) by PH0PR11MB4887.namprd11.prod.outlook.com (2603:10b6:510:30::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.23; Wed, 14 Jul 2021 10:13:56 +0000 Received: from PH0PR11MB5047.namprd11.prod.outlook.com ([fe80::80d7:1f43:844f:e10c]) by PH0PR11MB5047.namprd11.prod.outlook.com ([fe80::80d7:1f43:844f:e10c%8]) with mapi id 15.20.4308.027; Wed, 14 Jul 2021 10:13:56 +0000 To: Richael Zhuang , "dev@dpdk.org" CC: "zhiminx.huang@intel.com" , "stable@dpdk.org" , nd References: <20210714084407.51979-1-richael.zhuang@arm.com> <20210714084407.51979-2-richael.zhuang@arm.com> <7fc966da-9eb1-4fe8-2908-d10bc83f4c20@intel.com> From: David Hunt Message-ID: Date: Wed, 14 Jul 2021 11:13:50 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.11.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-ClientProxiedBy: MRXP264CA0001.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:15::13) To PH0PR11MB5047.namprd11.prod.outlook.com (2603:10b6:510:3c::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.4.11.161] (95.45.22.52) by MRXP264CA0001.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:15::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Wed, 14 Jul 2021 10:13:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e468c9ec-1676-4cbf-12e8-08d946b0171a X-MS-TrafficTypeDiagnostic: PH0PR11MB4887: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lfiF5lUl3aoij08NTXvJmhYsiSlc9FLzEFoGtuVz0UJ0OCXqykcNDEVWR7zfhkywOWDJCudapUNVoP8PYLzPgYsaDCOLAJ0+htwKHF67peyII5WxKmp7XQOppYVbYRPjnm9WFMyxKYg6lvcrDYQXmc3R9cKkeK8Kihdrzbd0/zdL7DPWOlTNILcfXvy9ZpM1xWNV8XEQDdERmnlzF74Bi4tAwOlOacI9gT75MqJi+PDInsCYblM6Jh62+Q5DksLnF/+2eBnTo2VDFRiGZBdrZd4R0zroh8EyPB/Gzc+i3KIxXiRdiY3BfB8NwcvAsz4tDuEIz1s4JpQAVRux0Scn2Jjb/77uMjMostCD04MIDq6qDjT60D5DSxe/EXbaQKd1CkgyQmt5lRXypJ8gWtaLbpbwRzHlLIMT7tPhQhaE8NuWmIlFXrwcFN62XrvneafBrygENKI+hK+DCy1/YHuFyH9Jnoo0O80+3JKMSyxGuT1MrCMObsuk/CMfZiLELMd590TQaKVQn9WOWiy4O1KKQMtYz8TZHvmFxQ0z1RdypWLXUvmwmc3F/T7jSDW5u/eGPPIdycF6xWLK4N0UBqgIsyAhh30FrWK2KBC3+7kocoWCA3NP6fWAEBTjZYxPu9Y92RRi2rDoZGc7OSX2hdkBp/Q8HK4cmdXbVaP3YRwwHZNjZ2YmOnKNW3FRlJ+gDJ74DihMB5QTgcrS4lahKJ+JzO1ZEZu9+Kq6HeHdF5Tbpu8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5047.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(39860400002)(376002)(396003)(136003)(366004)(66476007)(66556008)(53546011)(956004)(31686004)(6666004)(8676002)(186003)(26005)(86362001)(66946007)(478600001)(31696002)(38100700002)(2616005)(16576012)(2906002)(44832011)(54906003)(83380400001)(4326008)(316002)(36756003)(110136005)(6486002)(5660300002)(8936002)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bGxwOS9hb0taVURVa2l1YXBlUVRzUEZYOFJaVUlaQi9nMzhKT2xyMXNhMFBZ?= =?utf-8?B?a1pyaXVGTlg1b2xHeG5ybi9FQ1ZRMHl1bzZBUUVvRGNQR0kvRStucDF5VUxD?= =?utf-8?B?V1ducElMZkFiZ0ZxR3ZCQlNkWjJ4WkFGNEhXb2QxRlhyQ0xsdVlwVU1RWlB3?= =?utf-8?B?N3JYYWlBV1pGZ1BzVHUxeDJhZHNXV1N6RnZBU01ZR3oyMXdNZ1RWN0IrSFFJ?= =?utf-8?B?Y29aeFlzbUZjMXZHTE85dVVrTHN0aE4vSVZxYmRXU1dvNkFHZCtUcmhvRkJL?= =?utf-8?B?c0p0YnRoWWpTS0hVb05pTkZ4aGlTRit2MWViN1BBRE5SOVhCWlFEdG1ORTRx?= =?utf-8?B?Vm9idGlvTXd5K1pUeTZUYT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NTlQN2J4NEswblE0TVgvS25BQXpnYVFPbkxrOVdS?= =?utf-8?B?RnRRYVdMUWhRTGdVbVpIbkR2N0NoOUV1Z0FXZjliRFJNbThvUzVyRWdWN0dO?= =?utf-8?B?QWJmMEJQUTgyZjErN1owQm90U2NUck5aK1pXWmI2NlZUYzZkNWxGVWFXK1ho?= =?utf-8?B?Y2YwTjJMVFpxN09aRW5RNkdnSkNOODJDSDhEWVd3UDRUampDM2dqaFRINmpB?= =?utf-8?B?eDlQNVR4NlNEL2haZ0hLU1VzR0t1emp3eFI4TFQ5QnpFblhJN2tXTVI3U3E0?= =?utf-8?B?dHJSazRHVHgyd282OHRwbzNKUitGWmFWRCtFWDYyQlNMYjQyelp2MVlSNUNU?= =?utf-8?B?ajdWTDNLOHZ2U1Y4eHpBcDZQMmE5a1p1dUJDZWhPTFB6bElkMTJUTUJ4b3dB?= =?utf-8?B?T2dSMEQ4Smt3S083Zy9kZTZKcSs4UFNlRThNSU1MNThlcTVGV3psYVFHMTlr?= =?utf-8?Q?Smeuwh5n/HLE6YzBOb3O/3jgTaytcpKaqqdcjT6?= X-MS-Exchange-CrossTenant-Network-Message-Id: e468c9ec-1676-4cbf-12e8-08d946b0171a X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5047.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2021 10:13:56.6623 (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: xOz/fmIGLYwi+Pju6pmXmy0wL6KoX5LMtvpmZdXPI7CsUMVFvZYnzMhXKji27hpIIOkUBZhEADrbMxDHWoMKEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4887 X-OriginatorOrg: intel.com Subject: Re: [dpdk-stable] [PATCH v1 1/1] test/power: check cpuinfo cur freq before scaling cur freq X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 14/7/2021 10:23 AM, Richael Zhuang wrote: > >> -----Original Message----- >> From: David Hunt >> Sent: Wednesday, July 14, 2021 5:15 PM >> To: Richael Zhuang ; dev@dpdk.org >> Cc: zhiminx.huang@intel.com; stable@dpdk.org >> Subject: Re: [PATCH v1 1/1] test/power: check cpuinfo cur freq before scaling >> cur freq >> >> >> On 14/7/2021 9:44 AM, Richael Zhuang wrote: >>> For acpi_cpufreq and cppc_cpufreq, both cpuinfo_cur_freq and >>> scaling_cur_freq exist. For pstate, only scaling_cur_freq exists. >>> And value in scaling_cur_freq and cpuinfo_cur_freq may not be the >>> same. For acpi_cpufreq and cppc_cpufreq, we should check >>> cpuinfo_cur_freq. So here checking cpuinfo_cur_freq before >>> scaling_cur_freq to make sure it works for all cpufreq drivers. >>> >>> Fixes: ff6dfb8e492f ("test/power: fix CPU frequency check") >>> Cc: david.hunt@intel.com >>> Cc: stable@dpdk.org >>> >>> Signed-off-by: Richael Zhuang >>> --- >>> app/test/test_power_cpufreq.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/app/test/test_power_cpufreq.c >>> b/app/test/test_power_cpufreq.c index b8fc53925c..f56abb6f86 100644 >>> --- a/app/test/test_power_cpufreq.c >>> +++ b/app/test/test_power_cpufreq.c >>> @@ -62,13 +62,13 @@ check_cur_freq(unsigned int lcore_id, uint32_t idx, >> bool turbo) >>> int i; >>> >>> if (snprintf(fullpath, sizeof(fullpath), >>> - TEST_POWER_SYSFILE_SCALING_FREQ, lcore_id) < 0) { >>> + TEST_POWER_SYSFILE_CPUINFO_FREQ, lcore_id) < 0) { >>> return 0; >>> } >>> f = fopen(fullpath, "r"); >>> if (f == NULL) { >>> if (snprintf(fullpath, sizeof(fullpath), >>> - TEST_POWER_SYSFILE_CPUINFO_FREQ, lcore_id) < 0) >> { >>> + TEST_POWER_SYSFILE_SCALING_FREQ, lcore_id) < 0) >> { >>> return 0; >>> } >>> f = fopen(fullpath, "r"); >> >> Hi Richael, I don't think this patch fixes anything. If the scaling file is not >> available, it will then attempt to open the cpuinfo file. >> Changing the order does not address the underlying issue. >> >> It looks like the test is failing in check_cur_req, which is only rounding for >> cppc driver. I think it also needs to round for the other drivers. I've just >> checked intel_pstate driver now, and it needs the rounding. I would think >> that acpi driver also needs it. I'll do a bit more investigation and see if I >> can  change to acpi and attempt to confirm that all drivers need the rounding. >> >> Rgds, >> Dave. >> >> > Hi David, > For acpi_cpufreq and cppc_cpufreq, both two files exist. So with the current code, it will check the scaling_cur_freq. But I think for this two drivers, it should check cpuinfo_cur_freq but not scaling_cur_freq. From my system, for acpi cpufreq, the value in cpuinfo_cur_freq and scaling_cur_freq are not the same. Ah OK. Now I see different the values in scaling_cur_freq and cpuinfo_cur_freq on a system here with acpi driver. The cpuinfo_cur_freq is already rounded, but the scaling_cur_freq is not. # cat /sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq 800259 # cat /sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_cur_freq 800000 So I think it would make sense to include the re-order of the filenames as you suggest, but maybe also add rounding for the pstate driver, as that is needed. -               if (env == PM_ENV_CPPC_CPUFREQ) { +               if ((env == PM_ENV_CPPC_CPUFREQ) || (env == PM_ENV_PSTATE_CPUFREQ)) { That avoids the complication of the acpi_cpufreq driver when turbo is enabled (2301000 for any turbo freq). I've just run the test with the two changes (reorder filenames and round on pstate), and the power_cpufreq_autotest passes on both intel_pstate and acpi-cpufreq driver systems. Regards, Dave. > So if not changing the check sequence, the result is: > ########## > RTE>>power_cpufreq_autotest > POWER: Env isn't set yet! > POWER: Attempting to initialise ACPI cpufreq power management... > POWER: Initialized successfully for lcore 2 power management > POWER: Power management of lcore 2 has exited from 'userspace' mode and been set back to the original > POWER: Lcore id 128 can not exceeds 127 > POWER: Initialized successfully for lcore 2 power management > POWER: Power management of lcore 2 is in use > POWER: Invalid lcore ID > POWER: NULL buffer supplied > POWER: Buffer size is not enough > POWER: Invalid lcore ID > POWER: Power management of lcore 2 has exited from 'userspace' mode and been set back to the original > Test Failed > RTE>>quit > ############# > > But after changing the check sequence, the result is OK from my test: > ###### > RTE>>power_cpufreq_autotest > POWER: Env isn't set yet! > POWER: Attempting to initialise ACPI cpufreq power management... > POWER: Initialized successfully for lcore 2 power management > POWER: Power management of lcore 2 has exited from 'userspace' mode and been set back to the original > POWER: Lcore id 128 can not exceeds 127 > POWER: Initialized successfully for lcore 2 power management > POWER: Power management of lcore 2 is in use > POWER: Invalid lcore ID > POWER: NULL buffer supplied > POWER: Buffer size is not enough > POWER: Invalid lcore ID > POWER: Invalid lcore ID > POWER: Invalid frequency index 64, which should be less than 3 > POWER: Invalid frequency index 3, which should be less than 3 > POWER: Failed to enable turbo on lcore 2 > POWER: Invalid lcore ID > POWER: Invalid lcore ID > POWER: Invalid lcore ID > POWER: Invalid lcore ID > Turbo not available on lcore 2, skipping test > POWER: Power management of lcore 2 has exited from 'userspace' mode and been set back to the original > POWER: Power management of lcore 2 is not used > POWER: Lcore id 128 can not exceeds 127 > Test OK > ############