lkml.org 
[lkml]   [2016]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH tip/core/rcu 14/24] rcuperf: Do not wake up shutdown wait queue if "shutdown" is false.
Date
From: Artem Savkov <artem.savkov@gmail.com>

After finishing its tests rcuperf tries to wake up shutdown_wq even if
"shutdown" param is set to false, resulting in a wake_up() call on an
unitialized wait_queue_head_t which leads to "BUG: spinlock bad magic" and
"BUG: unable to handle kernel NULL pointer dereference".

Fix by checking "shutdown" param before waking up the queue.

Signed-off-by: Artem Savkov <artem.savkov@gmail.com>
---
kernel/rcu/rcuperf.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c
index 4c0572859ff0..3cee0d8393ed 100644
--- a/kernel/rcu/rcuperf.c
+++ b/kernel/rcu/rcuperf.c
@@ -423,8 +423,10 @@ rcu_perf_writer(void *arg)
b_rcu_perf_writer_finished =
cur_ops->completed();
}
- smp_mb(); /* Assign before wake. */
- wake_up(&shutdown_wq);
+ if (shutdown) {
+ smp_mb(); /* Assign before wake. */
+ wake_up(&shutdown_wq);
+ }
}
}
if (done && !alldone &&
--
2.5.2
\
 
 \ /
  Last update: 2016-04-12 18:02    [W:0.096 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site