Re: rwlock tweak

2017-10-16 Thread Mark Kettenis
> Date: Mon, 16 Oct 2017 11:53:30 +0200 > From: Martin Pieuchot > > On 16/10/17(Mon) 11:36, Mark Kettenis wrote: > > > Date: Mon, 16 Oct 2017 10:52:09 +0200 > > > From: Martin Pieuchot > > > > > > As pointed by Mateusz Guzik [0], on x86 the cmpxchg{q,l} used by > > > rw_enter(9) and rw_exit(9)

Re: rwlock tweak

2017-10-16 Thread Mike Belopuhov
On Mon, Oct 16, 2017 at 09:36 +, Mark Kettenis wrote: > > Date: Mon, 16 Oct 2017 10:52:09 +0200 > > From: Martin Pieuchot > > > > As pointed by Mateusz Guzik [0], on x86 the cmpxchg{q,l} used by > > rw_enter(9) and rw_exit(9) already include an implicit memory > > barrier, so we can avoids us

Re: rwlock tweak

2017-10-16 Thread Martin Pieuchot
On 16/10/17(Mon) 11:36, Mark Kettenis wrote: > > Date: Mon, 16 Oct 2017 10:52:09 +0200 > > From: Martin Pieuchot > > > > As pointed by Mateusz Guzik [0], on x86 the cmpxchg{q,l} used by > > rw_enter(9) and rw_exit(9) already include an implicit memory > > barrier, so we can avoids using an explic

Re: rwlock tweak

2017-10-16 Thread Mark Kettenis
> Date: Mon, 16 Oct 2017 10:52:09 +0200 > From: Martin Pieuchot > > As pointed by Mateusz Guzik [0], on x86 the cmpxchg{q,l} used by > rw_enter(9) and rw_exit(9) already include an implicit memory > barrier, so we can avoids using an explicit expensive one by > using the following variants. > >

rwlock tweak

2017-10-16 Thread Martin Pieuchot
As pointed by Mateusz Guzik [0], on x86 the cmpxchg{q,l} used by rw_enter(9) and rw_exit(9) already include an implicit memory barrier, so we can avoids using an explicit expensive one by using the following variants. [0] https://marc.info/?l=openbsd-tech&m=150765959923113&w=2 ok? Index: kern/ke