Bug #780

lockuninit()

Added by aoiko over 6 years ago. Updated over 6 years ago.

Status:ClosedStart date:
Priority:LowDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

It appears we don't have an uninit function for lockmgr locks. This means we
don't ever uninit the embedded spinlock (which does have a dummy
spin_uninit()) and this defeats the idea of providing spin_uninit(). There is
no purpose in having a dummy function that isn't used consistently; anybody
who wants to add debugging/verification code will be forced to go through
the source to add the missing calls or, worse yet, not even notice they are
missing.

I'm attaching a trivial (completely untested) lockuninit() implementation.
There are (grep tells me) 17 non-static uses of struct lock to check, so this
is only a first step, but I can't go through the tree changing things right
now.

Aggelos

lockuninit.patch Magnifier (1.77 KB) aoiko, 08/19/2007 06:11 PM

History

#1 Updated by dillon over 6 years ago

:It appears we don't have an uninit function for lockmgr locks. This means we
:don't ever uninit the embedded spinlock (which does have a dummy
:spin_uninit()) and this defeats the idea of providing spin_uninit(). There is
:no purpose in having a dummy function that isn't used consistently; anybody
:who wants to add debugging/verification code will be forced to go through
:the source to add the missing calls or, worse yet, not even notice they are
:missing.
:
:I'm attaching a trivial (completely untested) lockuninit() implementation.
:There are (grep tells me) 17 non-static uses of struct lock to check, so this
:is only a first step, but I can't go through the tree changing things right
:now.
:
:Aggelos

I'll commit it so we have it.

I'm a bit on the fence as to whether we actually need the uninit
functions for lockmgr locks or spin locks. They might be useful for
debugging purposes but that's about it. Our lock use isn't as complex
as FreeBSD's.

-Matt

#2 Updated by hasso over 6 years ago

Committed, so closing bug.

Also available in: Atom PDF