Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp46213imm; Tue, 5 Jun 2018 14:46:15 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIEi16yR36F6urOdgoSoTZHEYifkxpxAUbIbXi84eNNAF9PsU/yfkz7vG+198wfQaxu316s X-Received: by 2002:a17:902:57d8:: with SMTP id g24-v6mr371083plj.116.1528235175459; Tue, 05 Jun 2018 14:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528235175; cv=none; d=google.com; s=arc-20160816; b=JfpSpAYmEzaDrWWNu7GgquK2AUsGvMeMKOzOJ/n8FDAYbBJ3ZxVb/tVT5PcVeDw7mt Ssecesy2YJo/ZsxIe9C/M9yeWGoJQtgwmTw9oqzU+fL/EmirOBajzQWudSj0pusUA4lw fjhY9TZ2ik3l8iZsAFZ8b1J1exZImpSqnQsh3+GVBJ6sO4lLfixCXx/o3BOJEWH3nT1z UdWGwOeNHobS1SEJ16xve90CbU360Rl64b26inLASl57beH/vTSaMTVzNZECPgEyzHhR tB4zD19uKilYMfw4Siq63xgliOgVjZi4R0TxNA3lU8bY77fg8A0Om8ib3WnR9zAKD193 1nuQ== 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=L1XC/yQ2y31ScOGa11juZ29UKBIzt/VCXjJiktXpXZY=; b=R0sOiNdIDOx/qLzcsfZrc+qjeL9Wk+Iczha8xXH1/QEYcJPFy+ezvjq4t4E1p45VRd Z1q8P7hPKTUb/Hf2Ehg6u9RcyZn0z4iS/IxCXZHDwW1VxGyTIxDC76t8qFhIbz29OOoj 2Polu008msBhn6ahKj6sSyUWcSsF8BN8XNhyMmEhRJ5H+6g+mfQ+PWyVkF4a5hcBWm6p Is4B1YRsAv+Gltqu5y9a8QOJfiREKNGu/ae9cINgxdrfSdDlFlw51zjqK5L3lbATLsiP F2gf6By2tIp4MhCiVOX1Q9wWBho4T47i9K/9AozMb2y8F2SQgar0OtnhF16yQAr46QSI 3VFQ== 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 y13-v6si4736743pgq.69.2018.06.05.14.46.00; Tue, 05 Jun 2018 14:46:15 -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 S1752675AbeFEVnl (ORCPT + 99 others); Tue, 5 Jun 2018 17:43:41 -0400 Received: from mga04.intel.com ([192.55.52.120]:37414 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752358AbeFEVmv (ORCPT ); Tue, 5 Jun 2018 17:42:51 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jun 2018 14:42:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,479,1520924400"; d="scan'208";a="47023742" Received: from spandruv-desk.jf.intel.com ([10.54.75.31]) by orsmga008.jf.intel.com with ESMTP; 05 Jun 2018 14:42:49 -0700 From: Srinivas Pandruvada To: lenb@kernel.org, rjw@rjwysocki.net, mgorman@techsingularity.net Cc: peterz@infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, juri.lelli@redhat.com, viresh.kumar@linaro.org, ggherdovich@suse.cz, Srinivas Pandruvada Subject: [PATCH 3/4] cpufreq: intel_pstate: New sysfs entry to control HWP boost Date: Tue, 5 Jun 2018 14:42:41 -0700 Message-Id: <20180605214242.62156-4-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180605214242.62156-1-srinivas.pandruvada@linux.intel.com> References: <20180605214242.62156-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. Reported-by: Mel Gorman Tested-by: Giovanni Gherdovich 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 5b2b6b6d1ff4..70bf63bb4e0e 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