Feature #10278
closedPrefer use of mwait on AMD Zen
100%
Description
From talking with the folks at AMD, we should prefer the use of mwait rather than the hlt instruction for idling. It turns out that we've historically disabled mwait on AMD due to issues in family 0xf and never went back and revisited that since then. While we should definitely do it for Zen (family 0x17), it may make sense to do it for others as well. In this case, there is a large performance delta between using hlt and mwait due to the implementation on Zen that means we should prefer mwait.
To validate that we were now using mwait, I used mdb in the following way on an AMD EPYC (Zen) system:
> ::walk cpu | ::print cpu_t cpu_m.mcpu_idle_cpu ! sort | uniq -c 128 cpu_m.mcpu_idle_cpu = cpu_idle_mwait
Then I went and ran the utiltests to make sure they all still passed and that there wasn't anything odd here.
Updated by Electric Monk over 3 years ago
- Status changed from New to Closed
git commit 007d65bc4ff2f2e56cc6fae2335af27bf16d373f
commit 007d65bc4ff2f2e56cc6fae2335af27bf16d373f Author: Robert Mustacchi <rm@joyent.com> Date: 2019-02-08T14:33:06.000Z 10278 Prefer use of mwait on AMD Zen Reviewed by: John Levon <john.levon@joyent.com> Reviewed by: Jordan Hendricks <jordan.hendricks@joyent.com> Approved by: Hans Rosenfeld <hans.rosenfeld@joyent.com>