Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Dmitry Adamushko
2009/1/14 Chris Mason chris.ma...@oracle.com: On Tue, 2009-01-13 at 18:21 +0100, Peter Zijlstra wrote: On Tue, 2009-01-13 at 08:49 -0800, Linus Torvalds wrote: So do a v10, and ask people to test. --- Subject: mutex: implement adaptive spinning From: Peter Zijlstra a.p.zijls...@chello.nl

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Ingo Molnar
* Chris Mason chris.ma...@oracle.com wrote: v10 is better that not spinning, but its in the 5-10% range. So, I've been trying to find ways to close the gap, just to understand exactly where it is different. If I take out: /* * If there are pending waiters, join them.

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Linus Torvalds
On Wed, 14 Jan 2009, Ingo Molnar wrote: * Chris Mason chris.ma...@oracle.com wrote: v10 is better that not spinning, but its in the 5-10% range. So, I've been trying to find ways to close the gap, just to understand exactly where it is different. If I take out: /*

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Chris Mason
On Wed, 2009-01-14 at 07:43 -0800, Linus Torvalds wrote: On Wed, 14 Jan 2009, Ingo Molnar wrote: * Chris Mason chris.ma...@oracle.com wrote: v10 is better that not spinning, but its in the 5-10% range. So, I've been trying to find ways to close the gap, just to understand

Re: [PATCH -v8][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Peter Zijlstra
On Mon, 2009-01-12 at 19:32 +0200, Avi Kivity wrote: Peter Zijlstra wrote: Spinlocks can use 'pure' MCS locks. How about this, then. In mutex_lock(), keep wait_lock locked and only release it when scheduling out. Waiter spinning naturally follows. If spinlocks are cache friendly

[PATCH -v11][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Peter Zijlstra
Full series, including changelogs available at: http://programming.kicks-ass.net/kernel-patches/mutex-adaptive-spin/ and should shortly appear in a git tree near Ingo :-) mutex: small cleanup mutex: preemption fixes mutex: implement adaptive spinning mutex: set owner in mutex_lock() only

[PATCH -v11 delta] mutex: implement adaptive spinning

2009-01-14 Thread Ingo Molnar
* Linus Torvalds torva...@linux-foundation.org wrote: If I take out: /* * If there are pending waiters, join them. */ if (!list_empty(lock-wait_list)) break; v10 pops dbench 50 up to 1800MB/s. The other tests soundly beat my spinning and

Re: [PATCH -v11][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Peter Zijlstra
On Wed, 2009-01-14 at 18:18 +0100, Nick Piggin wrote: @@ -173,21 +237,21 @@ __mutex_lock_common(struct mutex *lock, spin_unlock_mutex(lock-wait_lock, flags); debug_mutex_free_waiter(waiter); + preempt_enable();

Re: [PATCH -v8][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Avi Kivity
Nick Piggin wrote: (no they're not, Nick's ticket locks still spin on a shared cacheline IIRC -- the MCS locks mentioned could fix this) It reminds me. I wrote a basic variation of MCS spinlocks a while back. And converted dcache lock to use it, which showed large dbench improvements on a

Re: [PATCH -v9][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Dmitry Adamushko
2009/1/14 Chris Mason chris.ma...@oracle.com: On Wed, 2009-01-14 at 12:18 +0100, Dmitry Adamushko wrote: 2009/1/14 Chris Mason chris.ma...@oracle.com: On Tue, 2009-01-13 at 18:21 +0100, Peter Zijlstra wrote: On Tue, 2009-01-13 at 08:49 -0800, Linus Torvalds wrote: So do a v10, and ask

[GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Peter Zijlstra pet...@infradead.org wrote: Full series, including changelogs available at: http://programming.kicks-ass.net/kernel-patches/mutex-adaptive-spin/ and should shortly appear in a git tree near Ingo :-) Linus, Please pull the adaptive-mutexes-for-linus git tree from:

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Chris Mason
On Wed, 2009-01-14 at 19:33 +0100, Ingo Molnar wrote: * Peter Zijlstra pet...@infradead.org wrote: Full series, including changelogs available at: http://programming.kicks-ass.net/kernel-patches/mutex-adaptive-spin/ and should shortly appear in a git tree near Ingo :-) Linus,

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Ingo Molnar mi...@elte.hu wrote: Linus, Please pull the adaptive-mutexes-for-linus git tree from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git adaptive-mutexes-for-linus We dropped two fresh patches from v11 for the time being: the two debug patches,

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Peter Zijlstra a.p.zijls...@chello.nl wrote: On Wed, 2009-01-14 at 10:53 -0800, Andrew Morton wrote: On Wed, 14 Jan 2009 19:33:19 +0100 Ingo Molnar mi...@elte.hu wrote: Please pull the adaptive-mutexes-for-linus git tree fear - It seems a major shortcoming that the feature

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Peter Zijlstra
On Wed, 2009-01-14 at 11:36 -0800, Andrew Morton wrote: Do people enable CONFIG_SCHED_DEBUG? Well, I have it always enabled, but I've honestly no idea if that makes me weird. CONFIG_DEBUG_MUTEXES=n, CONFIG_SCHED_DEBUG=y is getting to be a pretty small subset? Could be, do you fancy me doing

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Andrew Morton a...@linux-foundation.org wrote: On Wed, 14 Jan 2009 20:00:08 +0100 Ingo Molnar mi...@elte.hu wrote: * Andrew Morton a...@linux-foundation.org wrote: On Wed, 14 Jan 2009 19:33:19 +0100 Ingo Molnar mi...@elte.hu wrote: Please pull the

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Peter Zijlstra a.p.zijls...@chello.nl wrote: On Wed, 2009-01-14 at 11:36 -0800, Andrew Morton wrote: Do people enable CONFIG_SCHED_DEBUG? Well, I have it always enabled, but I've honestly no idea if that makes me weird. CONFIG_DEBUG_MUTEXES=n, CONFIG_SCHED_DEBUG=y is getting to be

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Andrew Morton
On Wed, 14 Jan 2009 21:14:35 +0100 Ingo Molnar mi...@elte.hu wrote: * Andrew Morton a...@linux-foundation.org wrote: On Wed, 14 Jan 2009 20:00:08 +0100 Ingo Molnar mi...@elte.hu wrote: * Andrew Morton a...@linux-foundation.org wrote: On Wed, 14 Jan 2009 19:33:19 +0100

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Andrew Morton
On Wed, 14 Jan 2009 21:27:36 +0100 Ingo Molnar mi...@elte.hu wrote: * Peter Zijlstra a.p.zijls...@chello.nl wrote: On Wed, 2009-01-14 at 11:36 -0800, Andrew Morton wrote: Do people enable CONFIG_SCHED_DEBUG? Well, I have it always enabled, but I've honestly no idea if that makes

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Andrew Morton a...@linux-foundation.org wrote: Do people enable CONFIG_SCHED_DEBUG? If they suspect performance problems and want to analyze them? The vast majority of users do not and usually cannot compile their own kernels. ... which they derive from distro kernels or some old

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Andrew Morton
On Wed, 14 Jan 2009 21:51:22 +0100 Ingo Molnar mi...@elte.hu wrote: * Andrew Morton a...@linux-foundation.org wrote: Do people enable CONFIG_SCHED_DEBUG? If they suspect performance problems and want to analyze them? The vast majority of users do not and usually cannot

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Andrew Morton
On Wed, 14 Jan 2009 22:14:58 +0100 Ingo Molnar mi...@elte.hu wrote: * Andrew Morton a...@linux-foundation.org wrote: On Wed, 14 Jan 2009 21:51:22 +0100 Ingo Molnar mi...@elte.hu wrote: * Andrew Morton a...@linux-foundation.org wrote: Do people enable

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Ingo Molnar mi...@elte.hu wrote: You just disproved your own case :( how so? 80% is not enough? I also checked Fedora and it has SCHED_DEBUG=y in its kernel rpms. Ubuntu has CONFIG_SCHED_DEBUG=y as well in their kernels. note that there's also a performance issue here: we generally

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Kay Sievers
On Wed, Jan 14, 2009 at 22:41, Ingo Molnar mi...@elte.hu wrote: * Ingo Molnar mi...@elte.hu wrote: You just disproved your own case :( how so? 80% is not enough? I also checked Fedora and it has SCHED_DEBUG=y in its kernel rpms. Ubuntu has CONFIG_SCHED_DEBUG=y as well in their kernels.

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Kay Sievers kay.siev...@vrfy.org wrote: On Wed, Jan 14, 2009 at 22:41, Ingo Molnar mi...@elte.hu wrote: * Ingo Molnar mi...@elte.hu wrote: You just disproved your own case :( how so? 80% is not enough? I also checked Fedora and it has SCHED_DEBUG=y in its kernel rpms.

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Andrew Morton a...@linux-foundation.org wrote: I also checked Fedora and it has SCHED_DEBUG=y in its kernel rpms. If all distros set SCHED_DEBUG=y then fine. 95% of the distros and significant majority of the lkml traffic. And no, we dont generally dont provide knobs for essential

Re: [PATCH -v11][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Nick Piggin
On Wed, Jan 14, 2009 at 06:22:36PM +0100, Peter Zijlstra wrote: On Wed, 2009-01-14 at 18:18 +0100, Nick Piggin wrote: @@ -173,21 +237,21 @@ __mutex_lock_common(struct mutex *lock, spin_unlock_mutex(lock-wait_lock, flags);

Re: [PATCH -v8][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Nick Piggin
On Wed, Jan 14, 2009 at 07:23:12PM +0200, Avi Kivity wrote: Nick Piggin wrote: (no they're not, Nick's ticket locks still spin on a shared cacheline IIRC -- the MCS locks mentioned could fix this) It reminds me. I wrote a basic variation of MCS spinlocks a while back. And converted

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Nick Piggin
On Wed, Jan 14, 2009 at 01:35:29PM -0800, Andrew Morton wrote: You're taking a whizzy new feature which drastically changes a critical core kernel feature and jamming it into mainline with a vestigial amount of testing coverage without giving sufficient care and thought to the practical

Re: Warning and BUG with btrfs and corrupted image

2009-01-14 Thread Chris Mason
On Tue, 2009-01-13 at 15:43 +0100, Eric Sesterhenn wrote: * Chris Mason (chris.ma...@oracle.com) wrote: On Tue, 2009-01-13 at 15:21 +0100, Eric Sesterhenn wrote: Hi, when mounting an intentionally corrupted btrfs filesystem i get the following warning and bug message. The image can

Re: [btrfs-progs 1/4] Add man/mkfs.btrfs.8.in

2009-01-14 Thread Chris Mason
On Tue, 2009-01-13 at 18:18 +0530, Goldwyn Rodrigues wrote: Add man/mkfs.btrfs.8.in Kept the name with the name in, so that further processing such as BUILD_DATE BUILD_VERSION etc. could be included later. All man pages included in the man directory to avoid file cluttering. Thanks for

[PATCH] BTRFS: Mark '__init' for btrfs_init_cachep, btrfs_init_sysfs,btrfs_interface_init

2009-01-14 Thread Qinghuang Feng
There functions are only called by 'static int __init init_btrfs_fs(void)', so also mark them as '__init'. Signed-off-by: Qinghuang Feng qhfeng.ker...@gmail.com --- diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index eee060f..7e03ec8 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@

Re: [PATCH -v11][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Peter Zijlstra
On Thu, 2009-01-15 at 01:46 +0100, Nick Piggin wrote: Hmm, well this is rather a slow path, I would say. I'd prefer not to modify schedule in this way (if we just get scheduled back on after being switched away, the subsequent call to schedule is going to be cache hot and not do too much

Re: [PATCH -v11][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Nick Piggin
On Thu, Jan 15, 2009 at 08:44:03AM +0100, Peter Zijlstra wrote: On Thu, 2009-01-15 at 01:46 +0100, Nick Piggin wrote: Hmm, well this is rather a slow path, I would say. I'd prefer not to modify schedule in this way (if we just get scheduled back on after being switched away, the