Prefer use of mwait on AMD Zen
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 1 year ago
- Status changed from New to Closed
commit 007d65bc4ff2f2e56cc6fae2335af27bf16d373f Author: Robert Mustacchi <firstname.lastname@example.org> Date: 2019-02-08T14:33:06.000Z 10278 Prefer use of mwait on AMD Zen Reviewed by: John Levon <email@example.com> Reviewed by: Jordan Hendricks <firstname.lastname@example.org> Approved by: Hans Rosenfeld <email@example.com>