Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754640AbcCSCSn (ORCPT ); Fri, 18 Mar 2016 22:18:43 -0400 Received: from mga03.intel.com ([134.134.136.65]:22532 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753425AbcCSCSh (ORCPT ); Fri, 18 Mar 2016 22:18:37 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,358,1455004800"; d="scan'208";a="672191469" Subject: Re: [PATCH 1/3 v4] powercap, intel_rapl, implement get_max_time_window To: Prarit Bhargava References: <1458129625-15662-1-git-send-email-prarit@redhat.com> <1458129625-15662-2-git-send-email-prarit@redhat.com> Cc: linux-kernel@vger.kernel.org, Radivoje Jovanovic , Seiichi Ikarashi , Mathias Krause , Ajay Thomas From: "Rafael J. Wysocki" Organization: Intel Technology Poland Sp. z o. o., KRS 101882, ul. Slowackiego 173, 80-298 Gdansk Message-ID: <56ECB6F8.6080501@intel.com> Date: Sat, 19 Mar 2016 03:18:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1458129625-15662-2-git-send-email-prarit@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2101 Lines: 49 On 3/16/2016 1:00 PM, Prarit Bhargava wrote: > The MSR_PKG_POWER_INFO register (Intel ASDM, section 14.9.3 > "Package RAPL Domain") provides a maximum time window which the > system can support. This window is read-only and is currently > not examined when setting the time windows for the package. > > This patch implements get_max_time_window_us() and checks the window when > a user attempts to set power capping for the package. > > Before the patch it was possible to set the window to, for example, 10000 > micro seconds: > > [root@intel-chiefriver-03 rhel7]# echo 10000 > > /sys/devices/virtual/powercap/intel-rapl/intel-rapl\:0/constraint_0_time_window_us; > egrep ^ /sys/devices/virtual/powercap/intel-rapl/intel-rapl\:0/constraint_0_time_window_us > > /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_0_time_window_us:1:9765 > > but from 'turbostat -d', the package is limited to 976us: > > cpu0: MSR_PKG_POWER_INFO: 0x01200168 (45 W TDP, RAPL 36 - 0 W, 0.000977 sec.) > > (Note, there appears to be a rounding issue in turbostat which needs to > also be fixed. Looking at the values in the register it is clear the > value is 1/1024 = 976us.) > > After the patch we are limited by the maximum time window: > > [root@intel-chiefriver-03 rhel7]# echo 10000 > > /sys/devices/virtual/powercap/intel-rapl/intel-rapl\:0/constraint_0_time_window_us; > egrep ^ /sys/devices/virtual/powercap/intel-rapl/intel-rapl\:0/constraint_0_time_window_us > > -bash: echo: write error: Invalid argument > /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_0_time_window_us:1:976 > > Cc: "Rafael J. Wysocki" > Cc: Prarit Bhargava > Cc: Radivoje Jovanovic > Cc: Seiichi Ikarashi > Cc: Mathias Krause > Cc: Ajay Thomas > Signed-off-by: Prarit Bhargava Can you please resend the patches with CCs to linux-pm@vger.kernel.org? They are much easier to handle to me then. Thanks, Rafael