Repository navigation
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
ddc9102 to
5bc1750
Compare
|
Looks like Rust switched to ISB over YIELD: rust-lang/rust@c064b65 |
|
What does it help with? If you are worried about the GC suspension starvation, it would be less code duplication to fix it by moving the check for coop threshold to managed code, like it is done in native AOT: |
I do not think that the justification in this PR applies to our use. We do not care about long the yield takes - the calibration of the spin loops will take care of yield taking less time. We do care about power saving and hyper-threading core scheduling effects that this PR has no data about. |
I'll ask the ARM folks about it, I thought that Yield is a sort of nop while ISB is closer to x64's pause so should be better energy-wise.
Ah, ok, will change to that |
The Arm manual suggests that the hw implementation may take advantage of the hint. So it can be nop on one Arm hw, but actual useful hint on a different Arm hw. It does not make it easier to measure.
Wall clock time != energy consumption. It would be a good idea to check about this with Arm folks. |
Do you plan to work on this? If not, I am going to do it - it will help to reduce overhead for small number of spin counts. |
Ah, sure feel free, I am not sure I understood what you meant after looking at it |
@a74nh @TamarChristinaArm - do you have more information on this? |
|
Yes, in current hardware, yield is mostly a nop. Switching to an ISB will create a stall and therefore reduce power. Also, it should improve spin lock performance. Architecturally, it isn’t the best solution in the long term as it’s just relying on a side effect of the ISB forcing the cpu flush. An alternative would be to create a data dependency between the loads (i.e. between the data returned from one load, and the address of the next) which would essentially create a pause which a full cpu flush. However, that’s not been tested in anger – maybe something for the new year. Future hardware will have WFET and should be a better fit, but that’s not available yet. |
It seems to be simple unless I am missing something. Presumably, it should allow gc to interrupt at any point while previously we had to enter preemptive mode for too many iterations and could slightly stall gc in coop.
Also, I heard modern ARM cpus should use ISB instead of Yield