Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched

* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched:
sched: reorder SCHED_FEAT_ bits
sched: make sched_nr_latency static
sched: remove activate_idle_task()
sched: fix __set_task_cpu() SMP race
sched: fix SCHED_FIFO tasks & FAIR_GROUP_SCHED
sched: fix accounting of interrupts during guest execution on s390

+28 -36
+27 -35
kernel/sched.c
··· 216 216 } 217 217 218 218 /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */ 219 - static inline void set_task_cfs_rq(struct task_struct *p) 219 + static inline void set_task_cfs_rq(struct task_struct *p, unsigned int cpu) 220 220 { 221 - p->se.cfs_rq = task_group(p)->cfs_rq[task_cpu(p)]; 222 - p->se.parent = task_group(p)->se[task_cpu(p)]; 221 + p->se.cfs_rq = task_group(p)->cfs_rq[cpu]; 222 + p->se.parent = task_group(p)->se[cpu]; 223 223 } 224 224 225 225 #else 226 226 227 - static inline void set_task_cfs_rq(struct task_struct *p) { } 227 + static inline void set_task_cfs_rq(struct task_struct *p, unsigned int cpu) { } 228 228 229 229 #endif /* CONFIG_FAIR_GROUP_SCHED */ 230 230 ··· 455 455 */ 456 456 enum { 457 457 SCHED_FEAT_NEW_FAIR_SLEEPERS = 1, 458 - SCHED_FEAT_START_DEBIT = 2, 459 - SCHED_FEAT_TREE_AVG = 4, 460 - SCHED_FEAT_APPROX_AVG = 8, 461 - SCHED_FEAT_WAKEUP_PREEMPT = 16, 458 + SCHED_FEAT_WAKEUP_PREEMPT = 2, 459 + SCHED_FEAT_START_DEBIT = 4, 460 + SCHED_FEAT_TREE_AVG = 8, 461 + SCHED_FEAT_APPROX_AVG = 16, 462 462 }; 463 463 464 464 const_debug unsigned int sysctl_sched_features = 465 465 SCHED_FEAT_NEW_FAIR_SLEEPERS * 1 | 466 + SCHED_FEAT_WAKEUP_PREEMPT * 1 | 466 467 SCHED_FEAT_START_DEBIT * 1 | 467 468 SCHED_FEAT_TREE_AVG * 0 | 468 - SCHED_FEAT_APPROX_AVG * 0 | 469 - SCHED_FEAT_WAKEUP_PREEMPT * 1; 469 + SCHED_FEAT_APPROX_AVG * 0; 470 470 471 471 #define sched_feat(x) (sysctl_sched_features & SCHED_FEAT_##x) 472 472 ··· 1022 1022 1023 1023 static inline void __set_task_cpu(struct task_struct *p, unsigned int cpu) 1024 1024 { 1025 + set_task_cfs_rq(p, cpu); 1025 1026 #ifdef CONFIG_SMP 1027 + /* 1028 + * After ->cpu is set up to a new value, task_rq_lock(p, ...) can be 1029 + * successfuly executed on another CPU. We must ensure that updates of 1030 + * per-task data have been completed by this moment. 1031 + */ 1032 + smp_wmb(); 1026 1033 task_thread_info(p)->cpu = cpu; 1027 1034 #endif 1028 - set_task_cfs_rq(p); 1029 1035 } 1030 1036 1031 1037 #ifdef CONFIG_SMP ··· 3396 3390 struct rq *rq = this_rq(); 3397 3391 cputime64_t tmp; 3398 3392 3399 - if (p->flags & PF_VCPU) { 3400 - account_guest_time(p, cputime); 3401 - return; 3402 - } 3393 + if ((p->flags & PF_VCPU) && (irq_count() - hardirq_offset == 0)) 3394 + return account_guest_time(p, cputime); 3403 3395 3404 3396 p->stime = cputime_add(p->stime, cputime); 3405 3397 ··· 5282 5278 } 5283 5279 5284 5280 /* 5285 - * activate_idle_task - move idle task to the _front_ of runqueue. 5286 - */ 5287 - static void activate_idle_task(struct task_struct *p, struct rq *rq) 5288 - { 5289 - update_rq_clock(rq); 5290 - 5291 - if (p->state == TASK_UNINTERRUPTIBLE) 5292 - rq->nr_uninterruptible--; 5293 - 5294 - enqueue_task(rq, p, 0); 5295 - inc_nr_running(p, rq); 5296 - } 5297 - 5298 - /* 5299 5281 * Schedules idle task to be the next runnable task on current CPU. 5300 - * It does so by boosting its priority to highest possible and adding it to 5301 - * the _front_ of the runqueue. Used by CPU offline code. 5282 + * It does so by boosting its priority to highest possible. 5283 + * Used by CPU offline code. 5302 5284 */ 5303 5285 void sched_idle_next(void) 5304 5286 { ··· 5304 5314 5305 5315 __setscheduler(rq, p, SCHED_FIFO, MAX_RT_PRIO-1); 5306 5316 5307 - /* Add idle task to the _front_ of its priority queue: */ 5308 - activate_idle_task(p, rq); 5317 + update_rq_clock(rq); 5318 + activate_task(rq, p, 0); 5309 5319 5310 5320 spin_unlock_irqrestore(&rq->lock, flags); 5311 5321 } ··· 7079 7089 7080 7090 rq = task_rq_lock(tsk, &flags); 7081 7091 7082 - if (tsk->sched_class != &fair_sched_class) 7092 + if (tsk->sched_class != &fair_sched_class) { 7093 + set_task_cfs_rq(tsk, task_cpu(tsk)); 7083 7094 goto done; 7095 + } 7084 7096 7085 7097 update_rq_clock(rq); 7086 7098 ··· 7095 7103 tsk->sched_class->put_prev_task(rq, tsk); 7096 7104 } 7097 7105 7098 - set_task_cfs_rq(tsk); 7106 + set_task_cfs_rq(tsk, task_cpu(tsk)); 7099 7107 7100 7108 if (on_rq) { 7101 7109 if (unlikely(running))
+1 -1
kernel/sched_fair.c
··· 43 43 /* 44 44 * is kept at sysctl_sched_latency / sysctl_sched_min_granularity 45 45 */ 46 - unsigned int sched_nr_latency = 20; 46 + static unsigned int sched_nr_latency = 20; 47 47 48 48 /* 49 49 * After fork, child runs first. (default) If set to 0 then