Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1418525
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC 10/12] x86, rwsem: simplify __down_write |
| Date | 2016-06-09 19:40 +0200 |
| Message-ID | <rIc5X-13V-1@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <qXPKi-8sh-3@gated-at.bofh.it> <qXPKj-8sh-35@gated-at.bofh.it> <qY0Po-7NH-11@gated-at.bofh.it> <rFZZf-5w1-7@gated-at.bofh.it> <rI9rs-7FY-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Jun 09, 2016 at 03:40:58PM +0100, David Howells wrote:
> Peter Zijlstra <peterz@infradead.org> wrote:
>
> > Blergh; so looking at more asm there's still a few tricks we cannot do.
> > So while overall size is down, some paths do end up more expensive. (It
> > typically boils down to creative use of condition flags, which is very
> > hard in C)
>
> It can be done using ISO __atomic_fetch_add() and suchlike.
(ISO-C11, ISO as such is a bad abbreviation I think)
Maybe, but we're almost there with __GCC_ASM_FLAG_OUTPUTS__.
atomic_long_add_negative() can be made to do inc;j(n)s for __down_read.
the try_cmpxchg family you wanted to add independent from the ISO-C11
bits can do the cmpxchg-j(n)z for __down_{read,write}_trylock.
That only leaves us wanting an atomic_long_fetch_add_negative() for
__up_{read,write}().
Although I suppose, for this to be of use for our weakly ordered
friends, we need _relaxed versions of all that (so that _acquire and
_release variants are generated).
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [RFC 10/12] x86, rwsem: simplify __down_write Peter Zijlstra <peterz@infradead.org> - 2016-06-03 18:20 +0200
Re: [RFC 10/12] x86, rwsem: simplify __down_write Peter Zijlstra <peterz@infradead.org> - 2016-06-04 00:40 +0200
Re: [RFC 10/12] x86, rwsem: simplify __down_write David Howells <dhowells@redhat.com> - 2016-06-09 16:50 +0200
Re: [RFC 10/12] x86, rwsem: simplify __down_write Peter Zijlstra <peterz@infradead.org> - 2016-06-09 19:40 +0200
Re: [RFC 10/12] x86, rwsem: simplify __down_write "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-10 20:00 +0200
csiph-web