Re: Is spin_is_locked() safe to use with BUG_ON()/WARN_ON()?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Ryan Mallon <rmallon@xxxxxxxxx> wrote:

> On 24/05/13 01:12, David Howells wrote:
> > Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> > 
> >> We do *not* want to add some crazy "spin_is_nt_locked". We just want
> >> to get rid of these idiotic debug tests.
> > 
> > Generally, I think you are right, though there are also some checks in
> > deallocation routines that check that a spinlock is not currently held before
> > releasing the memory holding it - should those be allowed to stay?  I'd be
> > tempted to wrap the whole check in something, perhaps an "spin_lock_uninit()"
> > and move the check to a header file.  Would this be useful for lockdep or
> > anything like that?
> 
> lockdep has lockdep_assert_held(), which might be what you want. Though 
> it looks like it possibly also has the false positive issues on SMP?

There should be no false positive race in the case that matters: if you 
are expecting to always hold the lock at that point, and want to make sure 
(if lock debugging is enabled), that it's truly held.

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux