cvs commit: src/sys/kern kern_linker.c

Pawel Jakub Dawidek pjd at FreeBSD.org
Fri Apr 18 07:14:14 UTC 2008


On Thu, Apr 17, 2008 at 10:54:08PM +0100, Robert Watson wrote:
> 
> On Thu, 17 Apr 2008, Pawel Jakub Dawidek wrote:
> 
> >pjd         2008-04-17 19:19:40 UTC
> >
> > FreeBSD src repository
> >
> > Modified files:
> >   sys/kern             kern_linker.c
> > Log:
> > Allow linker_search_symbol_name() to be called with KLD lock held.
> > The linker_search_symbol_name() function is used by stack_print()
> > and stack_print() can be called from kernel module unload method.
> 
> I'm not sure I'm entirely comfortable with this locking change; conditional 
> locking of this type is something we've generally tried to eliminate.  If 
> this is for debugging code used in locking sensitive contexts, it is 
> probably preferable to use one of the _ddb variations on the stack(9) 
> routines, which bypass locking.  Or, in this case, it simply uses the locks 
> that are already, conveniently, held.

We would need to change all stack(9) consumers to grab KLD_LOCK() before
calling its functions, which I don't find very nice. Currently stack(9)
functions are mostly called from contexts where KLD lock is not yet
held, but in this case where I want to print leaked objects on module
unload, the KLD lock is already held.

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-all/attachments/20080418/1ac03ce7/attachment.pgp


More information about the cvs-all mailing list