From: Ingo Molnar <mingo@elte.hu>
To: Kyle McMartin <kyle@infradead.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
ralf@linux-mips.org, mingo@redhat.com
Subject: Re: x86: spinlocks: define dummy __raw_spin_is_contended
Date: Mon, 9 Feb 2009 10:22:21 +0100 [thread overview]
Message-ID: <20090209092221.GG31890@elte.hu> (raw)
In-Reply-To: <20090208223958.GA19888@bombadil.infradead.org>
* Kyle McMartin <kyle@infradead.org> wrote:
> CC-ing Linus, since he just released 2.6.29-rc4, which will fail to
> build btrfs on anything besides mips or x86.
Hm, i'm not particularly fond of the spin_is_contended() trickery done in:
/*
* btrfs_search_slot uses this to decide if it should drop its locks
* before doing something expensive like allocating free blocks for cow.
*/
int btrfs_path_lock_waiting(struct btrfs_path *path, int level)
{
int i;
struct extent_buffer *eb;
for (i = level; i <= level + 1 && i < BTRFS_MAX_LEVEL; i++) {
eb = path->nodes[i];
if (!eb)
break;
smp_mb();
if (spin_is_contended(&eb->lock) ||
waitqueue_active(&eb->lock_wq))
return 1;
}
return 0;
}
It does not look particularly cheap either, if the number of levels is high.
I'd suggest we remove that hack please and live or die by what performance
the generic locking code gives us - and fix it when it causes problems,
instead of working it around locally?
As spin-mutexes have shown (queued up for .30), working on that level is far
more rewarding in terms of improving Linux as a whole.
Ingo
next prev parent reply other threads:[~2009-02-09 9:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-08 18:03 x86: spinlocks: define dummy __raw_spin_is_contended Kyle McMartin
2009-02-08 22:39 ` Kyle McMartin
2009-02-09 9:22 ` Ingo Molnar [this message]
2009-02-09 9:44 ` Ingo Molnar
2009-02-08 23:51 ` Ralf Baechle
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=20090209092221.GG31890@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=kyle@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=ralf@linux-mips.org \
--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