[PATCH 5/5] sched/numa: Fix task_tick_fair() from disabling numa_balancing

From: Mel Gorman
Date: Thu Jan 07 2016 - 12:58:40 EST


From: Srikar Dronamraju <srikar@xxxxxxxxxxxxxxxxxx>

commit b52da86e0ad58f096710977fcda856fd84da9233 upstream.

If static branch 'sched_numa_balancing' is enabled, it should kickstart
NUMA balancing through task_tick_numa(). However the following commit:

2a595721a1fa ("sched/numa: Convert sched_numa_balancing to a static_branch")

erroneously disables this.

Fix this anomaly by enabling task_tick_numa() when the static branch
'sched_numa_balancing' is enabled.

Signed-off-by: Srikar Dronamraju <srikar@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Mel Gorman <mgorman@xxxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Rik van Riel <riel@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Link: http://lkml.kernel.org/r/1443752305-27413-1-git-send-email-srikar@xxxxxxxxxxxxxxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Signed-off-by: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx>
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 7975932034f9..98b6eacf09aa 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7811,7 +7811,7 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)
entity_tick(cfs_rq, se, queued);
}

- if (!static_branch_unlikely(&sched_numa_balancing))
+ if (static_branch_unlikely(&sched_numa_balancing))
task_tick_numa(rq, curr);
}

--
2.6.4