public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Tony Breeds <tonyb@au1.ibm.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH/RFC] mutex: Fix optimistic spinning vs. BKL
Date: Wed, 28 Apr 2010 14:06:03 +0200	[thread overview]
Message-ID: <201004281406.04080.arnd@arndb.de> (raw)
In-Reply-To: <1272429513.24542.83.camel@pasglop>

On Wednesday 28 April 2010, Benjamin Herrenschmidt wrote:
> Now, we -could- make it a bit smarter about the BKL by introducing a
> contention counter and only go out if we own the BKL and it is contended,
> but I didn't feel like this was worth the effort, time is better spent
> removing the BKL from sensitive code path instead.

Agreed.

> -       for (;;) {
> +       for (timeout = jiffies + 2; jiffies < timeout;) {
> [...]
> -       for (;;) {
> +       while (jiffies < timeout) {

This needs to use time_before() to avoid problems on jiffies wraparound.

	Arnd

  parent reply	other threads:[~2010-04-28 12:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-28  4:38 [PATCH/RFC] mutex: Fix optimistic spinning vs. BKL Benjamin Herrenschmidt
2010-04-28  4:39 ` Benjamin Herrenschmidt
2010-04-28 12:06 ` Arnd Bergmann [this message]
2010-04-28 22:35   ` Benjamin Herrenschmidt
2010-05-07  4:20     ` Tony Breeds
2010-05-07  5:30       ` Frederic Weisbecker
2010-05-07  6:01         ` Benjamin Herrenschmidt
2010-05-07 21:29           ` Frederic Weisbecker
2010-05-07 22:27             ` Benjamin Herrenschmidt
2010-05-10  7:55               ` Peter Zijlstra
2010-05-11 18:06                 ` Linus Torvalds
2010-05-11 18:19                   ` Peter Zijlstra
2010-05-11 21:13                   ` Benjamin Herrenschmidt
2010-05-07  6:16         ` Mike Galbraith
2010-05-11 15:43       ` [tip:core/locking] " tip-bot for Tony Breeds
2010-05-11 23:05         ` Tony Breeds
2010-05-18 16:08         ` Ingo Molnar
2010-05-18 16:26           ` Linus Torvalds
2010-05-19  5:46           ` Tony Breeds
2010-05-19  7:56             ` [tip:core/urgent] " tip-bot for Tony Breeds

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=201004281406.04080.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tonyb@au1.ibm.com \
    --cc=torvalds@linux-foundation.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