From owner-freebsd-arch@FreeBSD.ORG Sun Mar 5 11:28:49 2006 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 87DDC16A420 for ; Sun, 5 Mar 2006 11:28:49 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E12B43D46 for ; Sun, 5 Mar 2006 11:28:48 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (7pfd7cbsuzx3asab@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.3/8.13.3) with ESMTP id k25BSlWw049066; Sun, 5 Mar 2006 03:28:47 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.3/8.13.3/Submit) id k25BSkUA049065; Sun, 5 Mar 2006 03:28:46 -0800 (PST) (envelope-from jmg) Date: Sun, 5 Mar 2006 03:28:46 -0800 From: John-Mark Gurney To: Poul-Henning Kamp Message-ID: <20060305112846.GZ840@funkthat.com> Mail-Followup-To: Poul-Henning Kamp , arch@freebsd.org References: <35339.1141557488@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <35339.1141557488@critter.freebsd.dk> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: arch@freebsd.org Subject: Re: wakeup idea... X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Mar 2006 11:28:49 -0000 Poul-Henning Kamp wrote this message on Sun, Mar 05, 2006 at 11:18 +0000: > Here is a possibly stupid idea. > > Historically sleep/wakeup have happened on a pointer which was just > a magic number. > > In many cases, this pointer is actually a relevant datastructure. > > Would it possibly be an optimization to make a variant of the > sleep/wakeup calls where the pointer points to an integer type which > contains non-zero if anybody is actually sleeping on that address ? > > Anybody up for a quick prototype ? A different idea that I had was for a process to cache the wakeup address, and then only perform the wakeup when the appropriate lock was unlocked.. Thus saving the time of waking up a process just for it to go back to sleep waiting for your lock.. (though this can cause wierd things to happen wrt priority, i.e. you don't get the to be woken up process's priority lent to you, if needed)... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."