From owner-freebsd-net Wed Feb 19 15: 3:46 2003 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 590A337B401 for ; Wed, 19 Feb 2003 15:03:45 -0800 (PST) Received: from anduril.ncsa.uiuc.edu (anduril.ncsa.uiuc.edu [141.142.102.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id E521643FA3 for ; Wed, 19 Feb 2003 15:03:44 -0800 (PST) (envelope-from jdugan@anduril.ncsa.uiuc.edu) Received: by anduril.ncsa.uiuc.edu (Postfix, from userid 501) id 6CD592A4080; Wed, 19 Feb 2003 17:04:53 -0600 (CST) Date: Wed, 19 Feb 2003 17:04:53 -0600 From: Jon Dugan To: freebsd-net@freebsd.org Subject: MT/MP locking and TCP Message-ID: <20030219230453.GA3167@ncsa.uiuc.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I have been spending quite a lot of time rooting through the TCP implementation recently due to my efforts with Web100. I have been trying to understand the locking strategy in the TCP portions of the code. I have primarily been looking at tcp_input.c. It seems like several variables are locked for the vast majority of the time in tcp_input(). (In particular tcbinfo and inp). This was problematic when I called a function to update some stats when a TCP session entered the ESTABLISHED state because witness kept telling me that the we might sleep with tcpinfo and inp locked. Can someone briefly explain the strategy here? Or maybe there is a document somewhere that would be helpful? (I looked but didn't find anything.) I have very little experience with locking and multithreaded programming, so that may be the root of my confusion. As a result I want to make sure as I go forward with the Web100 code that I lock it appropriately. Thanks, Jon -- Jon Dugan | Senior Network Engineer, NCSA Network Research jdugan@ncsa.uiuc.edu | 269 CAB, 605 E Springfield, Champaign, IL 61820 217-244-7715 | http://www.ncsa.uiuc.edu/~jdugan/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message