Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4035768imm; Mon, 6 Aug 2018 15:32:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe4QfHo6hQkDFfpnI8/5zW2nEgtcbAQU5+zFvaHDnDB/9viIc4YCqqojwt1PEUrcEVPB68r X-Received: by 2002:a63:da56:: with SMTP id l22-v6mr15996590pgj.179.1533594720323; Mon, 06 Aug 2018 15:32:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533594720; cv=none; d=google.com; s=arc-20160816; b=Dn5alscshG2RUk/yEI5FLcHQnPM9aqv28P/nOYob4v1QYGVD6CKLIoqMWCkM2ko+Co YvgfZ0yCPXVuVvz5WyXULbaVIhAPf6/Ey5Ia6E5nuuR/YTVUTOhiJdwd4+VAmG5djDZt Ru2snwZgEhME92surZR6njeDMQzLgg/H1v5Gj/9tMS5bwhixyLUjV+PNzMGRt09qZquh zy3b+FkmBj2yIuEGCncUYJswcSb6fT06sCoiwraGQ6o07jbsuIWy2ubwfYtC/pPrreYw Uxns0Q+wdT/zDN870z2F/g9DGXzv6F4dmt6YZ2wt6mrAW6N6553I4BwZQRfB6SXmU8Jy 66kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=XuuYpxdBV6LE6jxbLLwm+S6YQPnCtUiutQQ2g4Ka5ms=; b=cwevYD7yKi+PdL5cgZtstob1bjZvxZ9bUprPlLsrssSVQ9WL0iiuR/V5EFfr7lAynI GL7+SAkQ6mlKka0Xr7uN7vjxKy++gXGZk/yt9kTM/u9TYEP4cWmRaJalMLxpswqXYGzy mZO/+HlqBmlL1bIA8tx90tkEudiE7871CwbOqzXbP7Z0PypUdBvuhQsktyAQqVDqRMJA SFfSWtmqvAgi9tn1v6FTxpeAVvGrwBMzzrkUvsvE/x+vlZPEXZtMD1jB3YBzxMfW8dRl 0+LfUoWa38Ve1ymURjdjcQ2ToJU2l5VSrkWLALhsiCqYhj22ZIGL5N1ALZuA223ZJIYn DxTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y14-v6si10463982plp.112.2018.08.06.15.31.45; Mon, 06 Aug 2018 15:32:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732612AbeHGAXU (ORCPT + 99 others); Mon, 6 Aug 2018 20:23:20 -0400 Received: from mga14.intel.com ([192.55.52.115]:38501 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727665AbeHGAXU (ORCPT ); Mon, 6 Aug 2018 20:23:20 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2018 15:11:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,452,1526367600"; d="scan'208";a="63998369" Received: from spandruv-mobl.amr.corp.intel.com ([10.254.109.150]) by orsmga006.jf.intel.com with ESMTP; 06 Aug 2018 15:11:10 -0700 Message-ID: <8b51b0b832ba43ba1b22ddfc7b3094770ba4fe72.camel@linux.intel.com> Subject: Re: [PATCH] Revert "cpufreq: intel_pstate: Fix ->set_policy() interface for no_turbo" From: Srinivas Pandruvada To: Gabriele Mazzotta , "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Len Brown , Viresh Kumar , Linux PM , Linux Kernel Mailing List Date: Mon, 06 Aug 2018 15:11:10 -0700 In-Reply-To: <7195d55c-373d-23db-2744-ef3b1b719a5b@gmail.com> References: <20180804152932.3861-1-gabriele.mzt@gmail.com> <7195d55c-373d-23db-2744-ef3b1b719a5b@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.3 (3.28.3-1.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2018-08-06 at 23:50 +0200, Gabriele Mazzotta wrote: > On 06/08/2018 18:49, Srinivas Pandruvada wrote: > > On Mon, 2018-08-06 at 10:30 +0200, Rafael J. Wysocki wrote: > > > On Sat, Aug 4, 2018 at 7:31 PM, Gabriele Mazzotta > > > wrote: > > > > On 04/08/2018 17:29, Gabriele Mazzotta wrote: > > > > > This change does not take into account that some BIOSes > > > > > change > > > > > MSR_IA32_MISC_ENABLE_TURBO_DISABLE depending on the power > > > > > source. > > > > > If the turbo is disabled when the system boots, > > > > > policy.max_freq > > > > > is set to pstate.max_pstate. However, if the BIOS later > > > > > enables > > > > > the turbo, the CPU will never be able to run at > > > > > pstate.turbo_pstate. > > > > > > > > > > Since now intel_pstate_set_policy() does its calculations > > > > > using > > > > > pstate.max_freq and pstate.turbo_freq, we can always > > > > > calculate > > > > > cpuinfo.max_freq using pstate.turbo_pstate, thus allowing > > > > > system > > > > > with varying MSR_IA32_MISC_ENABLE_TURBO_DISABLE to run at > > > > > full > > > > > speed when the turbo is enabled. > > > > > > Well, the problem with this approach is that always using > > > pstate.turbo_pstate as the max causes the governor to > > > overestimate > > > the > > > target frequency when the turbo range is not available (the > > > target > > > depends on the width of the entire available P-state range > > > including > > > turbo, so if the turbo range is not available, the number take > > > into > > > that computation is too large). > > > > > > Are we expected to get notified when the BIOS updates > > > MSR_IA32_MISC_ENABLE_TURBO_DISABLE? > > > > Let's try this: > > - boot with kernel command line > > > > intel_pstate=support_acpi_ppc dyndbg="file processor_perflib.c +p" > > dyndbg="file intel_pstate.c +p" > Interesting output. Can you run ? # turbostat --debug in both plugged and unplugged state. Also output of acpidump? > Plugged -> Unplugged: > > [ 40.046116] CPU 0: _PPC is 6 - frequency limited > [ 40.046128] intel_pstate: policy->max > max non turbo frequency > [ 40.046131] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 3000000 > [ 40.046134] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 > max_policy_perf:30 > [ 40.046137] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 40.046140] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 > [ 40.162173] CPU 0: _PPC is 6 - frequency limited > [ 40.162186] intel_pstate: policy->max > max non turbo frequency > [ 40.162190] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 3000000 > [ 40.162194] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 > max_policy_perf:30 > [ 40.162197] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 40.162200] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 > [ 40.162215] CPU 0: _PPC is 6 - frequency limited > [ 40.162220] intel_pstate: policy->max > max non turbo frequency > [ 40.162223] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 3000000 > [ 40.162226] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 > max_policy_perf:30 > [ 40.162228] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 40.162230] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 > [ 40.162237] CPU 0: _PPC is 6 - frequency limited > [ 40.162241] intel_pstate: policy->max > max non turbo frequency > [ 40.162243] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 3000000 > [ 40.162245] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 > max_policy_perf:30 > [ 40.162247] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 40.162249] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 > [ 40.162257] CPU 0: _PPC is 6 - frequency limited > [ 40.162261] intel_pstate: policy->max > max non turbo frequency > [ 40.162263] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 3000000 > [ 40.162265] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 > max_policy_perf:30 > [ 40.162267] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 40.162269] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 > > Unplugged -> Plugged: > > [ 52.648535] CPU 0: _PPC is 6 - frequency limited > [ 52.648553] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 1700000 > [ 52.648558] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 > max_policy_perf:17 > [ 52.648562] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 52.648566] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 > [ 52.648583] CPU 0: _PPC is 6 - frequency limited > [ 52.648590] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 1700000 > [ 52.648595] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 > max_policy_perf:17 > [ 52.648598] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 52.648602] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 > [ 52.656093] CPU 0: _PPC is 6 - frequency limited > [ 52.656111] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 1700000 > [ 52.656116] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 > max_policy_perf:17 > [ 52.656120] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 52.656123] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 > [ 52.775577] CPU 0: _PPC is 6 - frequency limited > [ 52.775594] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 1700000 > [ 52.775598] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 > max_policy_perf:17 > [ 52.775601] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 52.775604] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 > [ 53.028620] CPU 0: _PPC is 6 - frequency limited > [ 53.028637] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 1700000 > [ 53.028643] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 > max_policy_perf:17 > [ 53.028647] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 53.028651] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 > > > and send dmesg after you change power sources. > > > > - Also try with > > intel_pstate=disable dyndbg="file processor_perflib.c +p" > > Nothing gets printed with this one. > > Thanks, > Gabriele > > > and send dmesg. > > > > Thanks, > > Srinivas > > > >