From 592eaca1409e55407e980f71b2ec604ca3610ba5 Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Tue, 21 Jun 2011 01:29:34 -0400 Subject: Avoid needlessly costly migrations. CONFIG_SCHED_CPU_AFFINITY Given a choice between several available CPUs (unlinked) on which to schedule a task, let the scheduler select the CPU closest to where that task was previously scheduled. Hopefully, this will reduce cache migration penalties. Notes: SCHED_CPU_AFFINITY is dependent upon x86 (only x86 is supported at this time). Also PFair/PD^2 does not make use of this feature. Signed-off-by: Andrea Bastoni --- litmus/litmus.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'litmus/litmus.c') diff --git a/litmus/litmus.c b/litmus/litmus.c index bb8c6c7e9dd1..73af6c3010d6 100644 --- a/litmus/litmus.c +++ b/litmus/litmus.c @@ -17,6 +17,10 @@ #include #include +#ifdef CONFIG_SCHED_CPU_AFFINITY +#include +#endif + /* Number of RT tasks that exist in the system */ atomic_t rt_task_count = ATOMIC_INIT(0); static DEFINE_RAW_SPINLOCK(task_transition_lock); @@ -540,6 +544,10 @@ static int __init _init_litmus(void) init_litmus_proc(); +#ifdef CONFIG_SCHED_CPU_AFFINITY + init_topology(); +#endif + return 0; } -- cgit v1.2.2