From owner-freebsd-current@FreeBSD.ORG Sun Aug 28 02:38:02 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A1C6016A41F; Sun, 28 Aug 2005 02:38:02 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.village.org (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3FAA243D46; Sun, 28 Aug 2005 02:38:02 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1]) by harmony.village.org (8.13.3/8.13.3) with ESMTP id j7S2atwp020758; Sat, 27 Aug 2005 20:36:55 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 27 Aug 2005 20:37:14 -0600 (MDT) Message-Id: <20050827.203714.93196510.imp@bsdimp.com> To: rwatson@freebsd.org From: "M. Warner Losh" In-Reply-To: <20050828025721.X43518@fledge.watson.org> References: <20050827184153.A24510@fledge.watson.org> <20050827.124941.14976142.imp@bsdimp.com> <20050828025721.X43518@fledge.watson.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.village.org [127.0.0.1]); Sat, 27 Aug 2005 20:36:59 -0600 (MDT) Cc: bzeeb-lists@lists.zabbadoz.net, freebsd-current@freebsd.org, dandee@volny.cz Subject: Re: LOR route vr0 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2005 02:38:02 -0000 In message: <20050828025721.X43518@fledge.watson.org> Robert Watson 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