From patchwork Thu Jul 4 07:36:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 168460 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1921455ilk; Thu, 4 Jul 2019 00:36:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZc0cTRWDN9j+VOmhHIadRfzPHvcbdjIuLTiV23yiGiT5Pb85/HxpGHXZD2H9hFLdqT3To X-Received: by 2002:a63:8c0f:: with SMTP id m15mr41803601pgd.441.1562225791470; Thu, 04 Jul 2019 00:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562225791; cv=none; d=google.com; s=arc-20160816; b=i2Hqg1wC/H0bztRlB1RKEGa37ZLkjQJoJdZpRaRNwXOpyir7uGzoGXOQwpxRDnvKd2 c1SGh2dh3dp2FaKJdeKEnsV26Y/rbjF12eGrYS9MN3px6vrfHCH2SycCvfoetB1KJYFQ ppbdrd5NBZqfpStEpRsPiz2qSRSfSu/pYxW2bnViatwucGTZrRv5BdX5H8phlTx57LAm BfhO2+nEnyeBdyFVIE0Z8SRKy7Z4Ipf1ufarX+C+fRiOOrJfaxGyNllYHSp/jj1zL5RT GiiN/sDYvkHCoHzV6q8KUVgjKM5vS1LPFvMASQHhUJWC6p89xtzw74DI7yX5KtxSqnb+ lzoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=9HRLgsM/YRXffCDN0dNN2kJ7G9GZLkToihDfCd/KbHc=; b=nNzAzaI85q1dgGy+ZMCTWj0AjQYSpoeFHR7farqBUUpHWJJg+4tvjzLkR1o6EiiT5K G7P6N23SUY9TLvAnB3c62hQE3CpomOF2UWiIH/kVIxL8kTtaNxhI14zaWCtE/+vYZX3c oUVAkWzW+OpT9FVE21EYGCDiUv18IoOuTOn5eFyJ4tO8erAFV43HchYej6yXCcsAzvUl rWjuh4M/9X/h6U2B/XAyeS/FnV8u99oamR2EOUvbLGaYSlLtYHw74ljJzinVBj+vtL3U VAiimo87TuKoMychFKJRgCpFdjuGNzoys+2FqnXYKBjmh3aGuFYgPcgqCjr5U4/OkNd4 iepA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RWeNBkc7; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 71si4661093plf.156.2019.07.04.00.36.30; Thu, 04 Jul 2019 00:36:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RWeNBkc7; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727121AbfGDHga (ORCPT + 11 others); Thu, 4 Jul 2019 03:36:30 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:33362 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726199AbfGDHga (ORCPT ); Thu, 4 Jul 2019 03:36:30 -0400 Received: by mail-pl1-f196.google.com with SMTP id c14so2643303plo.0 for ; Thu, 04 Jul 2019 00:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9HRLgsM/YRXffCDN0dNN2kJ7G9GZLkToihDfCd/KbHc=; b=RWeNBkc7jbRxcq/jToCqRSX7TpZu/Sxt4xherbLXDgW7CFwokq3TBp0AnHLDq5b0i2 Rmqc4Z3aGr2wzmWWz8QCP5BGsJCZrqK8rx7Ao7kwo7Xrl0QV8GJg7ZtGTg1mBeQJFMic zYMgW3VLPPJVEl+MR1GE+OT93rVUmooSQRAED8wlQbDA/5Y5bfNjunKj1v4x6yQn5/DT x6mZEpW8a+YocNvyv+sSC1bWuSgeDxf+sg+2mi9jPxmGaJykE7dib2BubR7Wjpy6yy7y oHOmjpIRjYiWU0qkchxdvV2eg8YLReorwwZP6ipu8yrPFcRLmmEhnI6Cdu+8Nb4sXBjn YXsw== 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:mime-version :content-transfer-encoding; bh=9HRLgsM/YRXffCDN0dNN2kJ7G9GZLkToihDfCd/KbHc=; b=jGIo9v5Co0MBd/ScPxpjyuMJzogZa8kjtuPVECLaPMjGXgpX6CPNDhgC0yvkMfz08S uGM9cP0i/VeKr2cMZChu6eNrLYZ5R9jpS0cNLCJ5e1xqImVTZ4q+LhSxs0plKuVoouxC rXJaSdxKtuxsnm7v4Na4uYTQeakbwn+p3NdYd2wWjNf5e5masnwnxzb6oOiWQV6McS3w X6FLk74IIEJ/eDFaO5Kk2qU9Cy6aOMIewmMYM2trn0nQT1cAgXCUwzghGuvB8U238K4w C66sIHDpyHhxsxMFrlmAlKiBkAd+jhqCM466lNo8SUFaOBeVyph7KuxLAmRr7qAEdoKf xXsw== X-Gm-Message-State: APjAAAUvOWBH5+n/BR6VeBQNFmrIpqsKwAPuP9M+OP6FABsdDBaw0TIX c8u2GwWWIMN92FVq1lADnVaLYQ== X-Received: by 2002:a17:902:76c6:: with SMTP id j6mr1335671plt.102.1562225789355; Thu, 04 Jul 2019 00:36:29 -0700 (PDT) Received: from localhost ([122.172.21.205]) by smtp.gmail.com with ESMTPSA id y8sm5670277pfn.52.2019.07.04.00.36.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jul 2019 00:36:28 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Daniel Lezcano , Kevin Hilman , Len Brown , Len Brown , Pavel Machek , Srinivas Pandruvada , Ulf Hansson Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org, Matthias Kaehlcke , "Rafael J. Wysocki" Subject: [PATCH V6 0/7] cpufreq: Use QoS layer to manage freq-constraints Date: Thu, 4 Jul 2019 13:06:16 +0530 Message-Id: X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hello, Sorry about another version after another round of embarrassment over compilation issues. The same patches have gone through pm/linux-next and linux-next/master earlier, not sure why the current issues never came up before. Anyway, they were stupid coding mistakes :( I have pushed these patches again for the build bot to test, which should finish before these get merged in PM tree now. This patchset attempts to manage CPU frequency constraints using the PM QoS framework. It only does the basic stuff right now and moves the userspace constraints to use the QoS infrastructure. Todo: - Migrate all users to the QoS framework and get rid of cpufreq specific notifiers. - Make PM QoS learn about the relation of CPUs in a policy, so a single list of constraints is managed for all of them instead of per-cpu constraints. V5->V6: - Fixed compilation issues with !CONFIG_PM case on riscv architecture. V4->V5: - A new patch added, 6/7. V3->V4: - Few commit logs updated as suggested during reviews. - Separate commit (2/6) to create resume-latency specific routines - Reused earlier work ("update") for notifiers as well. - Kept Reviewed-by tags as is as the patches normally got better only. Please take them back if you find any issues. V2->V3: - Add a comment in cpufreq.c as suggested by Qais. - Rebased on latest pm/linux-next. V1->V2: - The previous version introduced a completely new framework, this one moves to PM QoS instead. - Lots of changes because of this. -- viresh Viresh Kumar (7): PM / QOS: Pass request type to dev_pm_qos_{add|remove}_notifier() PM / QOS: Rename __dev_pm_qos_read_value() and dev_pm_qos_raw_read_value() PM / QOS: Pass request type to dev_pm_qos_read_value() PM / QoS: Add support for MIN/MAX frequency constraints cpufreq: Register notifiers with the PM QoS framework cpufreq: intel_pstate: Reuse refresh_frequency_limits() cpufreq: Add QoS requests for userspace constraints Documentation/power/pm_qos_interface.txt | 12 +- drivers/base/power/domain.c | 8 +- drivers/base/power/domain_governor.c | 4 +- drivers/base/power/qos.c | 135 +++++++++++++-- drivers/base/power/runtime.c | 2 +- drivers/cpufreq/cpufreq.c | 201 ++++++++++++++++------- drivers/cpufreq/intel_pstate.c | 7 +- drivers/cpuidle/governor.c | 2 +- include/linux/cpufreq.h | 12 +- include/linux/pm_qos.h | 48 ++++-- 10 files changed, 320 insertions(+), 111 deletions(-) -- 2.21.0.rc0.269.g1a574e7a288b