From patchwork Wed Apr 4 18:14:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Prakash, Prashanth" X-Patchwork-Id: 10323011 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4A48660541 for ; Wed, 4 Apr 2018 18:15:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A03228DD6 for ; Wed, 4 Apr 2018 18:15:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E8B828E5B; Wed, 4 Apr 2018 18:15:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 888F328E1E for ; Wed, 4 Apr 2018 18:15:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751399AbeDDSPK (ORCPT ); Wed, 4 Apr 2018 14:15:10 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:43644 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751384AbeDDSPH (ORCPT ); Wed, 4 Apr 2018 14:15:07 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EEB3D60850; Wed, 4 Apr 2018 18:15:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522865707; bh=1aslY1RcUsgnjpnMEDLEKuLcvxjpazibX4mzdtOVgt8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CLtiKa6WOWZEP63drjJBFbjdLYMqCMhDS2cq6X1Jiv0BD3PT2cEsw155z7LRhsakF GkHpUWNJXqSLY07CmpgMybEEWDbACwkZXz/fWb2ChexflvW1l9nO6X6vvLwKIEXIRQ ZD6/7jAJexRKUADNpeUp4uPwyVmPNbC9JmbUqof0= Received: from pprakash-lnx.qualcomm.com (unknown [129.46.14.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pprakash@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 13E0760274; Wed, 4 Apr 2018 18:15:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522865704; bh=1aslY1RcUsgnjpnMEDLEKuLcvxjpazibX4mzdtOVgt8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TJk/o+M81KWPZ7Lx0oMUkrAiVOHxdHKUVdEB+4IE9KOkb18z84Sz9O24APBECwLhV FwE/AN3dE8fjVNQ19VN5MVS8X8vWVrqGHXdhRhG664nGUDOxctTg9vVQSSMo5pcGsq DgkYXCseS/JlLB2I8t34vmTIaWENGclmzxAOA89A= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 13E0760274 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=pprakash@codeaurora.org From: Prashanth Prakash To: linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org Cc: rjw@rjwysocki.net, viresh.kumar@linaro.org, lenb@kernel.org, ahs3@redhat.com, Prashanth Prakash Subject: [PATCH 4/4] ACPI / CPPC: Document CPPC sysfs interface Date: Wed, 4 Apr 2018 12:14:53 -0600 Message-Id: <1522865693-31831-5-git-send-email-pprakash@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1522865693-31831-1-git-send-email-pprakash@codeaurora.org> References: <1522865693-31831-1-git-send-email-pprakash@codeaurora.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a file to describe the CPPC sysfs interface and steps to compute average delivered performance using the feedback counters. Signed-off-by: Prashanth Prakash --- Documentation/acpi/cppc_sysfs.txt | 66 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Documentation/acpi/cppc_sysfs.txt diff --git a/Documentation/acpi/cppc_sysfs.txt b/Documentation/acpi/cppc_sysfs.txt new file mode 100644 index 0000000..9fae408 --- /dev/null +++ b/Documentation/acpi/cppc_sysfs.txt @@ -0,0 +1,66 @@ + + Collaborative Processor Performance Control (CPPC) + +CPPC defined in ACPI spec describes a mechanism for OSPM to manage the +performance of a logical processor on a contigious and abstract performance +scale. CPPC exposes different registers to describe abstract performance scale, +to request performance levels and to measure per-cpu delivered performance. + +For more details on CPPC please refer to ACPI specification at: +http://uefi.org/specifications. + +Some of the CPPC registers are exposed via sysfs under: +/sys/devices/system/cpu/cpuX/acpi_cppc/ +for each cpu X + +-------------------------------------------------------------------------------- + +$ ls -lR /sys/devices/system/cpu/cpu0/acpi_cppc/ +/sys/devices/system/cpu/cpu0/acpi_cppc/: +total 0 +-r--r--r-- 1 root root 65536 Mar 5 19:38 feedback_ctrs +-r--r--r-- 1 root root 65536 Mar 5 19:38 highest_perf +-r--r--r-- 1 root root 65536 Mar 5 19:38 lowest_freq +-r--r--r-- 1 root root 65536 Mar 5 19:38 lowest_nonlinear_perf +-r--r--r-- 1 root root 65536 Mar 5 19:38 lowest_perf +-r--r--r-- 1 root root 65536 Mar 5 19:38 nominal_freq +-r--r--r-- 1 root root 65536 Mar 5 19:38 nominal_perf +-r--r--r-- 1 root root 65536 Mar 5 19:38 reference_perf +-r--r--r-- 1 root root 65536 Mar 5 19:38 wraparound_time + +-------------------------------------------------------------------------------- + +* highest_perf : Highest performance of this processor (abstract scale). +* nominal_perf : Highest sustained performance of this processor (abstract scale). +* lowest_nonlinear_perf : Lowest performance of this processor with nonlinear + power savings (abstract scale). +* lowest_perf : Lowest performance of this processor (abstract scale). + +* lowest_freq : CPU frequency corresponding to lowest_perf (in MHz). +* nominal_freq : CPU frequency corresponding to nominal_perf (in MHz). + The above frequencies should only be used to report processor performance in + freqency instead of abstract scale. These values should not be used for any + functional decisions. + +* feedback_ctrs : Includes both Reference and delivered performance counter. + Reference counter ticks up proportional to processor's reference performance. + Delivered counter ticks up proportional to processor's delivered performance. +* wraparound_time: Minimum time for the feedback counters to wraparound (seconds). +* reference_perf : Performance level at which reference performance counter + accumulates (abstract scale). + +-------------------------------------------------------------------------------- + + Computing Average Delivered Performance + +Below describes the steps to compute the average performance delivered by taking +two different snapshots of feedback counters at time T1 and T2. + +T1: Read feedback_ctrs as fbc_t1 + Wait or run some workload +T2: Read feedback_ctrs as fbc_t2 + +delivered_counter_delta = fbc_t2[del] - fbc_t1[del] +reference_counter_delta = fbc_t2[ref] - fbc_t1[ref] + +delivered_perf = (refernce_perf x delivered_counter_delta) / reference_counter_delta