From: Ingo Molnar <mingo@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Ingo Molnar <mingo@elte.hu>,
linux-kernel <linux-kernel@vger.kernel.org>,
Waiman Long <Waiman.Long@hp.com>
Subject: Re: [BUG][tip/master] kernel panic while locking selftest at qspinlock_paravirt.h:137!
Date: Sat, 11 Jul 2015 12:27:18 +0200 [thread overview]
Message-ID: <20150711102718.GA28523@gmail.com> (raw)
In-Reply-To: <20150710142824.GK19282@twins.programming.kicks-ass.net>
* Peter Zijlstra <peterz@infradead.org> wrote:
> On Fri, Jul 10, 2015 at 03:57:46PM +0200, Ingo Molnar wrote:
> > * Peter Zijlstra <peterz@infradead.org> wrote:
>
> > > Do we want to make double unlock non-fatal unconditionally?
> >
> > No, just don't BUG() out, don't crash the system - generate a warning?
>
> So that would be a yes..
>
> Something like so then? Won't this generate a splat on that locking self
> test then? And upset people?
>
> ---
> kernel/locking/qspinlock_paravirt.h | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/locking/qspinlock_paravirt.h b/kernel/locking/qspinlock_paravirt.h
> index 04ab18151cc8..286e8978a562 100644
> --- a/kernel/locking/qspinlock_paravirt.h
> +++ b/kernel/locking/qspinlock_paravirt.h
> @@ -133,8 +133,14 @@ static struct pv_node *pv_unhash(struct qspinlock *lock)
> * This guarantees a limited lookup time and is itself guaranteed by
> * having the lock owner do the unhash -- IFF the unlock sees the
> * SLOW flag, there MUST be a hash entry.
> + *
> + * This can trigger due to double-unlock. In which case, return a
> + * random pointer so that __pv_queued_spin_unlock() can dereference it
> + * without crashing.
> */
> - BUG();
> + WARN_ON_ONCE(true);
> +
> + return (struct pv_node *)this_cpu_ptr(&mcs_nodes[0]);
Yeah, just please also use debug_locks_silent to make the self-test execute
properly or so.
Thanks,
Ingo
prev parent reply other threads:[~2015-07-11 10:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-10 11:32 [BUG][tip/master] kernel panic while locking selftest at qspinlock_paravirt.h:137! Masami Hiramatsu
2015-07-10 13:00 ` Peter Zijlstra
2015-07-10 13:57 ` Ingo Molnar
2015-07-10 14:28 ` Peter Zijlstra
2015-07-11 0:32 ` Masami Hiramatsu
2015-07-11 1:27 ` Waiman Long
2015-07-11 5:05 ` Masami Hiramatsu
2015-07-12 3:09 ` Waiman Long
2015-07-11 10:22 ` Peter Zijlstra
2015-07-11 10:27 ` Ingo Molnar [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=20150711102718.GA28523@gmail.com \
--to=mingo@kernel.org \
--cc=Waiman.Long@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@elte.hu \
--cc=peterz@infradead.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.