Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755956AbdGYBqs (ORCPT ); Mon, 24 Jul 2017 21:46:48 -0400 Received: from mail1.bemta12.messagelabs.com ([216.82.251.2]:22866 "EHLO mail1.bemta12.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755306AbdGYBqm (ORCPT ); Mon, 24 Jul 2017 21:46:42 -0400 X-Brightmail-Tracker: H4sIAAAAAAAAA1WSaUhUURTHu2/zKb64jZonyZYBqdzQshr6IC1 U8yVoJ4PSN/mamZhF3ht1giiTojItUbASrSnTzAxKBMuFRMQYlyTXD1mWCoNLotlqlL03L1vu p/89v/9Z7uWwpKaBCWEFp0MQbbxFy/hRxmVjkVELStISYiryVuievnvP6LprixjdTE4z0rW3d dG63JLHPrrHn/SbGX1VxSVGP9BXz+hvuvfoq3svUPqZqmW76cO02WawO5NoU+WtR0RK6WJnXv NLOgN5NFnIl9VgD4Kydn0W8pN1C4KRmUakXCicTYKn7SKtkhsEPLuaT6mXEQRTV6Z9lHwGrwH 3RB+p6EAcAcXZraRiInEJAT8bR2gFBOBkqKhUACubBMjMOq36d8DzpkxvLoXDIGd8jlI0h5Og +EUloTYbQlBa4yIU4Itj4V7RN6RohEOhYGjQGydxMBQXFHp7AcZwt76TVHUQjA7/pJW+CO+Fy eqjang5XH2QQ6k6FLpuXfY+GfAwgsnX2ZTiB7wLRjv81Hg3AQMP237Xj4Ty0vM+qg6Hi82FhK rt0HHzHKkmtNDw6vkXpIKlUOZu+g0aGLhcV0OoX2+CrLz7KBdFFP7zCFVHgqvuA6PqCCi7PU4 Wen9mEbhvjFAuRFWgVZIgpgli1IZog2g2mhxW3myJio1dG20VJIk3ChbeIEUfs1urkLxKC+Tz BM3lbmtCS1hCG8QJaWkJmoUGe/JJEy+ZEsVUiyA1oaUsqwXu2W2ZLRIFo+A8brbI+ziPgfXXB nItCuakFN4qmY0qakVRrKux5iOhoWx2mxASzHUqJqyYTKm2PyXmt7oLhYYEcEgeSuOfIohWs+ N/PoaCWaQN4DR35Cr+ZpvjT6cxeQhCHqLoeqoyhIP/i0IyUHx4vzDVM3t2R0YGT5sHSss6Apy bvucndIbtTjiffCmi/sfKuJ7quenG2cxdB62tE0diTm1fX35NfFO9kdyyJ+hp2OD4LLW/33qG qjnJu7Ym6dJ35tXGZRpG+7Tx6bVvV5s2Fa3J/XGo78RXNp97+Nl9pbUgad2BfeWeul7P/kOJw 1pKMvGx4aQo8b8ALpXdyNADAAA= X-Env-Sender: yehs1@lenovo.com X-Msg-Ref: server-7.tower-168.messagelabs.com!1500947195!65155779!1 X-Originating-IP: [103.30.234.44] X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked From: Huaisheng HS1 Ye To: "Rafael J. Wysocki" CC: "srinivas.pandruvada@linux.intel.com" , "lenb@kernel.org" , "viresh.kumar@linaro.org" , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] cpufreq: intel_pstate: Fix cpuinfo_cur_freq after performance governor changes Thread-Topic: [PATCH] cpufreq: intel_pstate: Fix cpuinfo_cur_freq after performance governor changes Thread-Index: AQHTBD++fCU7C/LFX0qBYd13GtU46aJi2Z6AgAAwqJCAAJzUgIAAGC3g Date: Tue, 25 Jul 2017 01:46:31 +0000 Message-ID: References: <1500875013-123321-1-git-send-email-yehs1@lenovo.com> <7185077.O26hx51RqR@aspire.rjw.lan> <13292124.r3mFCOTPK8@aspire.rjw.lan> In-Reply-To: <13292124.r3mFCOTPK8@aspire.rjw.lan> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [57.197.58.2] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;KL1PR0302MB2423;20:fsA20aYlxqgrlu9kN0vPOyLN1kFdx+hpsqmsn3uV5Vhlu8Jvr0qT54ArSoerlQc3zkzxGqHmrWKHfnja36KfeLKwGYoPt6AdVP7J4g5iOktmQgwsGJEXCnrrHUoLr1ox+XiQF6R+pHgAU4KkjjvKEIjbhSDF7RdFyT75fcNqJck= x-ms-office365-filtering-correlation-id: 838ce1fa-8b18-4d4c-566b-08d4d2fef990 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:KL1PR0302MB2423; x-ms-traffictypediagnostic: KL1PR0302MB2423: x-exchange-antispam-report-test: UriScan:; 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)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:KL1PR0302MB2423;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:KL1PR0302MB2423; x-forefront-prvs: 03793408BA x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(6009001)(39840400002)(39450400003)(39400400002)(39410400002)(24454002)(189002)(377454003)(199003)(74316002)(229853002)(86362001)(6506006)(93886004)(4326008)(9686003)(25786009)(7696004)(53936002)(5250100002)(5660300001)(66066001)(3660700001)(2900100001)(68736007)(6116002)(102836003)(14454004)(33656002)(99286003)(3280700002)(101416001)(50986999)(54906002)(106356001)(2906002)(3846002)(6246003)(189998001)(6436002)(110136004)(97736004)(38730400002)(81166006)(55016002)(6916009)(8676002)(53546010)(478600001)(54356999)(81156014)(2950100002)(76176999)(305945005)(7736002)(8936002)(105586002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:KL1PR0302MB2423;H:KL1PR0302MB2502.apcprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jul 2017 01:46:31.5344 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5c7d0b28-bdf8-410c-aa93-4df372b16203 X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0302MB2423 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v6P1ktnn020438 Content-Length: 2679 Lines: 67 Hi Rafael, If you delete "get" function implement within intel_pstate, the sysfs interface cpuinfo_cur_freq will display all the time. To be honest, at the beginning I have consider this way like you patched, but based two reasons below, it is conservative for us to do that. 1. I am worried about whether it would lead to confusion for customers or Linux OS venders who are accustomed to cpuinfo_cur_freq. 2. This is the first time for me to offer patch to intel_pstate, not sure whether it could be accepted by you. > On Monday, July 24, 2017 03:32:47 PM Huaisheng HS1 Ye wrote: > > Hi Rafael, > > Thanks for your reply. > > > > > On Monday, July 24, 2017 05:43:14 AM Huaisheng HS1 Ye wrote: > > > > After commit 82b4e03e01bc (intel_pstate: skip scheduler hook when > > > > in "performance" mode) Software P-state control modes couldn't get > > > > dynamic value during performance mode, > > > > > > Please explain what you mean here. > > > > > commit 82b4e03e01bc (intel_pstate: skip scheduler hook when in > > "performance" mode) disables intel_pstate_set_update_util_hook when > > current policy is performance within function intel_pstate_set_policy. > > It leads to Software P-states couldn't update sysfs interface > > cpuinfo_cur_freq's value during performance mode, because of > > pstate_funcs.update_util couldn't set for the given CPU. > > > > > I guess you carried out some tests and the results were not as > > > expected, so what was the test? > > Exactly, we check the sysfs interface cpuinfo_cur_freq and the output > > of cpupower frequency-info both with performance mode. > > OK, so what about the change below: > > --- > drivers/cpufreq/intel_pstate.c | 8 -------- > 1 file changed, 8 deletions(-) > > Index: linux-pm/drivers/cpufreq/intel_pstate.c > ============================================================== > ===== > --- linux-pm.orig/drivers/cpufreq/intel_pstate.c > +++ linux-pm/drivers/cpufreq/intel_pstate.c > @@ -1674,13 +1674,6 @@ static int intel_pstate_init_cpu(unsigne > return 0; > } > > -static unsigned int intel_pstate_get(unsigned int cpu_num) -{ > - struct cpudata *cpu = all_cpu_data[cpu_num]; > - > - return cpu ? get_avg_frequency(cpu) : 0; > -} > - > static void intel_pstate_set_update_util_hook(unsigned int cpu_num) { > struct cpudata *cpu = all_cpu_data[cpu_num]; @@ -1921,7 +1914,6 @@ > static struct cpufreq_driver intel_pstat > .setpolicy = intel_pstate_set_policy, > .suspend = intel_pstate_hwp_save_state, > .resume = intel_pstate_resume, > - .get = intel_pstate_get, > .init = intel_pstate_cpu_init, > .exit = intel_pstate_cpu_exit, > .stop_cpu = intel_pstate_stop_cpu,