sched: Avoid creating superfluous NUMA domains on non-NUMA systems
authorPeter Zijlstra <[email protected]>
Wed, 20 Jul 2011 16:42:57 +0000 (18:42 +0200)
committerIngo Molnar <[email protected]>
Wed, 20 Jul 2011 16:54:33 +0000 (18:54 +0200)
When creating sched_domains, stop when we've covered the entire
target span instead of continuing to create domains, only to
later find they're redundant and throw them away again.

This avoids single node systems from touching funny NUMA
sched_domain creation code and reduces the risks of the new
SD_OVERLAP code.

Requested-by: Linus Torvalds <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Cc: Anton Blanchard <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/1311180177.29152.57.camel@twins
Signed-off-by: Ingo Molnar <[email protected]>
kernel/sched.c

index 921adf6f6fad1d4cc7c29522af51abce83cfea97..14168c49a15428880f5b66702e12134eff4ba1fa 100644 (file)
@@ -7436,6 +7436,8 @@ static int build_sched_domains(const struct cpumask *cpu_map,
                        sd = build_sched_domain(tl, &d, cpu_map, attr, sd, i);
                        if (tl->flags & SDTL_OVERLAP || sched_feat(FORCE_SD_OVERLAP))
                                sd->flags |= SD_OVERLAP;
+                       if (cpumask_equal(cpu_map, sched_domain_span(sd)))
+                               break;
                }
 
                while (sd->child)