linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: daniel.lezcano@linaro.org, rjw@rjwysocki.net
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	ilina@codeaurora.org
Subject: [PATCH 4/5] cpuidle: governor: Export the needed symbols
Date: Thu, 15 Oct 2020 16:44:30 +0200	[thread overview]
Message-ID: <20201015144431.9979-4-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <20201015144431.9979-1-daniel.lezcano@linaro.org>

In the next patch, the governors will be converted to modules. Export
the symbols of the different functions used by the governors.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/cpuidle/governor.c | 3 +++
 include/linux/tick.h       | 2 ++
 kernel/sched/core.c        | 1 +
 kernel/time/tick-sched.c   | 9 +++++++++
 4 files changed, 15 insertions(+)

diff --git a/drivers/cpuidle/governor.c b/drivers/cpuidle/governor.c
index 6ec27ef096f5..2791fe352f51 100644
--- a/drivers/cpuidle/governor.c
+++ b/drivers/cpuidle/governor.c
@@ -120,6 +120,7 @@ void cpuidle_unregister_governor(struct cpuidle_governor *gov)
 
 	mutex_unlock(&cpuidle_lock);
 }
+EXPORT_SYMBOL(cpuidle_unregister_governor);
 
 /**
  * cpuidle_register_governor - registers a governor
@@ -150,6 +151,7 @@ int cpuidle_register_governor(struct cpuidle_governor *gov)
 
 	return ret;
 }
+EXPORT_SYMBOL(cpuidle_register_governor);
 
 /**
  * cpuidle_governor_latency_req - Compute a latency constraint for CPU
@@ -166,3 +168,4 @@ s64 cpuidle_governor_latency_req(unsigned int cpu)
 
 	return (s64)device_req * NSEC_PER_USEC;
 }
+EXPORT_SYMBOL(cpuidle_governor_latency_req);
diff --git a/include/linux/tick.h b/include/linux/tick.h
index 7340613c7eff..8349ba050b9c 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -124,6 +124,7 @@ enum tick_dep_bits {
 
 #ifdef CONFIG_NO_HZ_COMMON
 extern bool tick_nohz_enabled;
+extern bool tick_nohz_is_enabled(void);
 extern bool tick_nohz_tick_stopped(void);
 extern bool tick_nohz_tick_stopped_cpu(int cpu);
 extern void tick_nohz_idle_stop_tick(void);
@@ -149,6 +150,7 @@ static inline void tick_nohz_idle_stop_tick_protected(void)
 
 #else /* !CONFIG_NO_HZ_COMMON */
 #define tick_nohz_enabled (0)
+static inline int tick_nohz_is_enabled(void) { return 0 };
 static inline int tick_nohz_tick_stopped(void) { return 0; }
 static inline int tick_nohz_tick_stopped_cpu(int cpu) { return 0; }
 static inline void tick_nohz_idle_stop_tick(void) { }
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 2d95dc3f4644..ceba61bb364d 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3838,6 +3838,7 @@ unsigned long nr_iowait_cpu(int cpu)
 {
 	return atomic_read(&cpu_rq(cpu)->nr_iowait);
 }
+EXPORT_SYMBOL_GPL(nr_iowait_cpu);
 
 /*
  * IO-wait accounting, and how its mostly bollocks (on SMP).
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index f0199a4ba1ad..537716124d46 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -500,12 +500,19 @@ static int __init setup_tick_nohz(char *str)
 
 __setup("nohz=", setup_tick_nohz);
 
+bool tick_nohz_is_enabled(void)
+{
+	return tick_nohz_enabled;
+}
+EXPORT_SYMBOL_GPL(tick_nohz_is_enabled);
+
 bool tick_nohz_tick_stopped(void)
 {
 	struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched);
 
 	return ts->tick_stopped;
 }
+EXPORT_SYMBOL_GPL(tick_nohz_tick_stopped);
 
 bool tick_nohz_tick_stopped_cpu(int cpu)
 {
@@ -1066,6 +1073,7 @@ bool tick_nohz_idle_got_tick(void)
 	}
 	return false;
 }
+EXPORT_SYMBOL_GPL(tick_nohz_idle_got_tick);
 
 /**
  * tick_nohz_get_next_hrtimer - return the next expiration time for the hrtimer
@@ -1117,6 +1125,7 @@ ktime_t tick_nohz_get_sleep_length(ktime_t *delta_next)
 
 	return ktime_sub(next_event, now);
 }
+EXPORT_SYMBOL_GPL(tick_nohz_get_sleep_length);
 
 /**
  * tick_nohz_get_idle_calls_cpu - return the current idle calls counter value
-- 
2.17.1


  parent reply	other threads:[~2020-10-15 14:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 14:44 [PATCH 1/5] cpuidle: Remove pointless stub Daniel Lezcano
2020-10-15 14:44 ` [PATCH 2/5] cpuidle: governor: Encapsulate the cpuidle on/off switch Daniel Lezcano
2020-10-15 14:44 ` [PATCH 3/5] cpuidle: governor: Make possible to unregister a governor Daniel Lezcano
2020-10-15 14:44 ` Daniel Lezcano [this message]
2020-11-05 14:04   ` [PATCH 4/5] cpuidle: governor: Export the needed symbols Rafael J. Wysocki
2020-11-09 12:34     ` Peter Zijlstra
2020-10-15 14:44 ` [PATCH 5/5] cpuidle: governor: Convert governors to modules Daniel Lezcano
2020-10-16 15:24 ` [PATCH 1/5] cpuidle: Remove pointless stub Rafael J. Wysocki
2020-10-16 20:31   ` Daniel Lezcano
2020-11-05 14:14     ` Rafael J. Wysocki
2020-11-05 15:31       ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201015144431.9979-4-daniel.lezcano@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=ilina@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).