Re: [GIT PULL] xfs: new code for 6.9

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

 



On Tue, 12 Mar 2024 at 23:07, Chandan Babu R <chandanbabu@xxxxxxxxxx> wrote:
>
> Matthew Wilcox (Oracle) (3):
>       locking: Add rwsem_assert_held() and rwsem_assert_held_write()

I have pulled this, but just wanted to note that this makes me wonder...

I think the "add basic minimal asserts even when lockdep is disabled"
is fine, and we should have done so long ago.

At the same time, historically our "assert()" has had a free "no
debugging" version.

IOW, it's often very nice to enable asserts for development and
testing (but lockdep may be overkill and psosibly even entirely
unacceptable if you also want to check lock contention etc).

But we've had a lot of cases where we add lockdep annotations as both
a documentation aid and a debugging aid, knowing that they go away if
you don't enable the debug code.

And it looks like there's no way to do that for the rwsem_assert_held*() macros.

I looked around, and the same is true of assert_spin_locked(), so this
isn't a new issue. But I find it sad, because it does actually
generate code, and these asserts tend to be things that people never
remove.

              Linus




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux