From owner-freebsd-current Thu Jun 13 16:55:18 2002 Delivered-To: freebsd-current@freebsd.org Received: from mta7.pltn13.pbi.net (mta7.pltn13.pbi.net [64.164.98.8]) by hub.freebsd.org (Postfix) with ESMTP id 6F51B37B423; Thu, 13 Jun 2002 16:55:13 -0700 (PDT) Received: from FreeBSD.org ([63.193.112.125]) by mta7.pltn13.pbi.net (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTP id <0GXO001FX54144@mta7.pltn13.pbi.net>; Thu, 13 Jun 2002 16:55:13 -0700 (PDT) Date: Thu, 13 Jun 2002 16:55:22 -0700 From: Jeffrey Hsu Subject: duplicate inp locks In-reply-to: Message from John Baldwin "of Thu, 13 Jun 2002 19:37:07 EDT." To: John Baldwin Cc: current@freebsd.org, yangjihui@yahoo.com Message-id: <0GXO001FY54144@mta7.pltn13.pbi.net> MIME-version: 1.0 X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > How do you define the order between teh two inp locks to ensure you don't > end up deadlocking? One is the listening connection and the other is the newly created connection. The two inp locks are always acquired in the same order, so there's no possibility of deadlock here. Another case of holding 2 inp locks comes up when traversing the protocol pcb list and holding on to the last inp of interest while examining the rest of the inps to see if there's another one of interest. The pcb list is always walked in sequential list order with a lock held on the list, so there's no possibility of deadlock here. I don't want to add MTX_DUPOK to the inp lock yet, because I want to catch all the cases where duplicate inp locks are held and examine them by hand. But the ones I've investigated so far have been intentional. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message