lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Tue, 3 Jul 2018 12:03:01 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     LKML <linux-kernel@...r.kernel.org>
Cc:     Juri Lelli <juri.lelli@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Clark Williams <williams@...hat.com>,
        Claudio Scordino <claudio@...dence.eu.com>,
        Viresh Kumar <viresh.kumar@...aro.org>
Subject: [PATCH] sched/deadline: Add update_rq_clock(later_rq) in
 push_dl_task()

From: Steven Rostedt (VMware) <rostedt@...dmis.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@...il.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.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);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ