Re: hashed spinlocks

From: Daniel Walker
Date: Sun Jul 31 2005 - 14:21:05 EST


On Sun, 2005-07-31 at 12:11 -0700, David S. Miller wrote:
> From: Daniel Walker <dwalker@xxxxxxxxxx>
> Date: Sun, 31 Jul 2005 12:06:47 -0700
>
> > The ifdef that switched between the two rt_hash_lock_addr() switched on
> > for CONFIG_SMP or CONFIG_DEBUG_SPINLOCK . I was compiling UP , so I
> > didn't get either.
> >
> > Seems like you'll need to have an rt_hash_lock(slot) that replaces the
> > spin_lock calls ..
>
> spin_lock(x) and spin_unlock(x) are both a nop in this case, so what
> is the problem passing in a NULL? The argument is arbitrary and should
> should just ignored, right?

True.

> If both CONFIG_SMP and CONFIG_DEBUG_SPINLOCK are disabled, we
> end up with these definitions in linux/spinlock.h
>
> #define spin_lock(lock) _spin_lock(lock)
>
> #define _spin_lock(lock) \
> do { \
> preempt_disable(); \
> _raw_spin_lock(lock); \
> __acquire(lock); \
> } while(0)
>
> #define _raw_spin_lock(lock) do { (void)(lock); } while(0)
>
> What kind of warning do you get?

It was an RT kernel, which isn't mainline .. Your right it shouldn't be
a problem .

Daniel

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/