Pull misc scheduler fixes from Ingo Molnar: - Fix potential deadlock under CONFIG_DEBUG_OBJECTS=y - PELT metrics update ordering fix - uclamp logic fix * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/uclamp: Fix incorrect condition sched/pelt: Fix update of blocked PELT ordering sched/core: Avoid spurious lock dependencies
Unified · Split
| @@ -1065,7 +1065,7 @@ uclamp_update_active(struct task_struct *p, enum uclamp_id clamp_id) · 1064 unmodified lines | |||
| 1065 | * affecting a valid clamp bucket, the next time it's enqueued, | 1065 | * affecting a valid clamp bucket, the next time it's enqueued, |
| 1066 | * it will already see the updated clamp bucket value. | 1066 | * it will already see the updated clamp bucket value. |
| 1067 | */ | 1067 | */ |
| 1068 | if (!p->uclamp[clamp_id].active) { | 1068 | if (p->uclamp[clamp_id].active) { |
| 1069 | uclamp_rq_dec_id(rq, p, clamp_id); | 1069 | uclamp_rq_dec_id(rq, p, clamp_id); |
| 1070 | uclamp_rq_inc_id(rq, p, clamp_id); | 1070 | uclamp_rq_inc_id(rq, p, clamp_id); |
| 1071 | } | 1071 | } |
| @@ -6019,10 +6019,11 @@ void init_idle(struct task_struct *idle, int cpu) · 4947 unmodified lines | |||
| 6019 | struct rq *rq = cpu_rq(cpu); | 6019 | struct rq *rq = cpu_rq(cpu); |
| 6020 | unsigned long flags; | 6020 | unsigned long flags; |
| 6021 | 6021 | ||
| 6022 | __sched_fork(0, idle); | ||
| 6023 | |||
| 6022 | raw_spin_lock_irqsave(&idle->pi_lock, flags); | 6024 | raw_spin_lock_irqsave(&idle->pi_lock, flags); |
| 6023 | raw_spin_lock(&rq->lock); | 6025 | raw_spin_lock(&rq->lock); |
| 6024 | 6026 | ||
| 6025 | __sched_fork(0, idle); | ||
| 6026 | idle->state = TASK_RUNNING; | 6027 | idle->state = TASK_RUNNING; |
| 6027 | idle->se.exec_start = sched_clock(); | 6028 | idle->se.exec_start = sched_clock(); |
| 6028 | idle->flags |= PF_IDLE; | 6029 | idle->flags |= PF_IDLE; |
| @@ -7547,6 +7547,19 @@ static void update_blocked_averages(int cpu) · 7546 unmodified lines | |||
| 7547 | rq_lock_irqsave(rq, &rf); | 7547 | rq_lock_irqsave(rq, &rf); |
| 7548 | update_rq_clock(rq); | 7548 | update_rq_clock(rq); |
| 7549 | 7549 | ||
| 7550 | /* | ||
| 7551 | * update_cfs_rq_load_avg() can call cpufreq_update_util(). Make sure | ||
| 7552 | * that RT, DL and IRQ signals have been updated before updating CFS. | ||
| 7553 | */ | ||
| 7554 | curr_class = rq->curr->sched_class; | ||
| 7555 | update_rt_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &rt_sched_class); | ||
| 7556 | update_dl_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &dl_sched_class); | ||
| 7557 | update_irq_load_avg(rq, 0); | ||
| 7558 | |||
| 7559 | /* Don't need periodic decay once load/util_avg are null */ | ||
| 7560 | if (others_have_blocked(rq)) | ||
| 7561 | done = false; | ||
| 7562 | |||
| 7550 | /* | 7563 | /* |
| 7551 | * Iterates the task_group tree in a bottom up fashion, see | 7564 | * Iterates the task_group tree in a bottom up fashion, see |
| 7552 | * list_add_leaf_cfs_rq() for details. | 7565 | * list_add_leaf_cfs_rq() for details. |
| @@ -7574,14 +7587,6 @@ static void update_blocked_averages(int cpu) · 21 unmodified lines | |||
| 7574 | done = false; | 7587 | done = false; |
| 7575 | } | 7588 | } |
| 7576 | 7589 | ||
| 7577 | curr_class = rq->curr->sched_class; | ||
| 7578 | update_rt_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &rt_sched_class); | ||
| 7579 | update_dl_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &dl_sched_class); | ||
| 7580 | update_irq_load_avg(rq, 0); | ||
| 7581 | /* Don't need periodic decay once load/util_avg are null */ | ||
| 7582 | if (others_have_blocked(rq)) | ||
| 7583 | done = false; | ||
| 7584 | |||
| 7585 | update_blocked_load_status(rq, !done); | 7590 | update_blocked_load_status(rq, !done); |
| 7586 | rq_unlock_irqrestore(rq, &rf); | 7591 | rq_unlock_irqrestore(rq, &rf); |
| 7587 | } | 7592 | } |
| @@ -7642,12 +7647,18 @@ static inline void update_blocked_averages(int cpu) · 54 unmodified lines | |||
| 7642 | 7647 | ||
| 7643 | rq_lock_irqsave(rq, &rf); | 7648 | rq_lock_irqsave(rq, &rf); |
| 7644 | update_rq_clock(rq); | 7649 | update_rq_clock(rq); |
| 7645 | update_cfs_rq_load_avg(cfs_rq_clock_pelt(cfs_rq), cfs_rq); | ||
| 7646 | 7650 | ||
| 7651 | /* | ||
| 7652 | * update_cfs_rq_load_avg() can call cpufreq_update_util(). Make sure | ||
| 7653 | * that RT, DL and IRQ signals have been updated before updating CFS. | ||
| 7654 | */ | ||
| 7647 | curr_class = rq->curr->sched_class; | 7655 | curr_class = rq->curr->sched_class; |
| 7648 | update_rt_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &rt_sched_class); | 7656 | update_rt_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &rt_sched_class); |
| 7649 | update_dl_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &dl_sched_class); | 7657 | update_dl_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &dl_sched_class); |
| 7650 | update_irq_load_avg(rq, 0); | 7658 | update_irq_load_avg(rq, 0); |
| 7659 | |||
| 7660 | update_cfs_rq_load_avg(cfs_rq_clock_pelt(cfs_rq), cfs_rq); | ||
| 7661 | |||
| 7651 | update_blocked_load_status(rq, cfs_rq_has_blocked(cfs_rq) || others_have_blocked(rq)); | 7662 | update_blocked_load_status(rq, cfs_rq_has_blocked(cfs_rq) || others_have_blocked(rq)); |
| 7652 | rq_unlock_irqrestore(rq, &rf); | 7663 | rq_unlock_irqrestore(rq, &rf); |
| 7653 | } | 7664 | } |