Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-19 Thread Michel Lespinasse
On Mon, Mar 18, 2013 at 6:17 PM, Dave Chinner wrote: > On Wed, Mar 13, 2013 at 10:00:51PM -0400, Peter Hurley wrote: >> On Wed, 2013-03-13 at 14:23 +1100, Dave Chinner wrote: >> > We don't care about the ordering between multiple concurrent >> > metadata modifications - what matters is whether the

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-18 Thread Dave Chinner
On Wed, Mar 13, 2013 at 10:00:51PM -0400, Peter Hurley wrote: > On Wed, 2013-03-13 at 14:23 +1100, Dave Chinner wrote: > > We don't care about the ordering between multiple concurrent > > metadata modifications - what matters is whether the ongoing data IO > > around them is ordered correctly. > >

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-14 Thread Michel Lespinasse
On Thu, Mar 14, 2013 at 4:39 AM, Peter Hurley wrote: > On Thu, 2013-03-14 at 00:03 -0700, Michel Lespinasse wrote: >> > CPU 0 | CPU 1 >> > | >> > | down_write() >> > >> > ... CPU 1 has the

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-14 Thread Peter Hurley
On Thu, 2013-03-14 at 00:03 -0700, Michel Lespinasse wrote: > On Mon, Mar 11, 2013 at 04:36:47PM -0400, Peter Hurley wrote: > > > > On Wed, 2013-03-06 at 15:21 -0800, Michel Lespinasse wrote: > > > + retry_reader_grants: > > > + oldcount = rwsem_atomic_update(adjustment, sem) - adjustment; > > > +

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-14 Thread Michel Lespinasse
On Mon, Mar 11, 2013 at 04:36:47PM -0400, Peter Hurley wrote: > > On Wed, 2013-03-06 at 15:21 -0800, Michel Lespinasse wrote: > > + retry_reader_grants: > > + oldcount = rwsem_atomic_update(adjustment, sem) - adjustment; > > + if (unlikely(oldcount < RWSEM_WAITING_BIAS)) { > > + /* A

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-13 Thread Peter Hurley
On Wed, 2013-03-13 at 14:23 +1100, Dave Chinner wrote: > On Mon, Mar 11, 2013 at 11:43:34PM -0700, Michel Lespinasse wrote: > > Hi Dave, > > > > On Mon, Mar 11, 2013 at 7:36 PM, Dave Chinner wrote: > > > On Sun, Mar 10, 2013 at 10:17:42PM -0700, Michel Lespinasse wrote: > > >> - since all readers

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-13 Thread Michel Lespinasse
On Tue, Mar 12, 2013 at 8:23 PM, Dave Chinner wrote: > On Mon, Mar 11, 2013 at 11:43:34PM -0700, Michel Lespinasse wrote: >> I find the name 'barrier' actually confusing when used to describe >> synchronous operations. To me a barrier is usualy between >> asynchronous operations, and it is well d

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-12 Thread Dave Chinner
On Mon, Mar 11, 2013 at 11:43:34PM -0700, Michel Lespinasse wrote: > Hi Dave, > > On Mon, Mar 11, 2013 at 7:36 PM, Dave Chinner wrote: > > On Sun, Mar 10, 2013 at 10:17:42PM -0700, Michel Lespinasse wrote: > >> - since all readers are woken at once, you might see burst of direct > >> IO operation

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-11 Thread Michel Lespinasse
Hi Dave, On Mon, Mar 11, 2013 at 7:36 PM, Dave Chinner wrote: > On Sun, Mar 10, 2013 at 10:17:42PM -0700, Michel Lespinasse wrote: >> - since all readers are woken at once, you might see burst of direct >> IO operations followed by bursts of truncate operations, instead of >> having them interlea

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-11 Thread Dave Chinner
On Sun, Mar 10, 2013 at 10:17:42PM -0700, Michel Lespinasse wrote: > On Sun, Mar 10, 2013 at 5:16 PM, Dave Chinner wrote: > > On Fri, Mar 08, 2013 at 05:20:34PM -0800, Michel Lespinasse wrote: > >> On Fri, Mar 8, 2013 at 4:32 PM, Dave Chinner wrote: > >> > Isn't this a significant change of seman

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-11 Thread Peter Hurley
On Wed, 2013-03-06 at 15:21 -0800, Michel Lespinasse wrote: > + retry_reader_grants: > + oldcount = rwsem_atomic_update(adjustment, sem) - adjustment; > + if (unlikely(oldcount < RWSEM_WAITING_BIAS)) { > + /* A writer stole the lock. Undo our reader grants. */ > +

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-11 Thread Ingo Molnar
* Dave Chinner wrote: > So, that's my concern - we've got 20 years of algorithms in XFS designed > around rwsem write locks providing read-side barriers, and it's been > down this road once before (over 15 years ago). [...] We are certainly not going to break reader/writer fairness - that's a

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-10 Thread Michel Lespinasse
On Sun, Mar 10, 2013 at 5:16 PM, Dave Chinner wrote: > On Fri, Mar 08, 2013 at 05:20:34PM -0800, Michel Lespinasse wrote: >> On Fri, Mar 8, 2013 at 4:32 PM, Dave Chinner wrote: >> > Isn't this a significant change of semantics for the rwsem? i.e. >> > that read lock requests that come after a wri

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-10 Thread Dave Chinner
On Fri, Mar 08, 2013 at 05:20:34PM -0800, Michel Lespinasse wrote: > On Fri, Mar 8, 2013 at 4:32 PM, Dave Chinner wrote: > > On Wed, Mar 06, 2013 at 03:21:50PM -0800, Michel Lespinasse wrote: > >> When the first queued waiter is a reader, wake all readers instead of > >> just those that are at the

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-08 Thread Michel Lespinasse
On Fri, Mar 8, 2013 at 4:32 PM, Dave Chinner wrote: > On Wed, Mar 06, 2013 at 03:21:50PM -0800, Michel Lespinasse wrote: >> When the first queued waiter is a reader, wake all readers instead of >> just those that are at the front of the queue. There are really two >> motivations for this change: >

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-08 Thread Dave Chinner
On Wed, Mar 06, 2013 at 03:21:50PM -0800, Michel Lespinasse wrote: > When the first queued waiter is a reader, wake all readers instead of > just those that are at the front of the queue. There are really two > motivations for this change: Isn't this a significant change of semantics for the rwsem

[PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-06 Thread Michel Lespinasse
When the first queued waiter is a reader, wake all readers instead of just those that are at the front of the queue. There are really two motivations for this change: - This should result in increased parallelism for workloads that mix readers and writers. - As we want to enable fast-path write