--- linux-2.6.3/kernel/sched.c 2004-02-18 21:09:41.000000000 +1100 +++ linux-2.6.3-ck1/kernel/sched.c 2004-02-18 21:15:17.217714760 +1100 @@ -209,6 +209,7 @@ struct runqueue { atomic_t *node_nr_running; int prev_node_load[MAX_NUMNODES]; #endif + unsigned long cpu; task_t *migration_thread; struct list_head migration_queue; @@ -223,6 +224,17 @@ static DEFINE_PER_CPU(struct runqueue, r #define cpu_curr(cpu) (cpu_rq(cpu)->curr) /* + * Symmetric multi-threading helpers. + */ +#define SMT_ACTIVE (cpu_has_ht && smp_num_siblings > 1) +#define SMT_SIBLINGS(cpu1, cpu2) (SMT_ACTIVE && \ + cpu_sibling_map[(cpu1)] == (cpu2)) +/* + * The resource impact in % of running a task on it's smt sibling. + */ +#define SMT_SIBLING_IMPACT (85) + +/* * Default context-switch locking: */ #ifndef prepare_arch_switch @@ -2917,6 +2929,7 @@ void __init sched_init(void) prio_array_t *array; rq = cpu_rq(i); + rq->cpu = (unsigned long)(i); rq->active = rq->arrays; rq->expired = rq->arrays + 1; rq->best_expired_prio = MAX_PRIO;