From: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
To: Nick Piggin <npiggin@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andi Kleen <ak@suse.de>, Ingo Molnar <mingo@elte.hu>,
riel <riel@redhat.com>
Subject: Re: [patch 1/4] spinlock: lockbreak cleanup
Date: Thu, 01 Nov 2007 11:39:59 -0400 [thread overview]
Message-ID: <1193931599.5300.40.camel@localhost> (raw)
In-Reply-To: <20071101142932.GB2648@wotan.suse.de>
On Thu, 2007-11-01 at 15:29 +0100, Nick Piggin wrote:
> On Thu, Nov 01, 2007 at 03:06:05PM +0100, Peter Zijlstra wrote:
> > On Thu, 2007-11-01 at 15:02 +0100, Nick Piggin wrote:
> >
> > > Rename need_lockbreak to spin_needbreak, make it use spin_is_contended to
> > > decouple it from the spinlock implementation, and make it typesafe (rwlocks
> > > do not have any need_lockbreak sites -- why do they even get bloated up
> > > with that break_lock then?).
> >
> > IIRC Lee has a few patches floating about that do introduce lockbreak
> > stuff for rwlocks.
>
> Well that would be a good reason to introduce a break_lock for them,
> but previously not so much... we have rwlocks in some slightly space
> critical structures (vmas, inodes, etc).
>
> I guess it was done to make the "template" hacks eaiser. I don't really
> find that in good taste, especially for important core infrastructure.
> Anyway.
Actually, what I had/have is a cond_resched_rwlock() that I needed to
convert the i_mmap_lock() to rw for testing reclaim scalability. [I've
seen a large system running an Oracle OLTP load hang spitting "cpu soft
lockup" messages with all cpus spinning on a i_mmap_lock spin lock.]
One of the i_mmap_lock paths uses cond_resched_lock() for spin locks.
To do a straight forward conversion [and maybe that isn't the right
approach], I created the cond_resched_rwlock() function by generalizing
the cond_sched_lock() code and creating both spin and rw lock wrappers.
I took advantage of the fact that, currently, need_lockbreak() is a
macro and that both spin and rw locks have/had the break_lock member.
Typesafe functions would probably be preferrable, if we want to keep
break_lock for rw spin locks.
Here's the most recent posting:
http://marc.info/?l=linux-mm&m=118980356306014&w=4
See the changes to sched.[ch]. Should apply to 23-mm1 with offsets and
minor fixup in fs/inode.c.
Lee
next prev parent reply other threads:[~2007-11-01 15:40 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-01 14:01 [patch 0/4] ticket spinlocks for x86 Nick Piggin
2007-11-01 14:02 ` [patch 1/4] spinlock: lockbreak cleanup Nick Piggin
2007-11-01 14:06 ` Peter Zijlstra
2007-11-01 14:29 ` Nick Piggin
2007-11-01 15:39 ` Lee Schermerhorn [this message]
2007-11-01 15:46 ` Ingo Molnar
2007-11-01 15:53 ` Nick Piggin
2007-11-01 14:03 ` [patch 1/4] x86: FIFO ticket spinlocks Nick Piggin
2007-11-01 14:40 ` Gregory Haskins
2007-11-01 16:38 ` Linus Torvalds
2007-11-02 0:35 ` Rik van Riel
2007-11-02 1:19 ` Linus Torvalds
2007-11-02 2:01 ` Rik van Riel
2007-11-02 6:42 ` Nick Piggin
2007-11-02 14:05 ` Rik van Riel
2007-11-02 22:37 ` Nick Piggin
2007-11-02 15:33 ` Ingo Molnar
2007-11-07 8:46 ` Nick Piggin
2007-11-02 14:24 ` Gregory Haskins
2007-11-01 20:01 ` Chuck Ebbert
2007-11-02 0:00 ` Nick Piggin
2007-11-02 16:22 ` Chuck Ebbert
2007-11-02 16:51 ` Linus Torvalds
2007-11-02 23:01 ` Nick Piggin
2007-11-03 0:56 ` Chuck Ebbert
2007-11-03 3:41 ` Nick Piggin
2007-11-01 14:04 ` [patch 3/4] x86: spinlock.h merge prep Nick Piggin
2007-11-01 14:05 ` [patch 4/4] x86: spinlock.h merge Nick Piggin
2007-11-03 22:36 ` [patch 0/4] ticket spinlocks for x86 Jeremy Fitzhardinge
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=1193931599.5300.40.camel@localhost \
--to=lee.schermerhorn@hp.com \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=npiggin@suse.de \
--cc=peterz@infradead.org \
--cc=riel@redhat.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