From owner-freebsd-arch@FreeBSD.ORG Mon Jul 2 19:06:26 2007 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6BE8016A421; Mon, 2 Jul 2007 19:06:26 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from webaccess-cl.virtdom.com (webaccess-cl.virtdom.com [216.240.101.25]) by mx1.freebsd.org (Postfix) with ESMTP id 3249113C46E; Mon, 2 Jul 2007 19:06:26 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from [192.168.1.101] (c-71-231-138-78.hsd1.or.comcast.net [71.231.138.78]) (authenticated bits=0) by webaccess-cl.virtdom.com (8.13.6/8.13.6) with ESMTP id l62J6OEP029068 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Mon, 2 Jul 2007 15:06:25 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Date: Mon, 2 Jul 2007 12:06:03 -0700 (PDT) From: Jeff Roberson X-X-Sender: jroberson@10.0.0.1 To: John Baldwin In-Reply-To: <200707021454.39923.jhb@freebsd.org> Message-ID: <20070702120445.X552@10.0.0.1> References: <20070701160540.Y552@10.0.0.1> <200707021454.39923.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: arch@freebsd.org, freebsd-arch@freebsd.org Subject: Re: wakeup_flags patch. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2007 19:06:26 -0000 On Mon, 2 Jul 2007, John Baldwin wrote: > On Sunday 01 July 2007 07:08:35 pm Jeff Roberson wrote: >> http://people.freebsd.org/~jeff/wakeupflags.diff >> >> It didn't workout very cleanly since the flags have to go through three >> layers. I could define wakeup and sleepq flags to be the same and skip a >> bunch of conditionals. However, we'd then have to know which flags were >> free to use in each case. Are there any further opinions on the style? >> >> This patch does not include an implementation for WAKEUP_LOCAL. I'm still >> working on that in SCHED_SMP. Ironically, it does include an >> implementation for WAKEUP_TAIL, however, I don't have any users of that. >> :-) > > You can find the pre-threadlock patch for 7.x of what Y! uses for accept() at > www.freebsd.org/~jhb/patches/justone.patch > > It has two features your WAKEUP_TAIL doesn't have (one of which I mentioned > earlier): 1) it doesn't wakeup threads from swapped out processes (you aren't > getting a thread that is "hot" in the cache if you have to go page it back in > from disk), and 2) it returns a success/fail to the caller so that it can > fallback to its traditional behavior if we couldn't find a "hot" thread to > resume. Shouldn't we simply choose a non-hot thread in this case? In your environment is it common to have a lot of swapped out proceses? It would be expensive to lock and unlock each thread to check if it's swapped. Perhaps we can simply do it in a racey way. Jeff > > -- > John Baldwin >