lkml.org 
[lkml]   [2014]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH] sched: select_idle_sibling macro optimize
Date
If the sd domain just has one group, then we must be caught the
i == target later, and then goes to deeper level domain.
So just skip this domain checking to save some instructions.

Signed-off-by: Alex Shi <alex.shi@linaro.org>
---
kernel/sched/fair.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c7395d9..3265fbc 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4196,6 +4196,11 @@ static int select_idle_sibling(struct task_struct *p, int target)
sd = rcu_dereference(per_cpu(sd_llc, target));
for_each_lower_domain(sd) {
sg = sd->groups;
+
+ /* skip single group domain */
+ if (sg == sg->next)
+ continue;
+
do {
if (!cpumask_intersects(sched_group_cpus(sg),
tsk_cpus_allowed(p)))
--
1.8.1.2


\
 
 \ /
  Last update: 2014-01-15 16:01    [W:1.157 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site