Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit - v2

2008-09-06 Thread Gilles Chanteperdrix
Jan Kiszka wrote: > [ The refactored version according to our discussion. ] > > This patch fixes the race when the claimed bit changes between the lock > less check an the entry of the nklock-protected section. Applied, thanks. -- Gilles. ___

Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit

2008-09-03 Thread Gilles Chanteperdrix
Jan Kiszka wrote: > Gilles Chanteperdrix wrote: >> Jan Kiszka wrote: >>> Gilles Chanteperdrix wrote: Jan Kiszka wrote: > Gilles Chanteperdrix wrote: >> Jan Kiszka wrote: >>> OTOH, we can safe some text size which is precious as well. So I'm >>> convinced to go your way (with a

Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit

2008-09-03 Thread Jan Kiszka
Gilles Chanteperdrix wrote: > Jan Kiszka wrote: >> Gilles Chanteperdrix wrote: >>> Jan Kiszka wrote: Gilles Chanteperdrix wrote: > Jan Kiszka wrote: >> OTOH, we can safe some text size which is precious as well. So I'm >> convinced to go your way (with a modification): > My app

Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit

2008-09-02 Thread Jan Kiszka
Gilles Chanteperdrix wrote: > Jan Kiszka wrote: >> Gilles Chanteperdrix wrote: >>> Jan Kiszka wrote: OTOH, we can safe some text size which is precious as well. So I'm convinced to go your way (with a modification): >>> My approach sucks: we get a silly atomic_cmpxchg if the mutex is alre

Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit

2008-09-02 Thread Gilles Chanteperdrix
Jan Kiszka wrote: > Gilles Chanteperdrix wrote: >> Jan Kiszka wrote: >>> Gilles Chanteperdrix wrote: Jan Kiszka wrote: > OTOH, we can safe some text size which is precious as well. So I'm > convinced to go your way (with a modification): My approach sucks: we get a silly atomic_cm

Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit

2008-09-02 Thread Gilles Chanteperdrix
Jan Kiszka wrote: > Gilles Chanteperdrix wrote: >> Jan Kiszka wrote: >>> OTOH, we can safe some text size which is precious as well. So I'm >>> convinced to go your way (with a modification): >> My approach sucks: we get a silly atomic_cmpxchg if the mutex is already >> claimed, which is as least a

Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit

2008-09-02 Thread Jan Kiszka
Gilles Chanteperdrix wrote: > Jan Kiszka wrote: >> Gilles Chanteperdrix wrote: >>> Jan Kiszka wrote: Patch 2 of my fast lock series actually also contained an attempt to fix a race I spotted in the code that atomically sets the claimed bit. I forgot about this fact and even, worse, I

Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit

2008-09-02 Thread Jan Kiszka
Gilles Chanteperdrix wrote: > Jan Kiszka wrote: >> OTOH, we can safe some text size which is precious as well. So I'm >> convinced to go your way (with a modification): > > My approach sucks: we get a silly atomic_cmpxchg if the mutex is already > claimed, which is as least as much a common case a

Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit

2008-09-02 Thread Gilles Chanteperdrix
Jan Kiszka wrote: > OTOH, we can safe some text size which is precious as well. So I'm > convinced to go your way (with a modification): My approach sucks: we get a silly atomic_cmpxchg if the mutex is already claimed, which is as least as much a common case as a currently unclaimed mutex. Need to

Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit

2008-09-02 Thread Jan Kiszka
Jan Kiszka wrote: > Gilles Chanteperdrix wrote: >> Jan Kiszka wrote: >>> Gilles Chanteperdrix wrote: Jan Kiszka wrote: > Patch 2 of my fast lock series actually also contained an attempt to fix > a race I spotted in the code that atomically sets the claimed bit. I > forgot about th

Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit

2008-09-02 Thread Gilles Chanteperdrix
Jan Kiszka wrote: > Gilles Chanteperdrix wrote: >> Jan Kiszka wrote: >>> Patch 2 of my fast lock series actually also contained an attempt to fix >>> a race I spotted in the code that atomically sets the claimed bit. I >>> forgot about this fact and even, worse, I only replace the original race >>>

Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit

2008-09-02 Thread Gilles Chanteperdrix
Gilles Chanteperdrix wrote: > Jan Kiszka wrote: >> Gilles Chanteperdrix wrote: >>> Jan Kiszka wrote: Patch 2 of my fast lock series actually also contained an attempt to fix a race I spotted in the code that atomically sets the claimed bit. I forgot about this fact and even, worse, I

Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit

2008-09-02 Thread Jan Kiszka
Gilles Chanteperdrix wrote: > Jan Kiszka wrote: >> Patch 2 of my fast lock series actually also contained an attempt to fix >> a race I spotted in the code that atomically sets the claimed bit. I >> forgot about this fact and even, worse, I only replace the original race >> with another one. >> >>

Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit

2008-09-02 Thread Gilles Chanteperdrix
Jan Kiszka wrote: > Patch 2 of my fast lock series actually also contained an attempt to fix > a race I spotted in the code that atomically sets the claimed bit. I > forgot about this fact and even, worse, I only replace the original race > with another one. > > So here comes a new attempt to fix

Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit

2008-09-02 Thread Jan Kiszka
Gilles Chanteperdrix wrote: > Jan Kiszka wrote: >> Patch 2 of my fast lock series actually also contained an attempt to fix >> a race I spotted in the code that atomically sets the claimed bit. I >> forgot about this fact and even, worse, I only replace the original race >> with another one. >> >>

Re: [Xenomai-core] [PATCH] POSIX: Fix race when setting claimed bit

2008-09-02 Thread Gilles Chanteperdrix
Jan Kiszka wrote: > Patch 2 of my fast lock series actually also contained an attempt to fix > a race I spotted in the code that atomically sets the claimed bit. I > forgot about this fact and even, worse, I only replace the original race > with another one. > > So here comes a new attempt to fix