Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1504560imm; Tue, 15 May 2018 21:50:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoFTMbAeczZTtrDSUHY5L5nbzur5T2xW2D1wJxmZbuqpMTP3hduZQok6zsyJQ+ELTlOtkef X-Received: by 2002:a17:902:7c94:: with SMTP id y20-v6mr9692652pll.202.1526446233593; Tue, 15 May 2018 21:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526446233; cv=none; d=google.com; s=arc-20160816; b=wjt/5HEMJ5vQHLbe11C19z32gB2wlwmYVYKxmzw0FcQ6motQ65faqvPXTJ0zciEuYR 9YlukIhV6uWq24RdULyRF6lbPmSN4zNgQbFTpNnuU/neskqhJ4XwddtCLkv+VszTSwhE qBNv7hQOdZ5VRkqcOlvfhqZJagPajeCu2fd77yc8ZdLQ5ZqVwDlFuivuaNnFVfnQKmPm 3fnqQ6qd5pIXZnHu9BLGc9enV/aTS83BSSm07T28vR0O7i/76s3SNI4xACIyryn/VwLx 2utORYmIzCD8pu65G8NN8GpEb8LcgrgqFU7W0QtSF5nH4DDL/QvXyQXyHKkYKXpuqzj8 UQ8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=71lQQJiwwTzH4vest9vjv8pJE6p+ncqpyU4iI3qWiNY=; b=tLkfIZsDwB5Wb0jQMOJ6sUcCYsA2H4MX/VklOQRbpMLJG1xwAKj0qlbTv2DxXmkJXd pdVOE3Sy94KsYfhfEwEWswnIwtq7LKebwyF6SENEhdklRi9XsiY5bDLdNCs5Q3u/bkA5 b6GpTO19en9NHprqlKL3MWXn6bPIVYxfJbFQXOKGDPBvKx81AAd67cMsAMWBLeCCfgg0 PqJOo/p69+YyjUvDxEjwIQqxcrM/VwdWwhH1QNOhz7CohR9HtpzlTAT1zGVC0625+aSh 4TZBSQalsaoF+5pZCqsBA7APwTrYC552pKT0U2ZPUjXeA9Qh+2eRKLDWLgRt6GBxUJX7 WSRQ== 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 l186-v6si1856039pfl.155.2018.05.15.21.50.19; Tue, 15 May 2018 21:50:33 -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 S1752265AbeEPEth (ORCPT + 99 others); Wed, 16 May 2018 00:49:37 -0400 Received: from mga04.intel.com ([192.55.52.120]:1167 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751881AbeEPEtW (ORCPT ); Wed, 16 May 2018 00:49:22 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2018 21:49:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,404,1520924400"; d="scan'208";a="41300352" Received: from sunandaa-mobl.amr.corp.intel.com (HELO spandruv-mobl.jf.intel.com) ([10.252.135.192]) by orsmga007.jf.intel.com with ESMTP; 15 May 2018 21:49:20 -0700 From: Srinivas Pandruvada To: srinivas.pandruvada@linux.intel.com, tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org, bp@suse.de, lenb@kernel.org, rjw@rjwysocki.net, mgorman@techsingularity.net Cc: x86@kernel.org, linux-pm@vger.kernel.org, viresh.kumar@linaro.org, juri.lelli@arm.com, linux-kernel@vger.kernel.org Subject: [RFC/RFT] [PATCH 09/10] cpufreq: intel_pstate: New sysfs entry to control HWP boost Date: Tue, 15 May 2018 21:49:10 -0700 Message-Id: <20180516044911.28797-10-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180516044911.28797-1-srinivas.pandruvada@linux.intel.com> References: <20180516044911.28797-1-srinivas.pandruvada@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A new attribute is added to intel_pstate sysfs to enable/disable HWP dynamic performance boost. Signed-off-by: Srinivas Pandruvada --- drivers/cpufreq/intel_pstate.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index c43edce..65d11d2 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -1034,6 +1034,30 @@ static ssize_t store_min_perf_pct(struct kobject *a, struct attribute *b, return count; } +static ssize_t show_hwp_dynamic_boost(struct kobject *kobj, + struct attribute *attr, char *buf) +{ + return sprintf(buf, "%u\n", hwp_boost); +} + +static ssize_t store_hwp_dynamic_boost(struct kobject *a, struct attribute *b, + const char *buf, size_t count) +{ + unsigned int input; + int ret; + + ret = kstrtouint(buf, 10, &input); + if (ret) + return ret; + + mutex_lock(&intel_pstate_driver_lock); + hwp_boost = !!input; + intel_pstate_update_policies(); + mutex_unlock(&intel_pstate_driver_lock); + + return count; +} + show_one(max_perf_pct, max_perf_pct); show_one(min_perf_pct, min_perf_pct); @@ -1043,6 +1067,7 @@ define_one_global_rw(max_perf_pct); define_one_global_rw(min_perf_pct); define_one_global_ro(turbo_pct); define_one_global_ro(num_pstates); +define_one_global_rw(hwp_dynamic_boost); static struct attribute *intel_pstate_attributes[] = { &status.attr, @@ -1083,6 +1108,11 @@ static void __init intel_pstate_sysfs_expose_params(void) rc = sysfs_create_file(intel_pstate_kobject, &min_perf_pct.attr); WARN_ON(rc); + if (hwp_active) { + rc = sysfs_create_file(intel_pstate_kobject, + &hwp_dynamic_boost.attr); + WARN_ON(rc); + } } /************************** sysfs end ************************/ -- 2.9.5