Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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:
sched: Set correct normal_prio and prio values in sched_fork()

+9 -11
+9 -11
kernel/sched.c
··· 2515 2515 __sched_fork(p); 2516 2516 2517 2517 /* 2518 - * Make sure we do not leak PI boosting priority to the child. 2519 - */ 2520 - p->prio = current->normal_prio; 2521 - 2522 - /* 2523 2518 * Revert to default priority/policy on fork if requested. 2524 2519 */ 2525 2520 if (unlikely(p->sched_reset_on_fork)) { 2526 - if (p->policy == SCHED_FIFO || p->policy == SCHED_RR) 2521 + if (p->policy == SCHED_FIFO || p->policy == SCHED_RR) { 2527 2522 p->policy = SCHED_NORMAL; 2528 - 2529 - if (p->normal_prio < DEFAULT_PRIO) 2530 - p->prio = DEFAULT_PRIO; 2523 + p->normal_prio = p->static_prio; 2524 + } 2531 2525 2532 2526 if (PRIO_TO_NICE(p->static_prio) < 0) { 2533 2527 p->static_prio = NICE_TO_PRIO(0); 2528 + p->normal_prio = p->static_prio; 2534 2529 set_load_weight(p); 2535 2530 } 2536 2531 ··· 2535 2540 */ 2536 2541 p->sched_reset_on_fork = 0; 2537 2542 } 2543 + 2544 + /* 2545 + * Make sure we do not leak PI boosting priority to the child. 2546 + */ 2547 + p->prio = current->normal_prio; 2538 2548 2539 2549 if (!rt_prio(p->prio)) 2540 2550 p->sched_class = &fair_sched_class; ··· 2580 2580 rq = task_rq_lock(p, &flags); 2581 2581 BUG_ON(p->state != TASK_RUNNING); 2582 2582 update_rq_clock(rq); 2583 - 2584 - p->prio = effective_prio(p); 2585 2583 2586 2584 if (!p->sched_class->task_new || !current->se.on_rq) { 2587 2585 activate_task(rq, p, 0);