lkml.org 
[lkml]   [2012]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 17/36] autonuma: prevent select_task_rq_fair to return -1
Date
find_idlest_cpu when run up on all domain levels shouldn't normally
return -1. With the introduction of the NUMA affinity check that
should be still true most of the time, but it's not guaranteed if the
NUMA affinity of the task changes very fast. So better not to depend
on timings.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
---
kernel/sched/fair.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 42a88fa..677b99e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2794,6 +2794,17 @@ select_task_rq_fair(struct task_struct *p, int sd_flag, int wake_flags)
unlock:
rcu_read_unlock();

+#ifdef CONFIG_AUTONUMA
+ if (new_cpu < 0)
+ /*
+ * find_idlest_cpu() may return -1 if
+ * task_autonuma_cpu() changes all the time, it's very
+ * unlikely, but we must handle it if it ever happens.
+ */
+ new_cpu = prev_cpu;
+#endif
+ BUG_ON(new_cpu < 0);
+
return new_cpu;
}
#endif /* CONFIG_SMP */

\
 
 \ /
  Last update: 2012-08-22 17:41    [W:0.142 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site