From owner-freebsd-current Fri May 11 20:22:20 2001 Delivered-To: freebsd-current@freebsd.org Received: from rina.r.dl.itc.u-tokyo.ac.jp (cvsup2.r.dl.itc.u-tokyo.ac.jp [133.11.199.247]) by hub.freebsd.org (Postfix) with ESMTP id E446D37B424; Fri, 11 May 2001 20:22:15 -0700 (PDT) (envelope-from tanimura@r.dl.itc.u-tokyo.ac.jp) Received: (from uucp@localhost) by rina.r.dl.itc.u-tokyo.ac.jp (8.11.3+3.4W/3.7W-rina.r-20010412) with UUCP id f4C3M9l06325 ; Sat, 12 May 2001 12:22:09 +0900 (JST) Received: from silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp (silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp [fec0::1:280:c8ff:fe6b:6d73]) by sohgo.carrots.uucp.r.dl.itc.u-tokyo.ac.jp (8.11.3+3.4W/3.7W) with ESMTP id f4C3M0J15415 ; Sat, 12 May 2001 12:22:02 +0900 (JST) Received: from silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp (localhost [127.0.0.1]) by silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp (8.11.3+3.4W/3.7W) with ESMTP id e4C3Lvp08649 ; Fri, 12 May 2000 12:21:59 +0900 (JST) Message-Id: <200005120321.e4C3Lvp08649@silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp> Date: Fri, 12 May 2000 12:21:57 +0900 From: Seigo Tanimura To: John Baldwin Cc: Seigo Tanimura , current@FreeBSD.org Subject: Re: select(2) converted to use a condition variable, and optimis In-Reply-To: <200105100006.f4A06Gj35470@silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp> References: <200105091020.f49AK7P05497@rina.r.dl.itc.u-tokyo.ac.jp> <200105100006.f4A06Gj35470@silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp> User-Agent: Wanderlust/2.4.1 (Stand By Me) SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386--freebsd) Organization: Digital Library Research Division, Information Techinology Centre, The University of Tokyo MIME-Version: 1.0 (generated by SEMI 1.13.7 - "Awazu") Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 10 May 2001 09:06:15 +0900, Seigo Tanimura said: Seigo> A quick and hopefully efficient solution to those problems is to Seigo> fhold() struct file's first, then enter polling loop. That seems much Seigo> cheaper than to work on free()ing a vnode or a socket with holding a Seigo> process lock, provided that struct filedesc and file are protected Seigo> properly (and we have to do it anyway). That work is now in the patch at: http://people.FreeBSD.org/~tanimura/patches/selectopt.diff Another work in that patch is elimination of P_SELECT and nselcoll check just prior to waiting for selwait. As we now scan file descriptors with holding a process lock, race with selwakeup() should never occur during polling. Please note that netncp and netsmb are not in the scope the solution discussed above because we can neither lock nor hold a reference to a socket for now. Since several issues regarding to the file descriptor layer have risen up, I am planning to commit the patch soon and work on locking file descriptors. -- Seigo Tanimura To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message