Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5349363yba; Wed, 8 May 2019 11:47:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNOLWYCZ4J6tRIMXOwbGEcms/NVFJs8nSDpA4vMUAlMNAp6HB99UuZ/0mx69G+tksBETbP X-Received: by 2002:a17:902:b407:: with SMTP id x7mr21558056plr.28.1557341256944; Wed, 08 May 2019 11:47:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557341256; cv=none; d=google.com; s=arc-20160816; b=tXsz1F5dIQsIqROrJWbFEygD5i8Y37kL+0ok3lqY3zw6gkYkMC4Z0tblyokKv3LkK9 b7+Gk2BVkspBs7x0fM74TCPXGje5IMmTeeAcb1ohmuAYX4VZeObPOHlkzgC2xK9um9o2 w732RPtg/x/3R2EGsX1XzvzWynahA90u5LAf9LmumGvBJliP5YMQnmQQoaWDur3OkQa3 fxFOrQD/ZtabcoY1t/f7tFUb72UfgFoE2NkMlRWSE4xmt6RbRyyssB/DjZn6ReCUDw5G be94V/3zvl4f6EvOUWM7fccmqTDQ924NTDAoorJoq6wWrDEQZYgnLsAb5GdNB8Ubbl8N yhnw== 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=YcbaLWV5nUsHwiV8jtHJyzmtjg6ZRItJMjLBvp5nZ14=; b=Wv/Kp7kVwjGqyB61t2Te9R8y4viB7ki0O2Kh2l6HnsxAC50F7+vrShvHJbS7cJhrlv pNrKBXkobboBTRu4jn5suVXOwdq0QvyY+FFhycaCc7FP3Pznun3sR72SFXyIYHOPoeDK lz2umU57ODFpEc1FBctHMFo0u7dtecC5IwoDq5jG0h8N3xXbgVXa+kbh8eyVv0fmh04q viOOl92ONw8UcwvBNM7rTl/zD8EJGRWPXptbmzFligt5i2izVV7TXBbBGf0N6jk2lE1p 9b5K01/r/j4mIhx5apQru3DwdI7abwmiWCu09LGIe7sqdxhTQCPT0jO6haasn+0IoDoS 96lw== 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 r59si23075422plb.303.2019.05.08.11.47.20; Wed, 08 May 2019 11:47:36 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727611AbfEHRne (ORCPT + 99 others); Wed, 8 May 2019 13:43:34 -0400 Received: from foss.arm.com ([217.140.101.70]:41816 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729078AbfEHRnP (ORCPT ); Wed, 8 May 2019 13:43:15 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 528C780D; Wed, 8 May 2019 10:43:15 -0700 (PDT) Received: from e107049-lin.arm.com (e107049-lin.cambridge.arm.com [10.1.195.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CCBAF3F575; Wed, 8 May 2019 10:43:13 -0700 (PDT) From: douglas.raillard@arm.com To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, quentin.perret@arm.com, douglas.raillard@arm.com, patrick.bellasi@arm.com, dietmar.eggemann@arm.com Subject: [RFC PATCH 4/7] sched/cpufreq: Move up sugov_cpu_is_busy() Date: Wed, 8 May 2019 18:42:58 +0100 Message-Id: <20190508174301.4828-5-douglas.raillard@arm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190508174301.4828-1-douglas.raillard@arm.com> References: <20190508174301.4828-1-douglas.raillard@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Douglas RAILLARD Move sugov_cpu_is_busy() static function of cpufreq_schedutil.c higher in the file so it can be used by other functions. Signed-off-by: Douglas RAILLARD --- kernel/sched/cpufreq_schedutil.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index f4173a7c0f01..a52c66559321 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -173,6 +173,19 @@ static void sugov_deferred_update(struct sugov_policy *sg_policy, u64 time, } } +#ifdef CONFIG_NO_HZ_COMMON +static bool sugov_cpu_is_busy(struct sugov_cpu *sg_cpu) +{ + unsigned long idle_calls = tick_nohz_get_idle_calls_cpu(sg_cpu->cpu); + bool ret = idle_calls == sg_cpu->saved_idle_calls; + + sg_cpu->saved_idle_calls = idle_calls; + return ret; +} +#else +static inline bool sugov_cpu_is_busy(struct sugov_cpu *sg_cpu) { return false; } +#endif /* CONFIG_NO_HZ_COMMON */ + /** * get_next_freq - Compute a new frequency for a given cpufreq policy. * @sg_policy: schedutil policy object to compute the new frequency for. @@ -462,19 +475,6 @@ static unsigned long sugov_iowait_apply(struct sugov_cpu *sg_cpu, u64 time, return max(boost, util); } -#ifdef CONFIG_NO_HZ_COMMON -static bool sugov_cpu_is_busy(struct sugov_cpu *sg_cpu) -{ - unsigned long idle_calls = tick_nohz_get_idle_calls_cpu(sg_cpu->cpu); - bool ret = idle_calls == sg_cpu->saved_idle_calls; - - sg_cpu->saved_idle_calls = idle_calls; - return ret; -} -#else -static inline bool sugov_cpu_is_busy(struct sugov_cpu *sg_cpu) { return false; } -#endif /* CONFIG_NO_HZ_COMMON */ - /* * Make sugov_should_update_freq() ignore the rate limit when DL * has increased the utilization. -- 2.21.0