Re: C mutex impl. for x86

2018-02-15 Thread Mateusz Guzik
On Wed, Dec 20, 2017 at 12:17:27PM +0100, Martin Pieuchot wrote: > On 15/12/17(Fri) 22:03, Mateusz Guzik wrote: > > > +void > > > +__mtx_enter(struct mutex *mtx) > > > +{ > > > +#ifdef MP_LOCKDEBUG > > > + int nticks = __mp_lock_spinout; > > > +#endif > > > + > > > + while

Re: C mutex impl. for x86

2017-12-20 Thread Martin Pieuchot
On 15/12/17(Fri) 22:03, Mateusz Guzik wrote: > [...] > However, contended behaviour is a regression compared to the asm > variant. Now that I checked the files in could you generate a diff with your suggestions? > From what I gather this is a step towards unifying all mutex > implementations,

Re: C mutex impl. for x86

2017-12-18 Thread Mark Kettenis
> Date: Mon, 18 Dec 2017 10:08:23 +0100 > From: Martin Pieuchot > > On 14/12/17(Thu) 16:06, Martin Pieuchot wrote: > > Diff below moves amd64 and i386 mutex to the common C implementation. > > > > The differences are: > > - membar_enter_after_atomic(9) instead of

Re: C mutex impl. for x86

2017-12-18 Thread Martin Pieuchot
On 14/12/17(Thu) 16:06, Martin Pieuchot wrote: > Diff below moves amd64 and i386 mutex to the common C implementation. > > The differences are: > - membar_enter_after_atomic(9) instead of membar_enter(9), and > - membar_exit_before_atomic(9) instead of membar_exit(9) > > I'd appreciate any

Re: C mutex impl. for x86

2017-12-15 Thread Mateusz Guzik
On Thu, Dec 14, 2017 at 04:06:41PM +0100, Martin Pieuchot wrote: > Diff below moves amd64 and i386 mutex to the common C implementation. > > The differences are: > - membar_enter_after_atomic(9) instead of membar_enter(9), and > - membar_exit_before_atomic(9) instead of membar_exit(9) > > I'd