From owner-freebsd-current Wed Apr 24 7:27:25 2002 Delivered-To: freebsd-current@freebsd.org Received: from mail.speakeasy.net (mail13.speakeasy.net [216.254.0.213]) by hub.freebsd.org (Postfix) with ESMTP id F3DC837B41D for ; Wed, 24 Apr 2002 07:27:18 -0700 (PDT) Received: (qmail 23118 invoked from network); 24 Apr 2002 14:18:53 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail13.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 24 Apr 2002 14:18:53 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g3OEIqv06707; Wed, 24 Apr 2002 10:18:52 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200204241110.g3OB8u8t006194@bunko> Date: Wed, 24 Apr 2002 10:18:01 -0400 (EDT) From: John Baldwin To: Seigo Tanimura Subject: RE: Locking down a socket, milestone 1 Cc: Seigo Tanimura Cc: Seigo Tanimura , smp@FreeBSD.org, current@FreeBSD.org 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 On 24-Apr-2002 Seigo Tanimura wrote: > I am now working on locking down a socket. (I have heard that Jeffrey > Hsu is also doing that, but I have never seen his patch. Has anyone > seen that?) My first milestone patch is now available at: > > > http://people.FreeBSD.org/~tanimura/patches/socket_milestone1.diff.gz > > > The works I have done so far are: > > > - Determine the lock required to protect each of the members in struct > socket. > > - Add mutexes to each of the sockbufs in a socket as BSD/OS does. > > - Lock down so_count, so_options, so_linger and so_state. > > - Add a global mutex socq_lock to protect the connection queues of a > listening socket. Lock socq_lock to lock two sockets at once, > followed by enqueuing or dequeuing a socket, or moving a socket across > queues. socq_lock is not an sx lock because we usually have to lock > two sockets to modify them. Do you actually lock two sockets at once or do you lock one at a time while holding socq_lock. If you do lock two at once, what is the defined locking order? -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message