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 su

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 w

[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 --- 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 @@ -2045,7 +2045,7 @@ int btrfs

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 f

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.

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 les

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

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); > > > > > > debug_m

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Andrew Morton 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 performance features

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Kay Sievers wrote: > On Wed, Jan 14, 2009 at 22:41, Ingo Molnar wrote: > > > > * Ingo Molnar 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_DEBU

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Kay Sievers
On Wed, Jan 14, 2009 at 22:41, Ingo Molnar wrote: > > * Ingo Molnar 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. $ cat /etc/Su

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Ingo Molnar 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 _dont >

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Andrew Morton
On Wed, 14 Jan 2009 22:14:58 +0100 Ingo Molnar wrote: > > * Andrew Morton wrote: > > > On Wed, 14 Jan 2009 21:51:22 +0100 > > Ingo Molnar wrote: > > > > > > > > * Andrew Morton wrote: > > > > > > > > > Do people enable CONFIG_SCHED_DEBUG? > > > > > > > > > > If they suspect performance p

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Andrew Morton wrote: > On Wed, 14 Jan 2009 21:51:22 +0100 > Ingo Molnar wrote: > > > > > * Andrew Morton wrote: > > > > > > > Do people enable CONFIG_SCHED_DEBUG? > > > > > > > > If they suspect performance problems and want to analyze them? > > > > > > The vast majority of users do not

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Andrew Morton
On Wed, 14 Jan 2009 21:51:22 +0100 Ingo Molnar wrote: > > * Andrew Morton 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 > > kerne

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Andrew Morton 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 .config they al

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Andrew Morton
On Wed, 14 Jan 2009 21:27:36 +0100 Ingo Molnar wrote: > > * Peter Zijlstra 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. > > >

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Andrew Morton
On Wed, 14 Jan 2009 21:14:35 +0100 Ingo Molnar wrote: > > * Andrew Morton wrote: > > > On Wed, 14 Jan 2009 20:00:08 +0100 > > Ingo Molnar wrote: > > > > > > > > * Andrew Morton wrote: > > > > > > > On Wed, 14 Jan 2009 19:33:19 +0100 Ingo Molnar wrote: > > > > > > > > > Please pull the a

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Peter Zijlstra 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 a pretty >

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Andrew Morton
On Wed, 14 Jan 2009 20:50:50 +0100 Peter Zijlstra 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. It'd be weird if you're not weird. > > CONFIG_D

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Andrew Morton wrote: > On Wed, 14 Jan 2009 20:00:08 +0100 > Ingo Molnar wrote: > > > > > * Andrew Morton wrote: > > > > > On Wed, 14 Jan 2009 19:33:19 +0100 Ingo Molnar wrote: > > > > > > > Please pull the adaptive-mutexes-for-linus git tree > > > > > > > > > > > > - It seems a major

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 doi

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Andrew Morton
On Wed, 14 Jan 2009 20:00:08 +0100 Ingo Molnar wrote: > > * Andrew Morton wrote: > > > On Wed, 14 Jan 2009 19:33:19 +0100 Ingo Molnar wrote: > > > > > Please pull the adaptive-mutexes-for-linus git tree > > > > > > > > - It seems a major shortcoming that the feature is disabled if > > C

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Peter Zijlstra wrote: > On Wed, 2009-01-14 at 10:53 -0800, Andrew Morton wrote: > > On Wed, 14 Jan 2009 19:33:19 +0100 Ingo Molnar wrote: > > > > > Please pull the adaptive-mutexes-for-linus git tree > > > > > > > > - It seems a major shortcoming that the feature is disabled if > > CONF

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Ingo Molnar wrote: > Latest performance figures, on a 2-socket 16-way Nehalem test-system, > running the code above, measured via "test-mutex V 128 10" VFS > creat+unlink scalability test on tmpfs and ext3: > > no-spin spin > > [tmpfs]avg ops/se

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Peter Zijlstra
On Wed, 2009-01-14 at 10:53 -0800, Andrew Morton wrote: > On Wed, 14 Jan 2009 19:33:19 +0100 Ingo Molnar wrote: > > > Please pull the adaptive-mutexes-for-linus git tree > > > > - It seems a major shortcoming that the feature is disabled if > CONFIG_DEBUG_MUTEXES=y. It means that lots of pe

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Andrew Morton wrote: > On Wed, 14 Jan 2009 19:33:19 +0100 Ingo Molnar wrote: > > > Please pull the adaptive-mutexes-for-linus git tree > > > > - It seems a major shortcoming that the feature is disabled if > CONFIG_DEBUG_MUTEXES=y. It means that lots of people won't test it. > > - Whe

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Andrew Morton
On Wed, 14 Jan 2009 19:33:19 +0100 Ingo Molnar wrote: > Please pull the adaptive-mutexes-for-linus git tree - It seems a major shortcoming that the feature is disabled if CONFIG_DEBUG_MUTEXES=y. It means that lots of people won't test it. - When people hit performance/latency oddities, it

Re: [GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Ingo Molnar 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, they had

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 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, > > Plea

[GIT PULL] adaptive spinning mutexes

2009-01-14 Thread Ingo Molnar
* Peter Zijlstra 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: git://git.kernel.

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

2009-01-14 Thread Dmitry Adamushko
2009/1/14 Chris Mason : > On Wed, 2009-01-14 at 12:18 +0100, Dmitry Adamushko wrote: >> 2009/1/14 Chris Mason : >> > 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. >> >> >>

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 -v11][RFC] mutex: implement adaptive spinning

2009-01-14 Thread Nick Piggin
On Wed, Jan 14, 2009 at 06:00:36PM +0100, Peter Zijlstra 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 is going to take a wholesale conversion of m

[PATCH -v11 delta] mutex: implement adaptive spinning

2009-01-14 Thread Ingo Molnar
* Linus Torvalds 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 ar

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

2009-01-14 Thread Nick Piggin
On Wed, Jan 14, 2009 at 05:46:39PM +0100, Peter Zijlstra wrote: > 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 sc

[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 m

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

2009-01-14 Thread Chris Mason
On Wed, 2009-01-14 at 12:18 +0100, Dmitry Adamushko wrote: > 2009/1/14 Chris Mason : > > 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: imple

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 f

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 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 > >

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

2009-01-14 Thread Linus Torvalds
On Wed, 14 Jan 2009, Ingo Molnar wrote: > > * Chris Mason 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

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

2009-01-14 Thread Ingo Molnar
* Chris Mason 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 Dmitry Adamushko
2009/1/14 Chris Mason : > 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 >> Date: Mon Jan 12 14:01:4