From owner-freebsd-hackers Sat May 31 11:17:35 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id LAA02167 for hackers-outgoing; Sat, 31 May 1997 11:17:35 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id LAA02159; Sat, 31 May 1997 11:17:29 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id LAA10977; Sat, 31 May 1997 11:15:42 -0700 From: Terry Lambert Message-Id: <199705311815.LAA10977@phaeton.artisoft.com> Subject: Re: Thundering herd. To: julian@FreeBSD.ORG (Julian Elischer) Date: Sat, 31 May 1997 11:15:42 -0700 (MST) Cc: hackers@FreeBSD.ORG In-Reply-To: <199705310322.UAA17301@freefall.freebsd.org> from "Julian Elischer" at May 30, 97 08:22:51 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > hmm with processes doing a select on a socket.. > > here's an example from a ktrace'd kernel. [ ... ] > one 'wakeup' and a whole bunch of processes were woken up.. > can't we do better than that? > this is in 2.2+ > > julian > > p.s. yes it only wasted 10mSec (probably less without ktrace) > but I thought we had got around this.. You need to implement a mux instead of a multiple select on a signle socket. The mux then only delivers to a single processes "socket". I think your netframe stuff is a perfect match for this problem. As an optimization, I suggest using LIFO ordering to determine which process gets the select() coming true: if they are anonymous work-to-do-engines (which they can be, using a mux), then the last one in is most likely to have all its data pages in core. This technique is called "hot engine scheduling" (incidently, it was my design for the NetWare for UNIX product's queuing preference). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.