4 ms·
Despite the complexity of the cause of the problem, the fix was really simple: they just introduced 64 bytes of padding between the two struct members to guaran
by MontyCarloHall 4y ago
Despite the complexity of the cause of the problem, the fix was really simple: they just introduced 64 bytes of padding between the two struct members to guarantee that they never could fall within the same cache line. Sometimes the best solution is brute force!
- almost_usual 4y agoThey still saw the same performance though due to “true sharing” or CPU enforced memory ordering on a highly contended variable. Patching the JDK to skip the secondary cache altogether was the real solution.
- pestatije 4y agoWeird they added 64 bytes and not 56, which is the minimum required to have the two variables in different cache lines.
- basilgohar 4y agoMaybe the 64 bytes was better for some kind of alignment with other architectural structures....