mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Juri Lelli <juri.lelli@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Clark Williams <williams@redhat.com>,
	Claudio Scordino <claudio@evidence.eu.com>,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH] sched/deadline: Add update_rq_clock(later_rq) in push_dl_task()
Date: Tue, 3 Jul 2018 12:03:01 -0400	[thread overview]
Message-ID: <20180703120301.3667f418@gandalf.local.home> (raw)

From: Steven Rostedt (VMware) <rostedt@goodmis.org>

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.

Link: http://lkml.kernel.org/r/20180703105449.2a211fb2@gandalf.local.home
Suggested-by: Juri Lelli <juri.lelli@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index fbfc3f1d368a..90b6e9df79b2 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -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);

                 reply	other threads:[~2018-07-03 16:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180703120301.3667f418@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=claudio@evidence.eu.com \
    --cc=juri.lelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=viresh.kumar@linaro.org \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®