From owner-freebsd-hackers Wed Apr 11 16:32:48 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id 76F3837B424 for ; Wed, 11 Apr 2001 16:32:39 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.2/8.11.2) with ESMTP id f3BNWPG13232; Wed, 11 Apr 2001 16:32:25 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20010411161858.T15938@fw.wintelcom.net> Date: Wed, 11 Apr 2001 16:31:56 -0700 (PDT) From: John Baldwin To: Alfred Perlstein Subject: Re: lockf in apache Cc: freebsd-hackers@FreeBSD.org, Dan Phoenix , Doug White Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 11-Apr-01 Alfred Perlstein wrote: > * Doug White [010411 16:07] wrote: >> On Tue, 10 Apr 2001, Alfred Perlstein wrote: >> >> > Basically, when apache is listening on multiple IPs/ports it needs >> > to select() on several filedescriptors. The problem (under FreeBSD >> > at least) is that whenever you have some process select()'ing on >> > a descriptor and another process wants to do the same you get a >> > "select collision", a collision requires that all processes waiting >> > on the same select channel wake up then reassert thier desire to >> > select. So... if you have 500 apache processes select()'ing and >> > one wakes up to service a request, finished serving, then goes to >> > select again, all the rest (499) have to wake up and reaffirm thier >> > desire to select(). >> >> We haven't applied wakeup_one() to select() yet? (I think I've argued >> about this before.) >> >> Someone get cracking! :) > > I'm not sure it's possible without redesigning the way select works. Select does a wakeup_one() if there's not a collision on a fd. If there is a collision, you need to do a full wakeup() since wakeup_one() on &selwait could easily just wake up a process waiting on some other fd and not a process waiting on the fd in question. xref. sys/kern/sys_generic.c, specifically selrecord() and selwakeup(). -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message