Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1611706
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/5] locking: Introduce range reader/writer lock |
| Date | 2017-03-29 11:00 +0200 |
| Message-ID | <tqhCq-4pL-23@gated-at.bofh.it> (permalink) |
| References | <tigat-2NF-5@gated-at.bofh.it> <tihpT-3Xx-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Mar 06, 2017 at 09:03:26PM -0800, Davidlohr Bueso wrote: > +++ b/kernel/locking/range_rwlock.c > @@ -0,0 +1,462 @@ > +/* > + * Implementation of read/write range locks. > + * > + * We keep interval tree of locked and to-be-locked ranges. When new range lock > + * is requested, we add its interval to the tree and store number of intervals > + * intersecting it to 'blocking_ranges'. > + * > + * When a range is unlocked, we again walk intervals that intersect with the > + * unlocked one and decrement their 'blocking_ranges'. We wake up owner of any > + * range lock whose 'blocking_ranges' drops to 0. For the shared case, the > + * 'blocking_ranges' is only incremented if the intersecting range is not marked > + * as a reader. In order to mitigate some of the tree walk overhead for > + * non-intersecting ranges, the tree's min/max values are maintained and consulted > + * in O(1) in the fastpath. > + */ Was your editor broken? Those lines are > 80 for no reason what so ever.
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH 1/5] locking: Introduce range reader/writer lock Peter Zijlstra <peterz@infradead.org> - 2017-03-29 11:00 +0200
csiph-web