From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751757AbdGaXqt (ORCPT ); Mon, 31 Jul 2017 19:46:49 -0400 Received: from cmta17.telus.net ([209.171.16.90]:33067 "EHLO cmta17.telus.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751102AbdGaXqr (ORCPT ); Mon, 31 Jul 2017 19:46:47 -0400 X-Authority-Analysis: v=2.2 cv=CulQSjwD c=1 sm=1 tr=0 a=zJWegnE7BH9C0Gl4FFgQyA==:117 a=zJWegnE7BH9C0Gl4FFgQyA==:17 a=Pyq9K9CWowscuQLKlpiwfMBGOR0=:19 a=kj9zAlcOel0A:10 a=QyXUC8HyAAAA:8 a=VH1PXI8w3yI6R-3dbgUA:9 a=CjuIK1q_8ugA:10 From: "Doug Smythies" To: "'Rafael J. Wysocki'" , , Cc: "'Len Brown'" , , , , , , "'Len Brown'" References: <1498281114-3868-1-git-send-email-lenb@kernel.org> <006201d30595$e0a23870$a1e6a950$@net> <8753755.adRLzWASdR@aspire.rjw.lan> b4lNdC8DshlzSb4lSd2K7O In-Reply-To: b4lNdC8DshlzSb4lSd2K7O Subject: RE: [PATCH v2] cpufreq: x86: Make scaling_cur_freq behave more as expected Date: Mon, 31 Jul 2017 16:46:42 -0700 Message-ID: <002201d30a57$44f2ed40$ced8c7c0$@net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-ca Thread-Index: AdMHoHmXm7aW9CGmQ9O4O0P+y5HtYACtjNZw X-CMAE-Envelope: MS4wfAUI3IyRelfD01VOXEWPxOAIG38FBA5CQ1vn2L+k7ve24hXa2uPu74eArrkojvmI5lSsYL0SKhtsUwbBhFdJ3bBXfqEIFwkFHUG3uYOIkHbhDwFkuqZu tR8BXEtvY4MZmNcmMhOxGMjUfX85to49s2bwUGzPOjAR2NOISe5jg3LSDTo4WJSKRVDDuxObMcpESD5e5dO9xQG3ZG1tUwIsq9eNSvycPyUh/mG4yEQGFu0q Rr6TrYdR44CfFUQ4VmKlACWMMUoth1mAv4V8ZTAgziT3ZOtIo/Fr2yYTXmeN5GgxjtXRtyKp0F4OfZc2yjFbkY6p371EX/RHa9fcQwunQdpRUANKQLv16iED ivUzHAtZj3Dpu80l9vFsGJliNA6MOoiKZ1y+sghCXnDUJjuqmdZ6FC7yKuW16ouhouaXG17Qa4g/HLcC8cH5H4xzMKE0GAJX9oZ6OIPrk2OBjH1KbRw= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017.07.28 05:45 Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > After commit f8475cef9008 "x86: use common aperfmperf_khz_on_cpu() to > calculate KHz using APERF/MPERF" the scaling_cur_freq policy attribute > in sysfs only behaves as expected on x86 with APERF/MPERF registers > available when it is read from at least twice in a row. The value > returned by the first read may not be meaningful, because the > computations in there use cached values from the previous iteration > of aperfmperf_snapshot_khz() which may be stale. > > To prevent that from happening, modify arch_freq_get_on_cpu() to > call aperfmperf_snapshot_khz() twice, with a short delay between > these calls, if the previous invocation of aperfmperf_snapshot_khz() > was too far back in the past (specifically, more that 1s ago). ...[deleted the rest]... This patch seems to work fine and addresses my complaints from last week. Thanks. ... Doug