From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Artem Savkov <artem.savkov@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rcuperf: Do not wake up shutdown wait queue if "shutdown" is false.
Date: Sun, 7 Feb 2016 11:43:02 -0800 [thread overview]
Message-ID: <20160207194302.GX6719@linux.vnet.ibm.com> (raw)
In-Reply-To: <1454848299-25194-1-git-send-email-artem.savkov@gmail.com>
On Sun, Feb 07, 2016 at 01:31:39PM +0100, Artem Savkov wrote:
> 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>
Good catch! Queued for testing and review.
Thanx, Paul
> ---
> 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
>
prev parent reply other threads:[~2016-02-07 19:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-07 12:31 [PATCH] rcuperf: Do not wake up shutdown wait queue if "shutdown" is false Artem Savkov
2016-02-07 19:43 ` Paul E. McKenney [this message]
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=20160207194302.GX6719@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=artem.savkov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.