RFR: 8322535: Change default AArch64 SpinPause instruction

Andrew Haley aph at openjdk.org
Thu Jan 18 19:13:13 UTC 2024


On Thu, 18 Jan 2024 13:22:05 GMT, Evgeny Astigeevich <eastigeevich at openjdk.org> wrote:

> > OK, so now I'm really curious, given that ISB has a lot of work to do because it has to flush and restart a bunch of on-the-fly instructions.
> 
> According to our hardware enigeers `isb` don't need to flush anything. It can just stop fetching instructions until the backend gets idle. 

How is that any better? I get that how it might work, but that means that you have to wait for every instruction in progress to retire. And in a CPU with a hundreds of instructions on the fly that's no small thing. You have a choice, either to speculate and then rollback when the ISB is actually executed, or to stop speculating for a while. The effect is the same.

> It's clearly faster

It's a delay.

> and cheaper than mul/div instructions. Mul/div will spin up a whole complex arithmetic unit that might otherwise be idle. Except some cases, mul/div don't really pause CPU because CPU can execute instructions around it. For example it can get more loads out into the pipeline.

Definitely so, yes.

> Stuart (@stooart-mon) is from arm. He might ask hardware engineers as well. Maybe he knows more or might provide some data.

OK. What concerns me is the blast radius of all this. It'd be nice to have some actual experiments.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17430#issuecomment-1899058125


More information about the hotspot-dev mailing list