Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
cpuset: fix regression when failed to generate sched domains
sched, signals: fix the racy usage of ->signal in account_group_xxx/run_posix_cpu_timers
sched: fix kernel warning on /proc/sched_debug access
sched: correct sched-rt-group.txt pathname in init/Kconfig

+35 -19
+1 -1
init/Kconfig
··· 354 354 setting below. If enabled, it will also make it impossible to 355 355 schedule realtime tasks for non-root users until you allocate 356 356 realtime bandwidth for them. 357 - See Documentation/sched-rt-group.txt for more information. 357 + See Documentation/scheduler/sched-rt-group.txt for more information. 358 358 359 359 choice 360 360 depends on GROUP_SCHED
+8 -4
kernel/cpuset.c
··· 587 587 int ndoms; /* number of sched domains in result */ 588 588 int nslot; /* next empty doms[] cpumask_t slot */ 589 589 590 - ndoms = 0; 591 590 doms = NULL; 592 591 dattr = NULL; 593 592 csa = NULL; ··· 673 674 * Convert <csn, csa> to <ndoms, doms> and populate cpu masks. 674 675 */ 675 676 doms = kmalloc(ndoms * sizeof(cpumask_t), GFP_KERNEL); 676 - if (!doms) { 677 - ndoms = 0; 677 + if (!doms) 678 678 goto done; 679 - } 680 679 681 680 /* 682 681 * The rest of the code, including the scheduler, can deal with ··· 728 731 729 732 done: 730 733 kfree(csa); 734 + 735 + /* 736 + * Fallback to the default domain if kmalloc() failed. 737 + * See comments in partition_sched_domains(). 738 + */ 739 + if (doms == NULL) 740 + ndoms = 1; 731 741 732 742 *domains = doms; 733 743 *attributes = dattr;
+5 -2
kernel/posix-cpu-timers.c
··· 1308 1308 */ 1309 1309 static inline int fastpath_timer_check(struct task_struct *tsk) 1310 1310 { 1311 - struct signal_struct *sig = tsk->signal; 1311 + struct signal_struct *sig; 1312 1312 1313 - if (unlikely(!sig)) 1313 + /* tsk == current, ensure it is safe to use ->signal/sighand */ 1314 + if (unlikely(tsk->exit_state)) 1314 1315 return 0; 1315 1316 1316 1317 if (!task_cputime_zero(&tsk->cputime_expires)) { ··· 1324 1323 if (task_cputime_expired(&task_sample, &tsk->cputime_expires)) 1325 1324 return 1; 1326 1325 } 1326 + 1327 + sig = tsk->signal; 1327 1328 if (!task_cputime_zero(&sig->cputime_expires)) { 1328 1329 struct task_cputime group_sample; 1329 1330
+7 -6
kernel/sched.c
··· 7789 7789 * 7790 7790 * The passed in 'doms_new' should be kmalloc'd. This routine takes 7791 7791 * ownership of it and will kfree it when done with it. If the caller 7792 - * failed the kmalloc call, then it can pass in doms_new == NULL, 7793 - * and partition_sched_domains() will fallback to the single partition 7794 - * 'fallback_doms', it also forces the domains to be rebuilt. 7792 + * failed the kmalloc call, then it can pass in doms_new == NULL && 7793 + * ndoms_new == 1, and partition_sched_domains() will fallback to 7794 + * the single partition 'fallback_doms', it also forces the domains 7795 + * to be rebuilt. 7795 7796 * 7796 - * If doms_new==NULL it will be replaced with cpu_online_map. 7797 - * ndoms_new==0 is a special case for destroying existing domains. 7798 - * It will not create the default domain. 7797 + * If doms_new == NULL it will be replaced with cpu_online_map. 7798 + * ndoms_new == 0 is a special case for destroying existing domains, 7799 + * and it will not create the default domain. 7799 7800 * 7800 7801 * Call with hotplug lock held 7801 7802 */
+3 -2
kernel/sched_debug.c
··· 423 423 #undef __P 424 424 425 425 { 426 + unsigned int this_cpu = raw_smp_processor_id(); 426 427 u64 t0, t1; 427 428 428 - t0 = sched_clock(); 429 - t1 = sched_clock(); 429 + t0 = cpu_clock(this_cpu); 430 + t1 = cpu_clock(this_cpu); 430 431 SEQ_printf(m, "%-35s:%21Ld\n", 431 432 "clock-delta", (long long)(t1-t0)); 432 433 }
+11 -4
kernel/sched_stats.h
··· 298 298 { 299 299 struct signal_struct *sig; 300 300 301 - sig = tsk->signal; 302 - if (unlikely(!sig)) 301 + /* tsk == current, ensure it is safe to use ->signal */ 302 + if (unlikely(tsk->exit_state)) 303 303 return; 304 + 305 + sig = tsk->signal; 304 306 if (sig->cputime.totals) { 305 307 struct task_cputime *times; 306 308 ··· 327 325 { 328 326 struct signal_struct *sig; 329 327 330 - sig = tsk->signal; 331 - if (unlikely(!sig)) 328 + /* tsk == current, ensure it is safe to use ->signal */ 329 + if (unlikely(tsk->exit_state)) 332 330 return; 331 + 332 + sig = tsk->signal; 333 333 if (sig->cputime.totals) { 334 334 struct task_cputime *times; 335 335 ··· 357 353 struct signal_struct *sig; 358 354 359 355 sig = tsk->signal; 356 + /* see __exit_signal()->task_rq_unlock_wait() */ 357 + barrier(); 360 358 if (unlikely(!sig)) 361 359 return; 360 + 362 361 if (sig->cputime.totals) { 363 362 struct task_cputime *times; 364 363