mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Peter Zijlstra <peterz@infradead.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH] mutex: enable spinning for DEBUG_MUTEX
Date: Thu, 19 Feb 2009 12:22:12 +0100	[thread overview]
Message-ID: <20090219112212.GQ2354@elte.hu> (raw)
In-Reply-To: <1234815510.30178.357.camel@laptop>


* Peter Zijlstra <peterz@infradead.org> wrote:

> Subject: mutex: enable spinning for DEBUG_MUTEX
> From: Johannes Weiner <hannes@cmpxchg.org>
> Date: Thu, 15 Jan 2009 15:57:38 +0100
> 
> Spinning with CONFIG_DEBUG_MUTEX is possible but care must be taken
> with the debug checks vs. racy access to the lock owner field.
> 
> In the case where the lock owner gets rescheduled after acquisition
> and therefor unlocks on another CPU, that second CPU might not see the
> write of the owner field from the first CPU and we warn about owner
> mismatch.  Thus the memory barriers for the debug case.
> 
> Also remove the redundant mutex_set_owner()s in __mutex_lock_common()
> and __mutex_trylock_slowpath(), it's taken care of in mutex_lock() and
> mutex_trylock().
> 
> [a.p.zijlstra@chello.nl: fix _nested variants]
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> ---
>  kernel/mutex-debug.c |    6 ++++++
>  kernel/mutex-debug.h |    6 ++++++
>  kernel/mutex.c       |   27 +++++++++++++++------------
>  3 files changed, 27 insertions(+), 12 deletions(-)

Applied to tip:core/locking, thanks Peter!

	Ingo

  reply	other threads:[~2009-02-19 11:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-16 20:18 Peter Zijlstra
2009-02-19 11:22 ` Ingo Molnar [this message]
2009-02-19 14:53   ` Ingo Molnar

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=20090219112212.GQ2354@elte.hu \
    --to=mingo@elte.hu \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome