From owner-cvs-all Fri Jul 12 5:48:38 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B74A337B400; Fri, 12 Jul 2002 05:48:35 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD77243E42; Fri, 12 Jul 2002 05:48:34 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.12.4/8.12.4) with SMTP id g6CCZNbM091970; Fri, 12 Jul 2002 08:35:23 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Fri, 12 Jul 2002 08:35:23 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Jeffrey Hsu Cc: Don Lewis , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/netinet udp_usrreq.c In-Reply-To: <0GZ40040URTBIG@mta5.snfc21.pbi.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 12 Jul 2002, Jeffrey Hsu wrote: > > Now that I look at it, I think TCP has the opposite problem. I don't > > see either inp or tcbinfo being locked in tcp_close() before it > > calls in_pcbdetach(). > > They're locked higher up in the call graph by the functions that call > tcp_close(). If assumptions are made about locks being grabbed higher in the call graph, it's almost always a good idea to drop in locking assertions. They may already be there in the IP code (I haven't checked), but this is a general suggestion. When I was booting and testing jhb_proc on my SMP box, the assertions about both held (and unheld) locks were invaluable for fixing bugs. They count as documentation and active enforcement of the locking protocol, and have a much cleaner failure mode than gradual data corruption in kernel data structures. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message