From owner-cvs-all Wed May 22 9:53:16 2002 Delivered-To: cvs-all@freebsd.org Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id 5392837B40A for ; Wed, 22 May 2002 09:53:08 -0700 (PDT) Received: (qmail 25321 invoked from network); 22 May 2002 16:53:07 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 22 May 2002 16:53:07 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g4MGr6F00383; Wed, 22 May 2002 12:53:06 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20020522144304.C1736-100000@herring.nlsystems.com> Date: Wed, 22 May 2002 12:52:40 -0400 (EDT) From: John Baldwin To: Doug Rabson Subject: Re: cvs commit: src/sys/i386/include cpufunc.h Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 22-May-2002 Doug Rabson wrote: > On Wed, 22 May 2002, John Baldwin wrote: > >> >> On 22-May-2002 Doug Rabson wrote: >> > On Tuesday 21 May 2002 9:21 pm, John Baldwin wrote: >> >> jhb 2002/05/21 13:21:54 PDT >> >> >> >> Modified files: >> >> sys/i386/include cpufunc.h >> >> Log: >> >> Add an inline function cpu_pause() for the IA32 'pause' instruction. >> > >> > Is this the hyperthreading thing that you are supposed to call from the idle >> > loop? >> >> Not sure if it is related to hyper-threading. What it does do is tell the >> processor to slow down and not issue memory reads faster than the bus speed >> so that when the loop is terminated the processor doesn't have to take a >> penalty waiting for all the outstanding memory accesses to complete. (Or >> something like that.) I've heard various rumors about it also being used >> with hyperthreading to cause the CPU to switch threads but I haven't seen >> any docco from Intel that confirms this. The IA-32 books I have here also >> state that the penalty at the end of the spin loop wait is for a memory >> order violation, not pending accesses. I imagine that if we are slowing >> the processor down to bus speed we can be executing another thread while >> we are idle though. > > We had an Intel guy come around to explain hyperthreading recently and I > think the way it works is that if one thread is paused (I think its with > this same pause instruction), the other thread can use all the functional > units in the cpu. If both threads are running, certain cpu resources are > divided between them. Sounds sensible. We may want to add a pause() to the idle loop where we spin on procrunnable() then. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message