Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1116913imm; Thu, 31 May 2018 15:54:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJWgPxVOcbvDd28FHl3eSssD6hlrPlmiK2KbIeqrdMv6ho6XpBQvk0C2yGPhfo8R3tWOUmb X-Received: by 2002:a65:47c8:: with SMTP id f8-v6mr6904899pgs.430.1527807242516; Thu, 31 May 2018 15:54:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527807242; cv=none; d=google.com; s=arc-20160816; b=lk+2Aws1Ft1Kw3gxOofG5zSIL0LqnIoOrc2nW/kVE31y5LgWgZJZUctdMqLEYBBf0f /7ZRAhII5qUlsa80sIsbuCcapoyUDO2BWHzVyuKnlTw/17KO0tuXYc2lzpFoJQlbKUgx +s5xK9340mgatNj0l5A8009ikCBhzO5RkWTjmujDOgCkaqAKj6+5YUElYE3Z9tC6Ri7q PIaCmRcodsIljGTASprqvWh7o2Chg8GU4A4aenkvuWm0Y/2l94ROWI/cA//eZ6BpUFdQ UwZ9UNQk4gteaC1xJfhA9ic/CoM+dKwK4fwYgdFGjZvOuBmVedFtbknBSWpiRjqJ7/5b oNOQ== 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=KteKsei7N9hemPlsfruAZ3fNM7WuPUX964WQZhITXDk=; b=VyJGgvGdyBe0HDEiI6f5HsB7RGHa5yWm9OEmpwtE6a4I3DzPINYoipo6L4du74x8my UT4KXPZ7LDMqGe/vRH9i7r6YuPa49vXaiugc/KsfaWTWuOZ2jdFmO1Dze3n0x45gwh40 soNWwnlgzLfO3xZqC9+OhNk6blJIP3yMs+mH+M5hd84REKlI2fetOBfhOGK8NPmeIVl/ IR66gTHuMkUt+AcnULSS1Acwn46c2FnMsgt0VvZZCb6vbC2zPf4uJwsdP9L/xvcaS73L 3uKdmBJDnrgcFACn+zX434nVi9KVWmiUVkVEMBIrS3ND9ZSPgjetoRq0wtgbai0mLBGX I9AA== 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 w69-v6si14103679pgd.101.2018.05.31.15.53.48; Thu, 31 May 2018 15:54:02 -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 S1751453AbeEaWwp (ORCPT + 99 others); Thu, 31 May 2018 18:52:45 -0400 Received: from mga14.intel.com ([192.55.52.115]:6569 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204AbeEaWvx (ORCPT ); Thu, 31 May 2018 18:51:53 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 May 2018 15:51:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,464,1520924400"; d="scan'208";a="233413425" Received: from spandruv-desk.jf.intel.com ([10.54.75.31]) by fmsmga005.fm.intel.com with ESMTP; 31 May 2018 15:51:52 -0700 From: Srinivas Pandruvada To: lenb@kernel.org, rjw@rjwysocki.net, peterz@infradead.org, mgorman@techsingularity.net Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, juri.lelli@redhat.com, viresh.kumar@linaro.org, Srinivas Pandruvada Subject: [RFC/RFT] [PATCH v3 3/4] cpufreq: intel_pstate: New sysfs entry to control HWP boost Date: Thu, 31 May 2018 15:51:42 -0700 Message-Id: <20180531225143.34270-4-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180531225143.34270-1-srinivas.pandruvada@linux.intel.com> References: <20180531225143.34270-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 2a14756d958e..254e30a6c1e0 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -1033,6 +1033,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); @@ -1042,6 +1066,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, @@ -1082,6 +1107,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.13.6