tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Bug in mutex_owned() ?
On Sunday 25 October 2009 14:24:47 Mindaugas Rasiukevicius wrote:
> Hans Petter Selasky <hselasky%c2i.net@localhost> wrote:
> > I've currently defined a spinlock type of mutex and my I4B driver code
> > repeatedly crashes due to the fact that mutex_owned() returnes that the
> > mutex is owned while it is actually not. It looks like a bug to me that
> > mutex_owned() always returns (1) in the non-adaptive case!
>
> That is not a bug. Please see "FULL" definition. Perhaps you are using
> it not for diagnostic purposes? In such case, it is wrong.
>
> > 830 #ifdef FULL
> > 831 return __SIMPLELOCK_LOCKED_P(&mtx->mtx_lock);
> > 832 #else
> > 833 return 1;
> > 834 #endif
> > 835 }
A quick search at fxr.watson.org reveals the following for amd64:
39 static __inline int
40 __SIMPLELOCK_LOCKED_P(__cpu_simple_lock_t *__ptr)
41 {
42 return *__ptr == __SIMPLELOCK_LOCKED;
43 }
72 #define __SIMPLELOCK_LOCKED 1
73 #define __SIMPLELOCK_UNLOCKED 0
mutex_owned() == 1 for spin locks ???
--HPS
Home |
Main Index |
Thread Index |
Old Index