diff options
author | Vincent Guittot <vincent.guittot@linaro.org> | 2014-04-11 05:44:37 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-05-07 07:33:49 -0400 |
commit | 143e1e28cb40bed836b0a06567208bd7347c9672 (patch) | |
tree | 7fee7ba69929c04534c17dca02bf39332e110c9a /arch | |
parent | 107437febd495a50e2cd09c81bbaa84d30e57b07 (diff) |
sched: Rework sched_domain topology definition
We replace the old way to configure the scheduler topology with a new method
which enables a platform to declare additionnal level (if needed).
We still have a default topology table definition that can be used by platform
that don't want more level than the SMT, MC, CPU and NUMA ones. This table can
be overwritten by an arch which either wants to add new level where a load
balance make sense like BOOK or powergating level or wants to change the flags
configuration of some levels.
For each level, we need a function pointer that returns cpumask for each cpu,
a function pointer that returns the flags for the level and a name. Only flags
that describe topology, can be set by an architecture. The current topology
flags are:
SD_SHARE_CPUPOWER
SD_SHARE_PKG_RESOURCES
SD_NUMA
SD_ASYM_PACKING
Then, each level must be a subset on the next one. The build sequence of the
sched_domain will take care of removing useless levels like those with 1 CPU
and those with the same CPU span and no more relevant information for
load balancing than its children.
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Hanjun Guo <hanjun.guo@linaro.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Jason Low <jason.low2@hp.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux390@de.ibm.com
Cc: linux-ia64@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Link: http://lkml.kernel.org/r/1397209481-28542-2-git-send-email-vincent.guittot@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/include/asm/topology.h | 24 | ||||
-rw-r--r-- | arch/s390/include/asm/topology.h | 2 | ||||
-rw-r--r-- | arch/tile/include/asm/topology.h | 33 |
3 files changed, 0 insertions, 59 deletions
diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h index 5cb55a1e606b..3202aa74e0d6 100644 --- a/arch/ia64/include/asm/topology.h +++ b/arch/ia64/include/asm/topology.h | |||
@@ -46,30 +46,6 @@ | |||
46 | 46 | ||
47 | void build_cpu_to_node_map(void); | 47 | void build_cpu_to_node_map(void); |
48 | 48 | ||
49 | #define SD_CPU_INIT (struct sched_domain) { \ | ||
50 | .parent = NULL, \ | ||
51 | .child = NULL, \ | ||
52 | .groups = NULL, \ | ||
53 | .min_interval = 1, \ | ||
54 | .max_interval = 4, \ | ||
55 | .busy_factor = 64, \ | ||
56 | .imbalance_pct = 125, \ | ||
57 | .cache_nice_tries = 2, \ | ||
58 | .busy_idx = 2, \ | ||
59 | .idle_idx = 1, \ | ||
60 | .newidle_idx = 0, \ | ||
61 | .wake_idx = 0, \ | ||
62 | .forkexec_idx = 0, \ | ||
63 | .flags = SD_LOAD_BALANCE \ | ||
64 | | SD_BALANCE_NEWIDLE \ | ||
65 | | SD_BALANCE_EXEC \ | ||
66 | | SD_BALANCE_FORK \ | ||
67 | | SD_WAKE_AFFINE, \ | ||
68 | .last_balance = jiffies, \ | ||
69 | .balance_interval = 1, \ | ||
70 | .nr_balance_failed = 0, \ | ||
71 | } | ||
72 | |||
73 | #endif /* CONFIG_NUMA */ | 49 | #endif /* CONFIG_NUMA */ |
74 | 50 | ||
75 | #ifdef CONFIG_SMP | 51 | #ifdef CONFIG_SMP |
diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h index 05425b18c0aa..07763bdb408d 100644 --- a/arch/s390/include/asm/topology.h +++ b/arch/s390/include/asm/topology.h | |||
@@ -64,8 +64,6 @@ static inline void s390_init_cpu_topology(void) | |||
64 | }; | 64 | }; |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | #define SD_BOOK_INIT SD_CPU_INIT | ||
68 | |||
69 | #include <asm-generic/topology.h> | 67 | #include <asm-generic/topology.h> |
70 | 68 | ||
71 | #endif /* _ASM_S390_TOPOLOGY_H */ | 69 | #endif /* _ASM_S390_TOPOLOGY_H */ |
diff --git a/arch/tile/include/asm/topology.h b/arch/tile/include/asm/topology.h index d15c0d8d550f..938311844233 100644 --- a/arch/tile/include/asm/topology.h +++ b/arch/tile/include/asm/topology.h | |||
@@ -44,39 +44,6 @@ static inline const struct cpumask *cpumask_of_node(int node) | |||
44 | /* For now, use numa node -1 for global allocation. */ | 44 | /* For now, use numa node -1 for global allocation. */ |
45 | #define pcibus_to_node(bus) ((void)(bus), -1) | 45 | #define pcibus_to_node(bus) ((void)(bus), -1) |
46 | 46 | ||
47 | /* | ||
48 | * TILE architecture has many cores integrated in one processor, so we need | ||
49 | * setup bigger balance_interval for both CPU/NODE scheduling domains to | ||
50 | * reduce process scheduling costs. | ||
51 | */ | ||
52 | |||
53 | /* sched_domains SD_CPU_INIT for TILE architecture */ | ||
54 | #define SD_CPU_INIT (struct sched_domain) { \ | ||
55 | .min_interval = 4, \ | ||
56 | .max_interval = 128, \ | ||
57 | .busy_factor = 64, \ | ||
58 | .imbalance_pct = 125, \ | ||
59 | .cache_nice_tries = 1, \ | ||
60 | .busy_idx = 2, \ | ||
61 | .idle_idx = 1, \ | ||
62 | .newidle_idx = 0, \ | ||
63 | .wake_idx = 0, \ | ||
64 | .forkexec_idx = 0, \ | ||
65 | \ | ||
66 | .flags = 1*SD_LOAD_BALANCE \ | ||
67 | | 1*SD_BALANCE_NEWIDLE \ | ||
68 | | 1*SD_BALANCE_EXEC \ | ||
69 | | 1*SD_BALANCE_FORK \ | ||
70 | | 0*SD_BALANCE_WAKE \ | ||
71 | | 0*SD_WAKE_AFFINE \ | ||
72 | | 0*SD_SHARE_CPUPOWER \ | ||
73 | | 0*SD_SHARE_PKG_RESOURCES \ | ||
74 | | 0*SD_SERIALIZE \ | ||
75 | , \ | ||
76 | .last_balance = jiffies, \ | ||
77 | .balance_interval = 32, \ | ||
78 | } | ||
79 | |||
80 | /* By definition, we create nodes based on online memory. */ | 47 | /* By definition, we create nodes based on online memory. */ |
81 | #define node_has_online_mem(nid) 1 | 48 | #define node_has_online_mem(nid) 1 |
82 | 49 | ||