From owner-cvs-all Sat Jul 13 19:22:11 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 354F237B400; Sat, 13 Jul 2002 19:22:06 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB14043E6A; Sat, 13 Jul 2002 19:22:05 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Received: from mousie.catspoiler.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.5/8.12.5) with ESMTP id g6E2Ltwr020001; Sat, 13 Jul 2002 19:21:59 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Message-Id: <200207140221.g6E2Ltwr020001@gw.catspoiler.org> Date: Sat, 13 Jul 2002 19:21:55 -0700 (PDT) From: Don Lewis Subject: Re: cvs commit: src/sys/netinet udp_usrreq.c To: hsu@FreeBSD.org Cc: dl-freebsd@catspoiler.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org In-Reply-To: <0GZ5004IMH36IU@mta5.snfc21.pbi.net> 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 12 Jul, Jeffrey Hsu wrote: > > I've been doing some digging through the code and it looks to me like > > both the INP_LOCK() and inp->inp_socket == NULL test can be eliminated. > > The inp lock is needed for sure. I dug through the source and didn't see anything that made me believe that we need to hold this lock in the getcred code. The only assignment I saw to inp->socket is in in_pcballoc(), and this is protected ^H^H^H^H is *not* protected by the INP_INFO lock. But that's ok I guess since in_pcbremlists() isn't doing any locking either :-( > It does look like the inp->inp_socket == NULL test can be eliminated, but > I didn't want to introduce any extraneous changes with the inp locking patch, > so that change is left for a later round. > > > The inp->inp_socket == NULL check shows up in the code > > listing in _TCP/IP Illustrated Volume 2_, but there doesn't seem to be > > any need for it there. It probably slipped in to "fix" panic some time > > in the deep dark past when there were probably locking problems in the > > code. > > This is where the CSRG SCCS archive comes in real handy. That would make some interesting reading ... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message