From: Artem Savkov <artem.savkov@gmail.com>
To: paulmck@linux.vnet.ibm.com
Cc: linux-kernel@vger.kernel.org, Artem Savkov <artem.savkov@gmail.com>
Subject: [PATCH] rcuperf: Do not wake up shutdown wait queue if "shutdown" is false.
Date: Sun, 7 Feb 2016 13:31:39 +0100 [thread overview]
Message-ID: <1454848299-25194-1-git-send-email-artem.savkov@gmail.com> (raw)
After finishing it's 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 09ffa36..fb45a26 100644
--- a/kernel/rcu/rcuperf.c
+++ b/kernel/rcu/rcuperf.c
@@ -414,8 +414,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.7.0
next reply other threads:[~2016-02-07 12:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-07 12:31 Artem Savkov [this message]
2016-02-07 19:43 ` [PATCH] rcuperf: Do not wake up shutdown wait queue if "shutdown" is false Paul E. McKenney
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=1454848299-25194-1-git-send-email-artem.savkov@gmail.com \
--to=artem.savkov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).