tech-kern archive

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

Re: Replace lockmgr for vnodes

Dear folks,

On Sat, Jan 26, 2008 at 05:57:50PM +0000, Andrew Doran wrote:
> > 3) I think it'd be nice if we could retain something akin to 
> > lockmgr_printinfo(). I realize that our locking is now such that we need 
> > to print more than just one big heavy lock. However being able to figure 
> > out what's up/broken with locks can help. :-)
> We have 'show lock' from ddb. I'll see about providing a replacement.

I'd opt for a couple of fields in each lock that states its last 
modification location; say 

struct kmutex {
        char const *modification_file;
        int modification_line;

then a kmutex_enter() *macro* could set kmutex->modification_file to 
__FILE__ and kmutex->modification_line to __LINE__ if the LOCKDEBUG is 
defined and proceed. Maybe even a seperate entry for lock and release.

Debugging on deadlock detection then becomes printing out the locks and 
their claim and release points.

Could a kmutex be given a kind of `timeout' value? i.e. if it hasn't been 
exited after the specified time it is considered a deadlock? Say a minute 
or so as default?


With regards,

Attachment: pgpM5cM7mv0Kl.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index