LOR route vr0
M. Warner Losh
imp at bsdimp.com
Sun Aug 28 02:38:02 GMT 2005
In message: <20050828025721.X43518 at fledge.watson.org>
Robert Watson <rwatson at FreeBSD.org> writes:
:
: On Sat, 27 Aug 2005, M. Warner Losh wrote:
:
: > : You need to add an entry to subr_witness.c creating a graph edge between
: > : the softc lock and the routing lock. An example of an entry in
: > : subr_witness.c:
: > :
: > : /*
: > : * TCP/IP
: > : */
: > : { "tcp", &lock_class_mtx_sleep },
: > : { "tcpinp", &lock_class_mtx_sleep },
: > : { "so_snd", &lock_class_mtx_sleep },
: > : { NULL, NULL },
: > :
: > : Note that sets of ordered entries are terminated with a double-null. This
: > : declares that locks of type "tcp" preceed "tcpinp" which preceed
: > : "so_snd".
: >
: > So you have to have locks of type tcp BEFORE you take out tcpinp type
: > locks?
:
: Correct. 'tcp' reflects the global TCP state tables (pcbinfo) locks, and
: 'tcpinp' is for individual PCBs. If you acquire first a tcpinp and then
: tcp, the above settings should cause WITNESS to generate a lock order
: warning. Likewise, both tcp and tcpinp preceed so_snd, so if you acquire
: a protocol lock after a socket lock, it will get unhappy. WITNESS handles
: transitive relationships, so it gets connected up to the rest of the lock
: graph, explicit and implicit, so indirect violations of orders are fully
: handled.
So I should make entries like:
/*
* Network driver
*/
{ "network driver", &lock_class_mtx_sleep },
{ "if_addr_mtx", &lock_class_mtx_sleep },
{ NULL, NULL },
somewhere in the list?
Warner
More information about the freebsd-current
mailing list