From patchwork Fri May 19 06:23:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 9735885 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 E0E746034C for ; Fri, 19 May 2017 06:24:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8617204C1 for ; Fri, 19 May 2017 06:24:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCECB26AE3; Fri, 19 May 2017 06:24:36 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable 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 CCBF5204C1 for ; Fri, 19 May 2017 06:24:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755638AbdESGYF (ORCPT ); Fri, 19 May 2017 02:24:05 -0400 Received: from mail-pg0-f41.google.com ([74.125.83.41]:32959 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755618AbdESGYC (ORCPT ); Fri, 19 May 2017 02:24:02 -0400 Received: by mail-pg0-f41.google.com with SMTP id u187so33573233pgb.0 for ; Thu, 18 May 2017 23:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tdAZPLmz4XecT0YieBPjrjffSJeCKug7By3hsJ895DI=; b=lpd2XBYySGYN95qrrRpMHq62SVM/nbsvoF2+pNzRX7Qi2RLqy+ed4ik6k2jAv/AaDx BTtn0rfh1NXxgj15x/ZhsQt7tBpNZ/JaFYj2eqr0nJirxXgWJL54RQKGwrCJqyqxKaVF w76EZrHNoih92Qkla78+MpophKqQZyMWsks+QNCbtsPrE/PwLUoU8k69kRRLQBCV2teG +Zbd/qsYCVR9A0XEPWjPwVoqDmjH42dtRIsOqmhIxdYI4WqbpTQiRyC5ILoa7rOWmcMX ZZhgF+Pj1E3QXUraRKpjFfuJPRP+gdeyjeJk9Oex45Op2Th9yoqW3WnTYqyGIEJ6QXgI HD0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tdAZPLmz4XecT0YieBPjrjffSJeCKug7By3hsJ895DI=; b=PAibVRKZMKWLXOd316rGn6Z6IXapZ3ILejK6yN2uBb2z/Z/+idApkqdOSLTxkKI713 fwaZ5X9MUJJBaVw3/hzH1TejjukUYRfFVnHo7Ls6c43JkNOrwqi33+SdFZhLf2eCQJQO g2LrQ8ziVq16qYEXmfJOfm5rWF/gx5G+u7FNdS57rKiIILwZkZkxz7G9R5Iz7bE/rE1t MmU8XVxeSiS/xycEToOCK92jhYD9bqhHL4dfnXJpkU6Mm/weFovE6bCBgbf6g9icNu2u oof0QMMZQYOMDZMgjqTF6i8lb1tUzhJwKQfbI7Rt3L3hhlekmP2yc/87TFDWvGiJgYVr m3cQ== X-Gm-Message-State: AODbwcB2hT9gQYAWGdTNrmme+6FydONxPecA42I6ulKUGjgl/3P1L6CI 8GUScuW6pcZtne4S X-Received: by 10.84.231.16 with SMTP id f16mr9672861plk.20.1495175041350; Thu, 18 May 2017 23:24:01 -0700 (PDT) Received: from joelaf-glaptop0.corp.google.com ([172.26.49.149]) by smtp.gmail.com with ESMTPSA id t79sm8613361pfk.106.2017.05.18.23.24.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 May 2017 23:24:00 -0700 (PDT) From: Joel Fernandes To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Joel Fernandes , Srinivas Pandruvada , Len Brown , "Rafael J . Wysocki" , Viresh Kumar , Ingo Molnar , Peter Zijlstra Subject: [PATCH v2 1/2] cpufreq: Make iowait boost a policy option Date: Thu, 18 May 2017 23:23:43 -0700 Message-Id: <20170519062344.27692-2-joelaf@google.com> X-Mailer: git-send-email 2.13.0.303.g4ebf302169-goog In-Reply-To: <20170519062344.27692-1-joelaf@google.com> References: <20170519062344.27692-1-joelaf@google.com> 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 Make iowait boost a cpufreq policy option and enable it for intel_pstate cpufreq driver. Governors like schedutil can use it to determine if boosting for tasks that wake up with p->in_iowait set is needed. Cc: Srinivas Pandruvada Cc: Len Brown Cc: Rafael J. Wysocki Cc: Viresh Kumar Cc: Ingo Molnar Cc: Peter Zijlstra Signed-off-by: Joel Fernandes --- drivers/cpufreq/intel_pstate.c | 1 + include/linux/cpufreq.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index b7de5bd76a31..5dddc21da4f6 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2239,6 +2239,7 @@ static int intel_cpufreq_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = INTEL_CPUFREQ_TRANSITION_LATENCY; policy->transition_delay_us = INTEL_CPUFREQ_TRANSITION_DELAY; + policy->iowait_boost_enable = true; /* This reflects the intel_pstate_get_cpu_pstates() setting. */ policy->cur = policy->cpuinfo.min_freq; diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index a5ce0bbeadb5..0783d8b52ec8 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -127,6 +127,9 @@ struct cpufreq_policy { */ unsigned int transition_delay_us; + /* Boost switch for tasks with p->in_iowait set */ + bool iowait_boost_enable; + /* Cached frequency lookup from cpufreq_driver_resolve_freq. */ unsigned int cached_target_freq; int cached_resolved_idx;