From: tip-bot for Daniel Lezcano <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
peterz@infradead.org, tglx@linutronix.de,
daniel.lezcano@linaro.org
Subject: [tip:sched/core] sched: Pass 'struct rq' to nohz_idle_balance()
Date: Mon, 13 Jan 2014 07:56:27 -0800 [thread overview]
Message-ID: <tip-208cb16ba325552a3935bfc002e34561b0d512d7@git.kernel.org> (raw)
In-Reply-To: <1389008085-9069-8-git-send-email-daniel.lezcano@linaro.org>
Commit-ID: 208cb16ba325552a3935bfc002e34561b0d512d7
Gitweb: http://git.kernel.org/tip/208cb16ba325552a3935bfc002e34561b0d512d7
Author: Daniel Lezcano <daniel.lezcano@linaro.org>
AuthorDate: Mon, 6 Jan 2014 12:34:44 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 13 Jan 2014 13:47:33 +0100
sched: Pass 'struct rq' to nohz_idle_balance()
The cpu information is stored in the struct rq. Pass the struct rq to
nohz_idle_balance, so all the functions called in run_rebalance_domains have
the same parameters and the 'this_cpu' variable becomes pointless.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
[ Added !SMP build fix. ]
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1389008085-9069-8-git-send-email-daniel.lezcano@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/fair.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index ff4e0df..d7220d1 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6740,9 +6740,9 @@ out:
* In CONFIG_NO_HZ_COMMON case, the idle balance kickee will do the
* rebalancing for all the cpus for whom scheduler ticks are stopped.
*/
-static void nohz_idle_balance(int this_cpu, enum cpu_idle_type idle)
+static void nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle)
{
- struct rq *this_rq = cpu_rq(this_cpu);
+ int this_cpu = this_rq->cpu;
struct rq *rq;
int balance_cpu;
@@ -6844,7 +6844,7 @@ need_kick:
return 1;
}
#else
-static void nohz_idle_balance(int this_cpu, enum cpu_idle_type idle) { }
+static void nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle) { }
#endif
/*
@@ -6853,8 +6853,7 @@ static void nohz_idle_balance(int this_cpu, enum cpu_idle_type idle) { }
*/
static void run_rebalance_domains(struct softirq_action *h)
{
- int this_cpu = smp_processor_id();
- struct rq *this_rq = cpu_rq(this_cpu);
+ struct rq *this_rq = this_rq();
enum cpu_idle_type idle = this_rq->idle_balance ?
CPU_IDLE : CPU_NOT_IDLE;
@@ -6865,7 +6864,7 @@ static void run_rebalance_domains(struct softirq_action *h)
* balancing on behalf of the other idle cpus whose ticks are
* stopped.
*/
- nohz_idle_balance(this_cpu, idle);
+ nohz_idle_balance(this_rq, idle);
}
static inline int on_null_domain(struct rq *rq)
next prev parent reply other threads:[~2014-01-13 15:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-06 11:34 [PATCH V2 0/8] sched: cleanup trigger_load_balance Daniel Lezcano
2014-01-06 11:34 ` [PATCH V2 1/8] sched: reduce trigger_load_balance parameters Daniel Lezcano
2014-01-13 15:55 ` [tip:sched/core] sched: Reduce trigger_load_balance() parameters tip-bot for Daniel Lezcano
2014-01-06 11:34 ` [PATCH V2 2/8] sched: reduce nohz_kick_needed parameters Daniel Lezcano
2014-01-13 15:55 ` [tip:sched/core] sched: Reduce nohz_kick_needed() parameters tip-bot for Daniel Lezcano
2014-01-06 11:34 ` [PATCH V2 3/8] sched: pass struct rq to on_null_domain function Daniel Lezcano
2014-01-13 15:55 ` [tip:sched/core] sched: Pass 'struct rq' to on_null_domain() tip-bot for Daniel Lezcano
2014-01-06 11:34 ` [PATCH V2 4/8] sched: remove unused parameter for find_new_ilb Daniel Lezcano
2014-01-13 15:55 ` [tip:sched/core] sched: Remove unused parameter from find_new_ilb () tip-bot for Daniel Lezcano
2014-01-06 11:34 ` [PATCH V2 5/8] sched: remove unused parameter in nohz_balancer_kick function Daniel Lezcano
2014-01-13 15:56 ` [tip:sched/core] sched: Remove unused parameter from nohz_balancer_kick() tip-bot for Daniel Lezcano
2014-01-06 11:34 ` [PATCH V2 6/8] sched: pass struct rq to rebalance_domains function Daniel Lezcano
2014-01-13 15:56 ` [tip:sched/core] sched: Pass 'struct rq' to rebalance_domains() tip-bot for Daniel Lezcano
2014-01-06 11:34 ` [PATCH V2 7/8] sched: pass struct rq to nohz_idle_balance function Daniel Lezcano
2014-01-13 15:56 ` tip-bot for Daniel Lezcano [this message]
2014-01-06 11:34 ` [PATCH V2 8/8] sched: factor out on_null_domain check in trigger_load_balance function Daniel Lezcano
2014-01-13 15:56 ` [tip:sched/core] sched: Factor out the on_null_domain() checks in trigger_load_balance() tip-bot for Daniel Lezcano
2014-01-06 12:32 ` [PATCH V2 0/8] sched: cleanup trigger_load_balance Peter Zijlstra
2014-01-13 12:55 ` 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=tip-208cb16ba325552a3935bfc002e34561b0d512d7@git.kernel.org \
--to=tipbot@zytor.com \
--cc=daniel.lezcano@linaro.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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