From: Thomas Gleixner <tglx@linutronix.de>
To: Zhu Jefferry <Jefferry.Zhu@freescale.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"bigeasy@linutronix.de" <bigeasy@linutronix.de>
Subject: RE: [PATCH v2] futex: lower the lock contention on the HB lock during wake up
Date: Wed, 16 Sep 2015 15:39:09 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.11.1509161458340.3951@nanos> (raw)
In-Reply-To: <BN3PR0301MB1219AFB4E1A190B67641A363835B0@BN3PR0301MB1219.namprd03.prod.outlook.com>
On Wed, 16 Sep 2015, Zhu Jefferry wrote:
> > > The primary debugging shows the content of __lock is wrong in first.
> > > After a call of Mutex_unlock, the value of __lock should not be this
> > > thread self. But we observed The value of __lock is still self after
> > > unlock. So, other threads will be stuck,
> >
> > How did you observe that?
>
> Add one assert in mutex_unlock, after it finish the __lock modify either in
> User space or kernel space, before return.
And that assert tells you that the kernel screwed up the futex value?
No, it does not. It merily tells you that the value is not what you
expect, but it does not tell you what caused that.
Hint: There are proper instrumentation tools, e.g. tracing, which tell
you the exact flow of events and not just the observation after the
fact.
> > > This thread could lock due to recursive type and __counter keep
> > > increasing, although mutex_unlock return fails, due to the wrong value
> > > of __owner, but the application did not check the return value. So the
> > > thread 0 looks like fine. But thread 1 will be stuck forever.
> >
> > Oh well. So thread 0 looks all fine, despite not checking return values.
> >
>
> Correct.
No. That's absolutely NOT correct. Not checking return values can
cause all kind of corruptions. Return values are there for a reason.
> Actually, I'm not clear how about the state changing of futex in kernel.
> I search the Internet, see a similar failure from other users. He is using
> Kernel 2.6.38. Our customer is using kernel 2.6.34 (WindRiver Linux 4.1)
So your customer should talk to WindRiver about this. I have no idea
what kind of patches WindRiver has in their kernel and I really don't
want to know it.
If you can reproduce that issue against a recent mainline kernel, then
I'm happy to analyze that.
> ====
> http://www.programdoc.com/1272_157986_1.htm
Your supply of weird web pages seems to be infinite.
> But I can not understand the sample failure case which he mentioned. But I think
> It might be helpful for you to analyze the corner case.
No, it's absolutely NOT helpful because it's just random guesswork as
the flow he is describing is just not possible. That guy never showed
his test case, so I have no idea how he can 'proof' his theory.
Thanks,
tglx
next prev parent reply other threads:[~2015-09-16 13:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-15 1:26 Zhu Jefferry
2015-09-16 0:01 ` Thomas Gleixner
2015-09-16 0:17 ` Zhu Jefferry
2015-09-16 8:06 ` Thomas Gleixner
2015-09-16 9:52 ` Zhu Jefferry
2015-09-16 10:22 ` Thomas Gleixner
2015-09-16 11:13 ` Zhu Jefferry
2015-09-16 13:39 ` Thomas Gleixner [this message]
2015-09-16 23:57 ` Zhu Jefferry
2015-09-17 7:08 ` Thomas Gleixner
-- strict thread matches above, loose matches on Subject: below --
2015-05-19 17:24 [PATCH -tip 0/4] rtmutex: Spin on owner Davidlohr Bueso
2015-05-19 17:24 ` [PATCH 1/4] locking/rtmutex: Implement lockless top-waiter wakeup Davidlohr Bueso
2015-06-16 19:29 ` [PATCH] futex: lower the lock contention on the HB lock during wake up Sebastian Andrzej Siewior
2015-06-16 19:50 ` Davidlohr Bueso
2015-06-17 8:33 ` [PATCH v2] " Sebastian Andrzej Siewior
2015-06-17 14:17 ` Mike Galbraith
2015-06-17 14:28 ` Sebastian Andrzej Siewior
2015-06-17 14:31 ` Mike Galbraith
2015-06-21 4:35 ` Mike Galbraith
2015-06-19 17:51 ` Kevin Hilman
2015-06-19 18:54 ` Thomas Gleixner
2015-06-19 19:32 ` Kevin Hilman
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=alpine.DEB.2.11.1509161458340.3951@nanos \
--to=tglx@linutronix.de \
--cc=Jefferry.Zhu@freescale.com \
--cc=bigeasy@linutronix.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®