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