Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5425732ybv; Tue, 11 Feb 2020 15:42:03 -0800 (PST) X-Google-Smtp-Source: APXvYqwvXrvoycYsWlHoLKxd2nPyE31JRw9TsR1/POORaLF9ERb4206/L9yukncGrWwzg67hRJON X-Received: by 2002:aca:3354:: with SMTP id z81mr4565608oiz.129.1581464523243; Tue, 11 Feb 2020 15:42:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581464523; cv=none; d=google.com; s=arc-20160816; b=TyTMqDgX3Y5Dc8TLdYckXxo096PLClKcXpbKfog6eFjpMw8hKzFUaXcjWr0SV1EtRF byvX+PdsMhzteDw9O0W4xE/nCAOeRBEzJRPp/IdRg405shmMHDt5FEwlhdFxrxB7rwNS 8OY64MKSqDzDvjJC9Nqh+wGH297KZxfIUxIOsvcB0f3cvCpZh+2+lx1d8h8KlqQC71Vq 3YlYX6JAfrKTxCBTCv07rrA8Twnsw1x60WXanCWA4z/cixH5OFN+geneCrvkNjjuuvRy eDtscwU+J3LQoR6g40r8UDfyxgg7WuwTxYf3M1izrF0GDzJTGP3QzL9HbduZSyVZCwgO KeaA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Q3yPXTKTfwJ+th+RrDTh0yzm/g/ZXDenAUy4JHVqlG8=; b=bE0E1itEjCbg1p2bJxE0vGgZk8oOtVs74G0DW54eoWC7p39TxgEQEwp66o5Tz2Ofn9 XrBrdhFsBGAAXIxnDVadlEzAafdIPOEsMRvV6oon8mSNht6smaWtHJ7DzFbaWd3qLNVU 5mo5V3x2ZXFGKY330EMn8bls7y0Jp/KLIFX4GscS+RI+aOuGpxWB4ZmkTksyrrWsfVlv kSlZ5sZh8dF92Q01z1/UjvN3DtLIvvmjK6GQyTmbOAGJP85jyewlcguAWfWlhD8OLWO6 GMQg+4xRKWtx11QPrXQSKTSdIYOR6QgC2ebCA16FYTiE2/iMy9S8ob9i+tK4G5pcmoCd +8+g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3si2135248oib.164.2020.02.11.15.41.51; Tue, 11 Feb 2020 15:42:03 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728028AbgBKXim (ORCPT + 99 others); Tue, 11 Feb 2020 18:38:42 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:64962 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727933AbgBKXil (ORCPT ); Tue, 11 Feb 2020 18:38:41 -0500 Received: from 79.184.254.199.ipv4.supernova.orange.pl (79.184.254.199) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.341) id 58cecbe0eccce4dc; Wed, 12 Feb 2020 00:38:39 +0100 From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Amit Kucheria , Daniel Lezcano Subject: [PATCH 28/28] PM: QoS: Make CPU latency QoS depend on CONFIG_CPU_IDLE Date: Wed, 12 Feb 2020 00:37:11 +0100 Message-ID: <3915146.cHaPKLg5L1@kreacher> In-Reply-To: <1654227.8mz0SueHsU@kreacher> References: <1654227.8mz0SueHsU@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Rafael J. Wysocki" Because cpuidle is the only user of the effective constraint coming from the CPU latency QoS, add #ifdef CONFIG_CPU_IDLE around that code to avoid building it unnecessarily. Signed-off-by: Rafael J. Wysocki --- include/linux/pm_qos.h | 13 +++++++++++++ kernel/power/qos.c | 2 ++ 2 files changed, 15 insertions(+) diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index df065db3f57a..4a69d4af3ff8 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h @@ -143,11 +143,24 @@ bool pm_qos_update_flags(struct pm_qos_flags *pqf, struct pm_qos_flags_request *req, enum pm_qos_req_action action, s32 val); +#ifdef CONFIG_CPU_IDLE s32 cpu_latency_qos_limit(void); bool cpu_latency_qos_request_active(struct pm_qos_request *req); void cpu_latency_qos_add_request(struct pm_qos_request *req, s32 value); void cpu_latency_qos_update_request(struct pm_qos_request *req, s32 new_value); void cpu_latency_qos_remove_request(struct pm_qos_request *req); +#else +static inline s32 cpu_latency_qos_limit(void) { return INT_MAX; } +static inline bool cpu_latency_qos_request_active(struct pm_qos_request *req) +{ + return false; +} +static inline void cpu_latency_qos_add_request(struct pm_qos_request *req, + s32 value) {} +static inline void cpu_latency_qos_update_request(struct pm_qos_request *req, + s32 new_value) {} +static inline void cpu_latency_qos_remove_request(struct pm_qos_request *req) {} +#endif #ifdef CONFIG_PM enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, s32 mask); diff --git a/kernel/power/qos.c b/kernel/power/qos.c index ef73573db43d..32927682bcc4 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -209,6 +209,7 @@ bool pm_qos_update_flags(struct pm_qos_flags *pqf, return prev_value != curr_value; } +#ifdef CONFIG_CPU_IDLE /* Definitions related to the CPU latency QoS. */ static struct pm_qos_constraints cpu_latency_constraints = { @@ -421,6 +422,7 @@ static int __init cpu_latency_qos_init(void) return ret; } late_initcall(cpu_latency_qos_init); +#endif /* CONFIG_CPU_IDLE */ /* Definitions related to the frequency QoS below. */ -- 2.16.4