Date: Wed, 22 May 2002 12:52:40 -0400 (EDT) From: John Baldwin <jhb@FreeBSD.org> To: Doug Rabson <dfr@nlsystems.com> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/i386/include cpufunc.h Message-ID: <XFMail.20020522125240.jhb@FreeBSD.org> In-Reply-To: <20020522144304.C1736-100000@herring.nlsystems.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <jhb@FreeBSD.org> <>< 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020522125240.jhb>