Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1399424
| From | Jason Low <jason.low2@hp.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] locking/rwsem: Optimize write lock slowpath |
| Date | 2016-05-11 21:00 +0200 |
| Message-ID | <rxHwv-5FD-13@gated-at.bofh.it> (permalink) |
| References | <rwYSJ-3gz-1@gated-at.bofh.it> <rxAOn-7sm-33@gated-at.bofh.it> <rxHd8-5ub-29@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, 2016-05-11 at 11:33 -0700, Davidlohr Bueso wrote: > On Wed, 11 May 2016, Peter Zijlstra wrote: > > >On Mon, May 09, 2016 at 12:16:37PM -0700, Jason Low wrote: > >> When acquiring the rwsem write lock in the slowpath, we first try > >> to set count to RWSEM_WAITING_BIAS. When that is successful, > >> we then atomically add the RWSEM_WAITING_BIAS in cases where > >> there are other tasks on the wait list. This causes write lock > >> operations to often issue multiple atomic operations. > >> > >> We can instead make the list_is_singular() check first, and then > >> set the count accordingly, so that we issue at most 1 atomic > >> operation when acquiring the write lock and reduce unnecessary > >> cacheline contention. > >> > >> Signed-off-by: Jason Low <jason.low2@hp.com> > > Acked-by: Davidlohr Bueso <dave@stgolabs.net> > > (one nit: the patch title could be more informative to what > optimization we are talking about here... ie: reduce atomic ops > in writer slowpath' or something.) Yeah, the "optimize write lock slowpath" subject is a bit generic. I'll make the title more specific in the next version. Thanks, Jason
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] locking/rwsem: Optimize write lock slowpath Jason Low <jason.low2@hp.com> - 2016-05-09 21:20 +0200
Re: [PATCH] locking/rwsem: Optimize write lock slowpath Waiman Long <waiman.long@hpe.com> - 2016-05-10 04:30 +0200
Re: [PATCH] locking/rwsem: Optimize write lock slowpath Peter Zijlstra <peterz@infradead.org> - 2016-05-11 13:50 +0200
Re: [PATCH] locking/rwsem: Optimize write lock slowpath Jason Low <jason.low2@hp.com> - 2016-05-11 20:40 +0200
Re: [PATCH] locking/rwsem: Optimize write lock slowpath Peter Zijlstra <peterz@infradead.org> - 2016-05-11 20:40 +0200
Re: [PATCH] locking/rwsem: Optimize write lock slowpath Davidlohr Bueso <dave@stgolabs.net> - 2016-05-11 20:40 +0200
Re: [PATCH] locking/rwsem: Optimize write lock slowpath Jason Low <jason.low2@hp.com> - 2016-05-11 21:00 +0200
csiph-web