A missing clock update is causing the following warning: rq->clock_update_flags < RQCF_ACT_SKIP WARNING: CPU: 10 PID: 0 at kernel/sched/sched.h:963 inactive_task_timer+0x5d6/0x720 Call Trace: <IRQ> __hrtimer_run_queues+0x10f/0x530 hrtimer_interrupt+0xe5/0x240 smp_apic_timer_interrupt+0x79/0x2b0 apic_timer_interrupt+0xf/0x20 </IRQ> do_idle+0x203/0x280 cpu_startup_entry+0x6f/0x80 start_secondary+0x1b0/0x200 secondary_startup_64+0xa5/0xb0 hardirqs last enabled at (793919): [<ffffffffa27c5f6e>] cpuidle_enter_state+0x9e/0x360 hardirqs last disabled at (793920): [<ffffffffa2a0096e>] interrupt_entry+0xce/0xe0 softirqs last enabled at (793922): [<ffffffffa20bef78>] irq_enter+0x68/0x70 softirqs last disabled at (793921): [<ffffffffa20bef5d>] irq_enter+0x4d/0x70 This happens because inactive_task_timer() calls sub_running_bw() (if TASK_DEAD and non_contending) that might trigger a schedutil update, which might access the clock. Clock is however currently updated only later in inactive_task_timer() function. Fix the problem by updating the clock right after task_rq_lock().
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -1259,6 +1259,9 @@ static enum hrtimer_restart inactive_task_timer(struct hrtimer *timer) · 1258 unmodified lines | ||
| 1259 | 1259 | |
| 1260 | 1260 | rq = task_rq_lock(p, &rf); |
| 1261 | 1261 | |
| 1262 | + sched_clock_tick(); | |
| 1263 | + update_rq_clock(rq); | |
| 1264 | + | |
| 1262 | 1265 | if (!dl_task(p) || p->state == TASK_DEAD) { |
| 1263 | 1266 | struct dl_bw *dl_b = dl_bw_of(task_cpu(p)); |
| 1264 | 1267 | |
| @@ -1278,9 +1281,6 @@ static enum hrtimer_restart inactive_task_timer(struct hrtimer *timer) · 13 unmodified lines | ||
| 1278 | 1281 | if (dl_se->dl_non_contending == 0) |
| 1279 | 1282 | goto unlock; |
| 1280 | 1283 | |
| 1281 | − sched_clock_tick(); | |
| 1282 | − update_rq_clock(rq); | |
| 1283 | − | |
| 1284 | 1284 | sub_running_bw(dl_se, &rq->dl); |
| 1285 | 1285 | dl_se->dl_non_contending = 0; |
| 1286 | 1286 | unlock: |