Page MenuHomeFreeBSD

Don't modify td_locks unless INVARIANTS is defined.
ClosedPublic

Authored by markj on Jul 26 2015, 8:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 23 2023, 4:17 AM
Unknown Object (File)
Nov 17 2023, 9:44 PM
Unknown Object (File)
Nov 6 2023, 11:52 PM
Unknown Object (File)
Nov 5 2023, 5:37 PM
Unknown Object (File)
Oct 30 2023, 4:57 AM
Unknown Object (File)
Oct 5 2023, 10:51 PM
Unknown Object (File)
Oct 4 2023, 4:12 PM
Unknown Object (File)
Sep 3 2023, 11:55 PM
Subscribers

Details

Summary

It is currently only examined in a KASSERT(), and that's always been the
case as far as I can tell. It also seems to be omitted from the fast
paths of various locks (except for rwlock read locks, which do not have
one), so we won't catch all cases of returning to usermode with a lock
held. (I'll fix this in a future change.)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj retitled this revision from to Don't modify td_locks unless INVARIANTS is defined..
markj edited the test plan for this revision. (Show Details)
markj updated this object.
markj updated this object.
jhb edited edge metadata.

I think this is fine.

Recall that locks aren't inlined and none of the fast paths taken if LOCK_DEBUG is > 0. One of the things that triggers this is INVARIANTS, so there shouldn't be any missing td_lock bumps?

This revision is now accepted and ready to land.Aug 1 2015, 4:43 PM
In D3205#66086, @jhb wrote:

I think this is fine.

Recall that locks aren't inlined and none of the fast paths taken if LOCK_DEBUG is > 0. One of the things that triggers this is INVARIANTS, so there shouldn't be any missing td_lock bumps?

Ah, I missed that. Then that's also an argument in favour of this change. :)

This revision was automatically updated to reflect the committed changes.