* [PATCH V2 1/8] sched: reduce trigger_load_balance parameters
2014-01-06 11:34 [PATCH V2 0/8] sched: cleanup trigger_load_balance Daniel Lezcano
@ 2014-01-06 11:34 ` 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
` (7 subsequent siblings)
8 siblings, 1 reply; 19+ messages in thread
From: Daniel Lezcano @ 2014-01-06 11:34 UTC (permalink / raw)
To: mingo, peterz; +Cc: linux-kernel, linaro-kernel, preeti.lkml
The cpu information is already stored in the struct rq, so no need to pass it
as parameter to the trigger_load_balance function.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
kernel/sched/core.c | 2 +-
kernel/sched/fair.c | 4 +++-
kernel/sched/sched.h | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index b21a63e..7007884 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2299,7 +2299,7 @@ void scheduler_tick(void)
#ifdef CONFIG_SMP
rq->idle_balance = idle_cpu(cpu);
- trigger_load_balance(rq, cpu);
+ trigger_load_balance(rq);
#endif
rq_last_tick_reset(rq);
}
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 4316af2..600301c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6869,8 +6869,10 @@ static inline int on_null_domain(int cpu)
/*
* Trigger the SCHED_SOFTIRQ if it is time to do periodic load balancing.
*/
-void trigger_load_balance(struct rq *rq, int cpu)
+void trigger_load_balance(struct rq *rq)
{
+ int cpu = rq->cpu;
+
/* Don't need to rebalance while attached to NULL domain */
if (time_after_eq(jiffies, rq->next_balance) &&
likely(!on_null_domain(cpu)))
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index b3b4a49..4f10d1a 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1052,7 +1052,7 @@ extern const struct sched_class idle_sched_class;
extern void update_group_power(struct sched_domain *sd, int cpu);
-extern void trigger_load_balance(struct rq *rq, int cpu);
+extern void trigger_load_balance(struct rq *rq);
extern void idle_balance(int this_cpu, struct rq *this_rq);
extern void idle_enter_fair(struct rq *this_rq);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 19+ messages in thread* [tip:sched/core] sched: Reduce trigger_load_balance() parameters
2014-01-06 11:34 ` [PATCH V2 1/8] sched: reduce trigger_load_balance parameters Daniel Lezcano
@ 2014-01-13 15:55 ` tip-bot for Daniel Lezcano
0 siblings, 0 replies; 19+ messages in thread
From: tip-bot for Daniel Lezcano @ 2014-01-13 15:55 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, peterz, tglx, daniel.lezcano
Commit-ID: 7caff66f361c44d0fbc74ed1cfa60a357fc84cf2
Gitweb: http://git.kernel.org/tip/7caff66f361c44d0fbc74ed1cfa60a357fc84cf2
Author: Daniel Lezcano <daniel.lezcano@linaro.org>
AuthorDate: Mon, 6 Jan 2014 12:34:38 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 13 Jan 2014 13:47:26 +0100
sched: Reduce trigger_load_balance() parameters
The cpu information is already stored in the struct rq, so no need to pass it
as parameter to the trigger_load_balance function.
Cc: linaro-kernel@lists.linaro.org
Cc: preeti.lkml@gmail.com
Cc: mingo@redhat.com
Cc: peterz@infradead.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1389008085-9069-2-git-send-email-daniel.lezcano@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/core.c | 2 +-
kernel/sched/fair.c | 4 +++-
kernel/sched/sched.h | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index a549d9a..392c6f8 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2436,7 +2436,7 @@ void scheduler_tick(void)
#ifdef CONFIG_SMP
rq->idle_balance = idle_cpu(cpu);
- trigger_load_balance(rq, cpu);
+ trigger_load_balance(rq);
#endif
rq_last_tick_reset(rq);
}
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index b73f4ba..b35d322 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6876,8 +6876,10 @@ static inline int on_null_domain(int cpu)
/*
* Trigger the SCHED_SOFTIRQ if it is time to do periodic load balancing.
*/
-void trigger_load_balance(struct rq *rq, int cpu)
+void trigger_load_balance(struct rq *rq)
{
+ int cpu = rq->cpu;
+
/* Don't need to rebalance while attached to NULL domain */
if (time_after_eq(jiffies, rq->next_balance) &&
likely(!on_null_domain(cpu)))
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 890339099..c2119fd 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1175,7 +1175,7 @@ extern const struct sched_class idle_sched_class;
extern void update_group_power(struct sched_domain *sd, int cpu);
-extern void trigger_load_balance(struct rq *rq, int cpu);
+extern void trigger_load_balance(struct rq *rq);
extern void idle_balance(int this_cpu, struct rq *this_rq);
extern void idle_enter_fair(struct rq *this_rq);
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH V2 2/8] sched: reduce nohz_kick_needed parameters
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-06 11:34 ` 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
` (6 subsequent siblings)
8 siblings, 1 reply; 19+ messages in thread
From: Daniel Lezcano @ 2014-01-06 11:34 UTC (permalink / raw)
To: mingo, peterz; +Cc: linux-kernel, linaro-kernel, preeti.lkml
The cpu information is already stored in the struct rq, so no need to pass it
as parameter to the nohz_kick_needed function.
The caller of this function just called idle_cpu() before to fill the
rq->idle_balance field.
Use rq->cpu and rq->idle_balance.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
kernel/sched/fair.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 600301c..4cb414a 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6781,14 +6781,14 @@ end:
* - For SD_ASYM_PACKING, if the lower numbered cpu's in the scheduler
* domain span are idle.
*/
-static inline int nohz_kick_needed(struct rq *rq, int cpu)
+static inline int nohz_kick_needed(struct rq *rq)
{
unsigned long now = jiffies;
struct sched_domain *sd;
struct sched_group_power *sgp;
- int nr_busy;
+ int nr_busy, cpu = rq->cpu;
- if (unlikely(idle_cpu(cpu)))
+ if (unlikely(rq->idle_balance))
return 0;
/*
@@ -6878,7 +6878,7 @@ void trigger_load_balance(struct rq *rq)
likely(!on_null_domain(cpu)))
raise_softirq(SCHED_SOFTIRQ);
#ifdef CONFIG_NO_HZ_COMMON
- if (nohz_kick_needed(rq, cpu) && likely(!on_null_domain(cpu)))
+ if (nohz_kick_needed(rq) && likely(!on_null_domain(cpu)))
nohz_balancer_kick(cpu);
#endif
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 19+ messages in thread* [tip:sched/core] sched: Reduce nohz_kick_needed() parameters
2014-01-06 11:34 ` [PATCH V2 2/8] sched: reduce nohz_kick_needed parameters Daniel Lezcano
@ 2014-01-13 15:55 ` tip-bot for Daniel Lezcano
0 siblings, 0 replies; 19+ messages in thread
From: tip-bot for Daniel Lezcano @ 2014-01-13 15:55 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, peterz, tglx, daniel.lezcano
Commit-ID: 4a725627f21df6b280a19f50bc849daaab3b1544
Gitweb: http://git.kernel.org/tip/4a725627f21df6b280a19f50bc849daaab3b1544
Author: Daniel Lezcano <daniel.lezcano@linaro.org>
AuthorDate: Mon, 6 Jan 2014 12:34:39 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 13 Jan 2014 13:47:27 +0100
sched: Reduce nohz_kick_needed() parameters
The cpu information is already stored in the struct rq, so no need to pass it
as parameter to the nohz_kick_needed function.
The caller of this function just called idle_cpu() before to fill the
rq->idle_balance field.
Use rq->cpu and rq->idle_balance.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1389008085-9069-3-git-send-email-daniel.lezcano@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/fair.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index b35d322..c47b1ce 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6788,14 +6788,14 @@ end:
* - For SD_ASYM_PACKING, if the lower numbered cpu's in the scheduler
* domain span are idle.
*/
-static inline int nohz_kick_needed(struct rq *rq, int cpu)
+static inline int nohz_kick_needed(struct rq *rq)
{
unsigned long now = jiffies;
struct sched_domain *sd;
struct sched_group_power *sgp;
- int nr_busy;
+ int nr_busy, cpu = rq->cpu;
- if (unlikely(idle_cpu(cpu)))
+ if (unlikely(rq->idle_balance))
return 0;
/*
@@ -6885,7 +6885,7 @@ void trigger_load_balance(struct rq *rq)
likely(!on_null_domain(cpu)))
raise_softirq(SCHED_SOFTIRQ);
#ifdef CONFIG_NO_HZ_COMMON
- if (nohz_kick_needed(rq, cpu) && likely(!on_null_domain(cpu)))
+ if (nohz_kick_needed(rq) && likely(!on_null_domain(cpu)))
nohz_balancer_kick(cpu);
#endif
}
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH V2 3/8] sched: pass struct rq to on_null_domain function
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-06 11:34 ` [PATCH V2 2/8] sched: reduce nohz_kick_needed parameters Daniel Lezcano
@ 2014-01-06 11:34 ` 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
` (5 subsequent siblings)
8 siblings, 1 reply; 19+ messages in thread
From: Daniel Lezcano @ 2014-01-06 11:34 UTC (permalink / raw)
To: mingo, peterz; +Cc: linux-kernel, linaro-kernel, preeti.lkml
The on_null_domain function is getting the cpu to retrieve the struct rq
associated with it.
Pass the struct rq directly to the function as the caller has already the info.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
kernel/sched/fair.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 4cb414a..82dd145 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6861,9 +6861,9 @@ static void run_rebalance_domains(struct softirq_action *h)
nohz_idle_balance(this_cpu, idle);
}
-static inline int on_null_domain(int cpu)
+static inline int on_null_domain(struct rq *rq)
{
- return !rcu_dereference_sched(cpu_rq(cpu)->sd);
+ return !rcu_dereference_sched(rq->sd);
}
/*
@@ -6875,10 +6875,10 @@ void trigger_load_balance(struct rq *rq)
/* Don't need to rebalance while attached to NULL domain */
if (time_after_eq(jiffies, rq->next_balance) &&
- likely(!on_null_domain(cpu)))
+ likely(!on_null_domain(rq)))
raise_softirq(SCHED_SOFTIRQ);
#ifdef CONFIG_NO_HZ_COMMON
- if (nohz_kick_needed(rq) && likely(!on_null_domain(cpu)))
+ if (nohz_kick_needed(rq) && likely(!on_null_domain(rq)))
nohz_balancer_kick(cpu);
#endif
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 19+ messages in thread* [tip:sched/core] sched: Pass 'struct rq' to on_null_domain()
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-bot for Daniel Lezcano
0 siblings, 0 replies; 19+ messages in thread
From: tip-bot for Daniel Lezcano @ 2014-01-13 15:55 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, peterz, tglx, daniel.lezcano
Commit-ID: 63f609b160151c9e86b26b935c9671a23afe299f
Gitweb: http://git.kernel.org/tip/63f609b160151c9e86b26b935c9671a23afe299f
Author: Daniel Lezcano <daniel.lezcano@linaro.org>
AuthorDate: Mon, 6 Jan 2014 12:34:40 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 13 Jan 2014 13:47:28 +0100
sched: Pass 'struct rq' to on_null_domain()
The on_null_domain() function is getting the cpu to retrieve the struct rq
associated with it.
Pass 'struct rq' directly to the function as the caller already has the info.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1389008085-9069-4-git-send-email-daniel.lezcano@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/fair.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c47b1ce..fc0afc5 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6868,9 +6868,9 @@ static void run_rebalance_domains(struct softirq_action *h)
nohz_idle_balance(this_cpu, idle);
}
-static inline int on_null_domain(int cpu)
+static inline int on_null_domain(struct rq *rq)
{
- return !rcu_dereference_sched(cpu_rq(cpu)->sd);
+ return !rcu_dereference_sched(rq->sd);
}
/*
@@ -6882,10 +6882,10 @@ void trigger_load_balance(struct rq *rq)
/* Don't need to rebalance while attached to NULL domain */
if (time_after_eq(jiffies, rq->next_balance) &&
- likely(!on_null_domain(cpu)))
+ likely(!on_null_domain(rq)))
raise_softirq(SCHED_SOFTIRQ);
#ifdef CONFIG_NO_HZ_COMMON
- if (nohz_kick_needed(rq) && likely(!on_null_domain(cpu)))
+ if (nohz_kick_needed(rq) && likely(!on_null_domain(rq)))
nohz_balancer_kick(cpu);
#endif
}
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH V2 4/8] sched: remove unused parameter for find_new_ilb
2014-01-06 11:34 [PATCH V2 0/8] sched: cleanup trigger_load_balance Daniel Lezcano
` (2 preceding siblings ...)
2014-01-06 11:34 ` [PATCH V2 3/8] sched: pass struct rq to on_null_domain function Daniel Lezcano
@ 2014-01-06 11:34 ` 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
` (4 subsequent siblings)
8 siblings, 1 reply; 19+ messages in thread
From: Daniel Lezcano @ 2014-01-06 11:34 UTC (permalink / raw)
To: mingo, peterz; +Cc: linux-kernel, linaro-kernel, preeti.lkml
The 'call_cpu' is never used in the function. Remove it.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
---
kernel/sched/fair.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 82dd145..1f7ed1a 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6502,7 +6502,7 @@ static struct {
unsigned long next_balance; /* in jiffy units */
} nohz ____cacheline_aligned;
-static inline int find_new_ilb(int call_cpu)
+static inline int find_new_ilb(void)
{
int ilb = cpumask_first(nohz.idle_cpus_mask);
@@ -6523,7 +6523,7 @@ static void nohz_balancer_kick(int cpu)
nohz.next_balance++;
- ilb_cpu = find_new_ilb(cpu);
+ ilb_cpu = find_new_ilb();
if (ilb_cpu >= nr_cpu_ids)
return;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 19+ messages in thread* [tip:sched/core] sched: Remove unused parameter from find_new_ilb ()
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-bot for Daniel Lezcano
0 siblings, 0 replies; 19+ messages in thread
From: tip-bot for Daniel Lezcano @ 2014-01-13 15:55 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, preeti, peterz, tglx, daniel.lezcano
Commit-ID: 3dd0337d6df7d54c82ecebfa6485040f686bf8b1
Gitweb: http://git.kernel.org/tip/3dd0337d6df7d54c82ecebfa6485040f686bf8b1
Author: Daniel Lezcano <daniel.lezcano@linaro.org>
AuthorDate: Mon, 6 Jan 2014 12:34:41 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 13 Jan 2014 13:47:29 +0100
sched: Remove unused parameter from find_new_ilb()
The 'call_cpu' is never used in the function. Remove it.
Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1389008085-9069-5-git-send-email-daniel.lezcano@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/fair.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index fc0afc5..5fda3c4 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6509,7 +6509,7 @@ static struct {
unsigned long next_balance; /* in jiffy units */
} nohz ____cacheline_aligned;
-static inline int find_new_ilb(int call_cpu)
+static inline int find_new_ilb(void)
{
int ilb = cpumask_first(nohz.idle_cpus_mask);
@@ -6530,7 +6530,7 @@ static void nohz_balancer_kick(int cpu)
nohz.next_balance++;
- ilb_cpu = find_new_ilb(cpu);
+ ilb_cpu = find_new_ilb();
if (ilb_cpu >= nr_cpu_ids)
return;
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH V2 5/8] sched: remove unused parameter in nohz_balancer_kick function
2014-01-06 11:34 [PATCH V2 0/8] sched: cleanup trigger_load_balance Daniel Lezcano
` (3 preceding siblings ...)
2014-01-06 11:34 ` [PATCH V2 4/8] sched: remove unused parameter for find_new_ilb Daniel Lezcano
@ 2014-01-06 11:34 ` 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
` (3 subsequent siblings)
8 siblings, 1 reply; 19+ messages in thread
From: Daniel Lezcano @ 2014-01-06 11:34 UTC (permalink / raw)
To: mingo, peterz; +Cc: linux-kernel, linaro-kernel, preeti.lkml
The cpu parameter is no longer needed in nohz_balancer_kick, let's remove
the parameter.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
---
kernel/sched/fair.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 1f7ed1a..c647c45 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6517,7 +6517,7 @@ static inline int find_new_ilb(void)
* nohz_load_balancer CPU (if there is one) otherwise fallback to any idle
* CPU (if there is one).
*/
-static void nohz_balancer_kick(int cpu)
+static void nohz_balancer_kick(void)
{
int ilb_cpu;
@@ -6871,15 +6871,13 @@ static inline int on_null_domain(struct rq *rq)
*/
void trigger_load_balance(struct rq *rq)
{
- int cpu = rq->cpu;
-
/* Don't need to rebalance while attached to NULL domain */
if (time_after_eq(jiffies, rq->next_balance) &&
likely(!on_null_domain(rq)))
raise_softirq(SCHED_SOFTIRQ);
#ifdef CONFIG_NO_HZ_COMMON
if (nohz_kick_needed(rq) && likely(!on_null_domain(rq)))
- nohz_balancer_kick(cpu);
+ nohz_balancer_kick();
#endif
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 19+ messages in thread* [tip:sched/core] sched: Remove unused parameter from nohz_balancer_kick()
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-bot for Daniel Lezcano
0 siblings, 0 replies; 19+ messages in thread
From: tip-bot for Daniel Lezcano @ 2014-01-13 15:56 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, preeti, peterz, tglx, daniel.lezcano
Commit-ID: 0aeeeebac8d8304501680f12862784341f4bee7b
Gitweb: http://git.kernel.org/tip/0aeeeebac8d8304501680f12862784341f4bee7b
Author: Daniel Lezcano <daniel.lezcano@linaro.org>
AuthorDate: Mon, 6 Jan 2014 12:34:42 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 13 Jan 2014 13:47:30 +0100
sched: Remove unused parameter from nohz_balancer_kick()
The cpu parameter is no longer needed in nohz_balancer_kick, let's remove
the parameter.
Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1389008085-9069-6-git-send-email-daniel.lezcano@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/fair.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 5fda3c4..b91cd93 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6524,7 +6524,7 @@ static inline int find_new_ilb(void)
* nohz_load_balancer CPU (if there is one) otherwise fallback to any idle
* CPU (if there is one).
*/
-static void nohz_balancer_kick(int cpu)
+static void nohz_balancer_kick(void)
{
int ilb_cpu;
@@ -6878,15 +6878,13 @@ static inline int on_null_domain(struct rq *rq)
*/
void trigger_load_balance(struct rq *rq)
{
- int cpu = rq->cpu;
-
/* Don't need to rebalance while attached to NULL domain */
if (time_after_eq(jiffies, rq->next_balance) &&
likely(!on_null_domain(rq)))
raise_softirq(SCHED_SOFTIRQ);
#ifdef CONFIG_NO_HZ_COMMON
if (nohz_kick_needed(rq) && likely(!on_null_domain(rq)))
- nohz_balancer_kick(cpu);
+ nohz_balancer_kick();
#endif
}
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH V2 6/8] sched: pass struct rq to rebalance_domains function
2014-01-06 11:34 [PATCH V2 0/8] sched: cleanup trigger_load_balance Daniel Lezcano
` (4 preceding siblings ...)
2014-01-06 11:34 ` [PATCH V2 5/8] sched: remove unused parameter in nohz_balancer_kick function Daniel Lezcano
@ 2014-01-06 11:34 ` 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
` (2 subsequent siblings)
8 siblings, 1 reply; 19+ messages in thread
From: Daniel Lezcano @ 2014-01-06 11:34 UTC (permalink / raw)
To: mingo, peterz; +Cc: linux-kernel, linaro-kernel, preeti.lkml
The cpu information is stored in the struct rq and the caller of the
rebalance_domains function pass the cpu to retrieve the struct rq but
it already has the struct rq info. Replace the cpu parameter with the
struct rq.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
kernel/sched/fair.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c647c45..0fbd8d0 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6633,10 +6633,10 @@ void update_max_interval(void)
*
* Balancing parameters are set up in init_sched_domains.
*/
-static void rebalance_domains(int cpu, enum cpu_idle_type idle)
+static void rebalance_domains(struct rq *rq, enum cpu_idle_type idle)
{
int continue_balancing = 1;
- struct rq *rq = cpu_rq(cpu);
+ int cpu = rq->cpu;
unsigned long interval;
struct sched_domain *sd;
/* Earliest time when we have to do rebalance again */
@@ -6762,7 +6762,7 @@ static void nohz_idle_balance(int this_cpu, enum cpu_idle_type idle)
update_idle_cpu_load(rq);
raw_spin_unlock_irq(&rq->lock);
- rebalance_domains(balance_cpu, CPU_IDLE);
+ rebalance_domains(rq, CPU_IDLE);
if (time_after(this_rq->next_balance, rq->next_balance))
this_rq->next_balance = rq->next_balance;
@@ -6851,7 +6851,7 @@ static void run_rebalance_domains(struct softirq_action *h)
enum cpu_idle_type idle = this_rq->idle_balance ?
CPU_IDLE : CPU_NOT_IDLE;
- rebalance_domains(this_cpu, idle);
+ rebalance_domains(this_rq, idle);
/*
* If this cpu has a pending nohz_balance_kick, then do the
--
1.7.9.5
^ permalink raw reply related [flat|nested] 19+ messages in thread* [tip:sched/core] sched: Pass 'struct rq' to rebalance_domains()
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-bot for Daniel Lezcano
0 siblings, 0 replies; 19+ messages in thread
From: tip-bot for Daniel Lezcano @ 2014-01-13 15:56 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, peterz, tglx, daniel.lezcano
Commit-ID: f7ed0a895ead0f093f59898ff9cf4e20768a5f09
Gitweb: http://git.kernel.org/tip/f7ed0a895ead0f093f59898ff9cf4e20768a5f09
Author: Daniel Lezcano <daniel.lezcano@linaro.org>
AuthorDate: Mon, 6 Jan 2014 12:34:43 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 13 Jan 2014 13:47:31 +0100
sched: Pass 'struct rq' to rebalance_domains()
The cpu information is stored in the struct rq and the caller of the
rebalance_domains function pass the cpu to retrieve the struct rq but
it already has the struct rq info. Replace the cpu parameter with the
struct rq.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1389008085-9069-7-git-send-email-daniel.lezcano@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/fair.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index b91cd93..ff4e0df 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6640,10 +6640,10 @@ void update_max_interval(void)
*
* Balancing parameters are set up in init_sched_domains.
*/
-static void rebalance_domains(int cpu, enum cpu_idle_type idle)
+static void rebalance_domains(struct rq *rq, enum cpu_idle_type idle)
{
int continue_balancing = 1;
- struct rq *rq = cpu_rq(cpu);
+ int cpu = rq->cpu;
unsigned long interval;
struct sched_domain *sd;
/* Earliest time when we have to do rebalance again */
@@ -6769,7 +6769,7 @@ static void nohz_idle_balance(int this_cpu, enum cpu_idle_type idle)
update_idle_cpu_load(rq);
raw_spin_unlock_irq(&rq->lock);
- rebalance_domains(balance_cpu, CPU_IDLE);
+ rebalance_domains(rq, CPU_IDLE);
if (time_after(this_rq->next_balance, rq->next_balance))
this_rq->next_balance = rq->next_balance;
@@ -6858,7 +6858,7 @@ static void run_rebalance_domains(struct softirq_action *h)
enum cpu_idle_type idle = this_rq->idle_balance ?
CPU_IDLE : CPU_NOT_IDLE;
- rebalance_domains(this_cpu, idle);
+ rebalance_domains(this_rq, idle);
/*
* If this cpu has a pending nohz_balance_kick, then do the
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH V2 7/8] sched: pass struct rq to nohz_idle_balance function
2014-01-06 11:34 [PATCH V2 0/8] sched: cleanup trigger_load_balance Daniel Lezcano
` (5 preceding siblings ...)
2014-01-06 11:34 ` [PATCH V2 6/8] sched: pass struct rq to rebalance_domains function Daniel Lezcano
@ 2014-01-06 11:34 ` Daniel Lezcano
2014-01-13 15:56 ` [tip:sched/core] sched: Pass 'struct rq' to nohz_idle_balance() tip-bot for Daniel Lezcano
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-06 12:32 ` [PATCH V2 0/8] sched: cleanup trigger_load_balance Peter Zijlstra
8 siblings, 1 reply; 19+ messages in thread
From: Daniel Lezcano @ 2014-01-06 11:34 UTC (permalink / raw)
To: mingo, peterz; +Cc: linux-kernel, linaro-kernel, preeti.lkml
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>
---
kernel/sched/fair.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 0fbd8d0..59c57e7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6733,9 +6733,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;
@@ -6846,8 +6846,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;
@@ -6858,7 +6857,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)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 19+ messages in thread* [tip:sched/core] sched: Pass 'struct rq' to nohz_idle_balance()
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
0 siblings, 0 replies; 19+ messages in thread
From: tip-bot for Daniel Lezcano @ 2014-01-13 15:56 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, peterz, tglx, daniel.lezcano
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)
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH V2 8/8] sched: factor out on_null_domain check in trigger_load_balance function
2014-01-06 11:34 [PATCH V2 0/8] sched: cleanup trigger_load_balance Daniel Lezcano
` (6 preceding siblings ...)
2014-01-06 11:34 ` [PATCH V2 7/8] sched: pass struct rq to nohz_idle_balance function Daniel Lezcano
@ 2014-01-06 11:34 ` 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
8 siblings, 1 reply; 19+ messages in thread
From: Daniel Lezcano @ 2014-01-06 11:34 UTC (permalink / raw)
To: mingo, peterz; +Cc: linux-kernel, linaro-kernel, preeti.lkml
The test on_null_domain is done twice in the trigger_load_balance function.
Move the test at the begin of the function, so there is only one check.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
kernel/sched/fair.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 59c57e7..ef95ddf 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6871,11 +6871,13 @@ static inline int on_null_domain(struct rq *rq)
void trigger_load_balance(struct rq *rq)
{
/* Don't need to rebalance while attached to NULL domain */
- if (time_after_eq(jiffies, rq->next_balance) &&
- likely(!on_null_domain(rq)))
+ if (unlikely(on_null_domain(rq)))
+ return;
+
+ if (time_after_eq(jiffies, rq->next_balance))
raise_softirq(SCHED_SOFTIRQ);
#ifdef CONFIG_NO_HZ_COMMON
- if (nohz_kick_needed(rq) && likely(!on_null_domain(rq)))
+ if (nohz_kick_needed(rq))
nohz_balancer_kick();
#endif
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 19+ messages in thread* [tip:sched/core] sched: Factor out the on_null_domain() checks in trigger_load_balance()
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-bot for Daniel Lezcano
0 siblings, 0 replies; 19+ messages in thread
From: tip-bot for Daniel Lezcano @ 2014-01-13 15:56 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, peterz, tglx, daniel.lezcano
Commit-ID: c726099ec224be8078d91072207053ff9a1ad6fc
Gitweb: http://git.kernel.org/tip/c726099ec224be8078d91072207053ff9a1ad6fc
Author: Daniel Lezcano <daniel.lezcano@linaro.org>
AuthorDate: Mon, 6 Jan 2014 12:34:45 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 13 Jan 2014 13:47:35 +0100
sched: Factor out the on_null_domain() checks in trigger_load_balance()
The test on_null_domain is done twice in the trigger_load_balance function.
Move the test at the begin of the function, so there is only one check.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1389008085-9069-9-git-send-email-daniel.lezcano@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/fair.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index d7220d1..b24b6cf 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6878,11 +6878,13 @@ static inline int on_null_domain(struct rq *rq)
void trigger_load_balance(struct rq *rq)
{
/* Don't need to rebalance while attached to NULL domain */
- if (time_after_eq(jiffies, rq->next_balance) &&
- likely(!on_null_domain(rq)))
+ if (unlikely(on_null_domain(rq)))
+ return;
+
+ if (time_after_eq(jiffies, rq->next_balance))
raise_softirq(SCHED_SOFTIRQ);
#ifdef CONFIG_NO_HZ_COMMON
- if (nohz_kick_needed(rq) && likely(!on_null_domain(rq)))
+ if (nohz_kick_needed(rq))
nohz_balancer_kick();
#endif
}
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH V2 0/8] sched: cleanup trigger_load_balance
2014-01-06 11:34 [PATCH V2 0/8] sched: cleanup trigger_load_balance Daniel Lezcano
` (7 preceding siblings ...)
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-06 12:32 ` Peter Zijlstra
2014-01-13 12:55 ` Daniel Lezcano
8 siblings, 1 reply; 19+ messages in thread
From: Peter Zijlstra @ 2014-01-06 12:32 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: mingo, linux-kernel, linaro-kernel, preeti.lkml
On Mon, Jan 06, 2014 at 12:34:37PM +0100, Daniel Lezcano wrote:
> This patchset does a cleanup on the parameters passed from the function
> 'trigger_load_balance' to the underneath functions.
Whee.. it applies ;-)
^ permalink raw reply [flat|nested] 19+ messages in thread