From: Matthias Bonne <lemonlime51@gmail.com>
To: Rabin Vincent <rabin@rab.in>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
Yann Droneaud <ydroneaud@opteya.com>,
kernelnewbies@kernelnewbies.org, linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: Question on mutex code
Date: Mon, 16 Mar 2015 05:40:15 +0200 [thread overview]
Message-ID: <5506509F.1040108@gmail.com> (raw)
In-Reply-To: <20150315221018.GA25881@debian>
On 03/16/15 00:10, Rabin Vincent wrote:
> On Sun, Mar 15, 2015 at 11:49:07PM +0200, Matthias Bonne wrote:
>> So the counter is set to 1 before taking the spinlock, which I think
>> might cause the race. Did I miss something?
>
> Yes, you miss the fact that __mutex_slowpath_needs_to_unlock() is 0 for
> the CONFIG_DEBUG_MUTEXES case:
>
> #ifdef CONFIG_DEBUG_MUTEXES
> # include "mutex-debug.h"
> # include <asm-generic/mutex-null.h>
> /*
> * Must be 0 for the debug case so we do not do the unlock outside of the
> * wait_lock region. debug_mutex_unlock() will do the actual unlock in this
> * case.
> */
> # undef __mutex_slowpath_needs_to_unlock
> # define __mutex_slowpath_needs_to_unlock() 0
>
Right, I overlooked this part. Thanks to both of you for the
clarifications.
next prev parent reply other threads:[~2015-03-16 3:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <54F64E10.7050801@gmail.com>
2015-03-10 13:03 ` Question on mutex code Yann Droneaud
2015-03-10 14:59 ` Valdis.Kletnieks
2015-03-14 23:08 ` Matthias Bonne
2015-03-14 23:05 ` Matthias Bonne
2015-03-15 1:03 ` Davidlohr Bueso
2015-03-15 1:09 ` Davidlohr Bueso
2015-03-15 21:49 ` Matthias Bonne
2015-03-15 22:10 ` Rabin Vincent
2015-03-16 3:40 ` Matthias Bonne [this message]
2015-03-15 22:18 ` Davidlohr Bueso
2015-03-15 22:23 ` Davidlohr Bueso
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=5506509F.1040108@gmail.com \
--to=lemonlime51@gmail.com \
--cc=dave@stgolabs.net \
--cc=kernelnewbies@kernelnewbies.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rabin@rab.in \
--cc=ydroneaud@opteya.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