From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <linux-kernel@vger.kernel.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
Scott Wood <swood@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
"Frederic Weisbecker" <fweisbec@gmail.com>,
Ingo Molnar <mingo@kernel.org>
Subject: [PATCH] sched: nohz: drop calc_load_nohz_remote with mismatched ifdefs
Date: Wed, 1 Jul 2020 20:49:44 -0400 [thread overview]
Message-ID: <1593650984-58400-1-git-send-email-paul.gortmaker@windriver.com> (raw)
In commit ebc0f83c78a2 ("timers/nohz: Update NOHZ load in remote tick")
we got calc_load_nohz_remote(rq) as a one-line wrapper function around
calc_load_nohz_fold(rq) and with sched_tick_remote() as the only user.
However, we build the sched_tick_remote only for NO_HZ_FULL but the
wrapper inside a block for NO_HZ_COMMON. So users that parallel the
defconfig with COMMON=y and FULL=n get an unused stub built in.
(gdb) p calc_load_nohz_remote
$227 = {void (struct rq *)} 0xffffffff8110a5c0 <calc_load_nohz_remote>
(gdb) p sched_tick_remote
No symbol "sched_tick_remote" in current context.
Rather than fix the ifdeffery, we note that calc_load_nohz_remote was
most likely introduced to be self-documenting of the "remote" aspect.
And yet, inside sched_tick_remote, it is fairly clear that all the code
there are acting on behalf of the remote cpu and the corresponding
remote rq without them each adding specific remote named wrappers.
Hence it seems to make sense to just dispense with the stub entirely
and simplify the code code in the process.
Ensure at the same time, that nohz.h is aware of what a rq is - since
that implicit header dependency was introduced by the same commit.
Fixes: ebc0f83c78a2 ("timers/nohz: Update NOHZ load in remote tick")
Cc: Scott Wood <swood@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/linux/sched/nohz.h | 5 +++--
kernel/sched/core.c | 2 +-
kernel/sched/loadavg.c | 11 +----------
3 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/include/linux/sched/nohz.h b/include/linux/sched/nohz.h
index 6d67e9a5af6b..58459fdf6758 100644
--- a/include/linux/sched/nohz.h
+++ b/include/linux/sched/nohz.h
@@ -6,6 +6,8 @@
* This is the interface between the scheduler and nohz/dynticks:
*/
+struct rq;
+
#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
extern void nohz_balance_enter_idle(int cpu);
extern int get_nohz_timer_target(void);
@@ -15,11 +17,10 @@ static inline void nohz_balance_enter_idle(int cpu) { }
#ifdef CONFIG_NO_HZ_COMMON
void calc_load_nohz_start(void);
-void calc_load_nohz_remote(struct rq *rq);
void calc_load_nohz_stop(void);
+void calc_load_nohz_fold(struct rq *rq);
#else
static inline void calc_load_nohz_start(void) { }
-static inline void calc_load_nohz_remote(struct rq *rq) { }
static inline void calc_load_nohz_stop(void) { }
#endif /* CONFIG_NO_HZ_COMMON */
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f518af52d0fb..23d3b2282c09 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3763,7 +3763,7 @@ static void sched_tick_remote(struct work_struct *work)
}
curr->sched_class->task_tick(rq, curr, 0);
- calc_load_nohz_remote(rq);
+ calc_load_nohz_fold(rq);
out_unlock:
rq_unlock_irq(rq, &rf);
out_requeue:
diff --git a/kernel/sched/loadavg.c b/kernel/sched/loadavg.c
index d2a655643a02..5bab95e1bde4 100644
--- a/kernel/sched/loadavg.c
+++ b/kernel/sched/loadavg.c
@@ -231,7 +231,7 @@ static inline int calc_load_read_idx(void)
return calc_load_idx & 1;
}
-static void calc_load_nohz_fold(struct rq *rq)
+void calc_load_nohz_fold(struct rq *rq)
{
long delta;
@@ -252,15 +252,6 @@ void calc_load_nohz_start(void)
calc_load_nohz_fold(this_rq());
}
-/*
- * Keep track of the load for NOHZ_FULL, must be called between
- * calc_load_nohz_{start,stop}().
- */
-void calc_load_nohz_remote(struct rq *rq)
-{
- calc_load_nohz_fold(rq);
-}
-
void calc_load_nohz_stop(void)
{
struct rq *this_rq = this_rq();
--
1.9.1
reply other threads:[~2020-07-02 0:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1593650984-58400-1-git-send-email-paul.gortmaker@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=swood@redhat.com \
/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
Powered by JetHome