sched/deadline: Add update_rq_clock(later_rq) in push_dl_task()
Steven Rostedt
reviewerPATCH 1/1 sched/deadline: Add update_rq_clock(later_rq) in push_dl_task()
From: Steven Rostedt (VMware) <[email protected]>
Running tests on the deadline scheduler I triggered a WARN_ON() in assert_clock_updated(). Unfortunately, this caused printk() to try to wake up the klogd which caused a nasty deadlock. All I got out of the output was:
"------------[ cut here ]------------"
But a bit of tweaking of where the 'cut here' prints were, I was able to find the source. The warning is triggered by:
push_dl_task {
add_running_bw() {
__add_running_bw() {
cpufreq_update_util() {
data->func(data, rq_clock(rq), flags); rq_clock() {
assert_clock_updated()
The rq_clock() is called on the rq of the CPU that is being pushed to. There's no guarantee that it has been updated at this time. Since we have the rq lock of that rq, the CPU doing the push can update the clock to make sure that it is up-to-date before proceeding to do the push.
---
kernel/sched/deadline.c +2 -0
@@ -2085,6 +2085,8 @@ static int push_dl_task(struct rq *rq) goto retry; } +update_rq_clock (later_rq); +deactivate_task (rq, next_task,0 );sub_running_bw (&next_task->dl, &rq->dl);sub_rq_bw (&next_task->dl, &rq->dl);