Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Sep 2001 13:25:47 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   RE: cvs commit: src/sys/sys _lock.h lock.h
Message-ID:  <XFMail.010926132547.jhb@FreeBSD.org>
In-Reply-To: <20010927054324.Q40707-100000@delplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 26-Sep-01 Bruce Evans wrote:
> On Wed, 26 Sep 2001, John Baldwin wrote:
> 
>> On 25-Sep-01 John Baldwin wrote:
>> > jhb         2001/09/25 16:51:54 PDT
>> >
>> >   Modified files:
>> >     sys/sys              _lock.h lock.h
>> >   Log:
>> >   Move the definition of LOCK_DEBUG from sys/lock.h to sys/_lock.h.
>>
>> This fixes the panic on the vnode interlock.  The problem is that
>> vfs_vnops.c
>> wasn't including sys/lock.h, so LOCK_DEBUG wasn't defined, so it wasn't
>> getting
>> LOCK_DEBUG defined properly and was just inling the mutex operation and not
>> calling witness.  Arguably, I should cause the compile to break when mutex.h
>> is
>> included w/o lock.h, but this will work for now.  Also, getting LOCK_DEBUG
>> right really depends on knowing the value of KTR_COMPILE which requires
>> including sys/ktr.h, so in theory sys/_lock.h should either include
>> sys/ktr.h
>> or mandate it's inculsion in the _KERNEL case.  Bruce, do you have any
>> preferences on this?
> 
> Including <sys/ktr.h> in <sys/_lock.h> would defeat the point of having
> <sys/_lock.h>.  Try to make things break if LOCK_DEBUG is used and the
> prerequisites for getting it right are not included.

Ok.  Would it be ok to include sys/ktr.h in mutex.h, sema.h, and sx.h? 
Everything else that LOCK_DEBUG depends on is in opt_global.h.  If I just
removed the KTR_COMPILE & KTR_LOCK test and slightly pessimized the case of
using KTR w/o KTR_LOCK and w/o WITNESS or INVARIANTS then LOCK_DEBUG wouldn't
depend on sys/ktr.h anymore.  Perhaps I will just do that.

> Bruce

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010926132547.jhb>