On 8/22/15 12:23 AM, Ian Lepore wrote:
On Fri, 2015-08-21 at 23:30 +0800, Julian Elischer wrote:
On 8/21/15 11:25 PM, Adrian Chadd wrote:
Ah, cool. I'll give it a whirl.

I'm a little worried about having all of the other cores spinning in
this case (mostly thermal; the machines get VERY LOUD when the CPUs
are spinning..)

make each spin with the pause instruction.. and for N seconds (N being
the CPU ID) or something
cpu_spinwait() is defined as ia32_pause() on i386 and amd64.

The problem is that ONLY x86 arches benefit from cpu_spinwait(), it's
just a nop on other arches, which turn into little radiant heaters for
long spins (like while waiting for APs to be released).

remind me again why it cant spin with a 'halt' instruction?

On ARM we have a really nice wait-for-event/signal-event pair of
instructions, where WFE would be a natural for cpu_spinwait(), but would
require a matching cpu_spinwake() type call to be sprinkled around to do
the matching SEV instruction.

-- Ian

freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to