瀏覽代碼

mm: sched: numa: Control enabling and disabling of NUMA balancing if !SCHED_DEBUG

The "mm: sched: numa: Control enabling and disabling of NUMA balancing"
depends on scheduling debug being enabled but it's perfectly legimate to
disable automatic NUMA balancing even without this option. This should
take care of it.

Signed-off-by: Mel Gorman <mgorman@suse.de>
Mel Gorman 13 年之前
父節點
當前提交
3105b86a9f
共有 2 個文件被更改,包括 16 次插入1 次删除
  1. 9 0
      kernel/sched/core.c
  2. 7 1
      kernel/sched/sched.h

+ 9 - 0
kernel/sched/core.c

@@ -1558,6 +1558,7 @@ static void __sched_fork(struct task_struct *p)
 }
 }
 
 
 #ifdef CONFIG_NUMA_BALANCING
 #ifdef CONFIG_NUMA_BALANCING
+#ifdef CONFIG_SCHED_DEBUG
 void set_numabalancing_state(bool enabled)
 void set_numabalancing_state(bool enabled)
 {
 {
 	if (enabled)
 	if (enabled)
@@ -1565,6 +1566,14 @@ void set_numabalancing_state(bool enabled)
 	else
 	else
 		sched_feat_set("NO_NUMA");
 		sched_feat_set("NO_NUMA");
 }
 }
+#else
+__read_mostly bool numabalancing_enabled;
+
+void set_numabalancing_state(bool enabled)
+{
+	numabalancing_enabled = enabled;
+}
+#endif /* CONFIG_SCHED_DEBUG */
 #endif /* CONFIG_NUMA_BALANCING */
 #endif /* CONFIG_NUMA_BALANCING */
 
 
 /*
 /*

+ 7 - 1
kernel/sched/sched.h

@@ -650,9 +650,15 @@ extern struct static_key sched_feat_keys[__SCHED_FEAT_NR];
 
 
 #ifdef CONFIG_NUMA_BALANCING
 #ifdef CONFIG_NUMA_BALANCING
 #define sched_feat_numa(x) sched_feat(x)
 #define sched_feat_numa(x) sched_feat(x)
+#ifdef CONFIG_SCHED_DEBUG
+#define numabalancing_enabled sched_feat_numa(NUMA)
+#else
+extern bool numabalancing_enabled;
+#endif /* CONFIG_SCHED_DEBUG */
 #else
 #else
 #define sched_feat_numa(x) (0)
 #define sched_feat_numa(x) (0)
-#endif
+#define numabalancing_enabled (0)
+#endif /* CONFIG_NUMA_BALANCING */
 
 
 static inline u64 global_rt_period(void)
 static inline u64 global_rt_period(void)
 {
 {