Messages in this thread |  | | Date | Thu, 11 Jul 2002 21:38:34 -0700 | From | Jesse Barnes <> | Subject | Re: spinlock assertion macros |
| |
On Thu, Jul 11, 2002 at 06:36:26PM -0700, pmenage@ensim.com wrote: > The spin_assert_unlocked() macro in Jesse's patch doesn't cope with > the fact that someone else might quite legitimately have the spinlock > locked. You'd need debugging spinlocks that track the owner of the > spinlock, and then check in MUST_NOT_HOLD() you'd check that > lock->owner != current. You'd also have to have some special > non-checking lock/unlock macros to handle situations where locks are > taken in non-process context or released by someone other than the > original locker (does the migration code still do that?).
You're right about that, it would be much more useful to add a spin_assert_unlocked_all() or MUST_NOT_HOLD_ANY() macro, as Arnd suggested. I'll take the suggestions I've received and try to put together a more complete patch early next week. It'll include lock checks for rwlocks, semaphores, and rwsems as well as the global no-locks-held macro. And as an added bonus, I'll even try to test it :).
Thanks, Jesse - 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/
|  |