lkml.org 
[lkml]   [2012]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] sched: trigger_load_balance clean up
Date
Remove a redundant check for on_null_domain(cpu), and rerange the code
that make it more readable.

Signed-off-by: Alex Shi <alex.shi@intel.com>
---
kernel/sched/fair.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 5bbc4bf..529092d 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4934,11 +4934,13 @@ static inline int on_null_domain(int cpu)
void trigger_load_balance(struct rq *rq, int cpu)
{
/* Don't need to rebalance while attached to NULL domain */
- if (time_after_eq(jiffies, rq->next_balance) &&
- likely(!on_null_domain(cpu)))
+ if (unlikely(on_null_domain(cpu)))
+ return;
+
+ if (time_after_eq(jiffies, rq->next_balance))
raise_softirq(SCHED_SOFTIRQ);
#ifdef CONFIG_NO_HZ
- if (nohz_kick_needed(rq, cpu) && likely(!on_null_domain(cpu)))
+ if (nohz_kick_needed(rq, cpu))
nohz_balancer_kick(cpu);
#endif
}
--
1.7.5.4


\
 
 \ /
  Last update: 2012-09-10 10:01    [W:0.740 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site