[patch] BFS 421: remove mem barrier when setting task cpu

From: Hillf Danton
Date: Thu Jun 14 2012 - 08:25:02 EST


With runqueue lock held, update tasks cpu without mem barrier.

--- a/kernel/sched/bfs.c Thu Jun 14 20:05:42 2012
+++ b/kernel/sched/bfs.c Thu Jun 14 20:06:22 2012
@@ -1034,13 +1034,8 @@ void set_task_cpu(struct task_struct *p,
if (task_cpu(p) != cpu)
perf_sw_event(PERF_COUNT_SW_CPU_MIGRATIONS, 1, NULL, 0);

- /*
- * After ->cpu is set up to a new value, task_grq_lock(p, ...) can be
- * successfully executed on another CPU. We must ensure that updates of
- * per-task data have been completed by this moment.
- */
- smp_wmb();
- task_thread_info(p)->cpu = cpu;
+ if (task_thread_info(p)->cpu != cpu)
+ task_thread_info(p)->cpu = cpu;
}

static inline void clear_sticky(struct task_struct *p)
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/