Re: [PATCH] 2.5.4 Can't use spin_lock_* with wait_queue_head_t object.

From: Bob Miller (rem@osdl.org)
Date: Tue Feb 12 2002 - 17:15:33 EST


On Tue, Feb 12, 2002 at 04:23:39PM -0500, Richard B. Johnson wrote:

> On Tue, 12 Feb 2002, Bob Miller wrote:
>
> > There is code in sched.c that uses the spin_lock_* interfaces to acquire and
> > release the lock in the wait_queue_head_t embedded in the struct completion.
> >
> Isn't it just that the spin_lock wasn't initialized at the start?
>

No. The DECLARE_COMPLETION() macro was called in the case that oops'd.

The problem is that when wait.h:USE_RW_WAIT_QUEUE_SPINLOCK is set
the type of lock in the wait_queue_head_t changes from being a
spinlock_t to a rwlock_t.

If you also set CONFIG_DEBUG_SPINLOCK, the wq_lock_t in the
wait_queue_head_t is initialized with a rwlock_t magic number
(0xdeaf1eed), but the spin_lock_XXX() code checks for the spinlock_t
magic number (0xdead4ead) and calls BUG() when the check fails.

-- 
Bob Miller					Email: rem@osdl.org
Open Software Development Lab			Phone: 503.626.2455 Ext. 17
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:00:51 EST