From owner-freebsd-arch@FreeBSD.ORG Mon Jul 2 18:56:22 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 CCAB016A481; Mon, 2 Jul 2007 18:56:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 7004F13C457; Mon, 2 Jul 2007 18:56:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l62ItX4N097083; Mon, 2 Jul 2007 14:55:33 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-arch@freebsd.org Date: Mon, 2 Jul 2007 14:54:39 -0400 User-Agent: KMail/1.9.6 References: <20070701160540.Y552@10.0.0.1> In-Reply-To: <20070701160540.Y552@10.0.0.1> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200707021454.39923.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 02 Jul 2007 14:55:33 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/3574/Mon Jul 2 04:07:06 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: 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 18:56:22 -0000 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. -- John Baldwin