News for hackers. Stuff that matters.
Re:Making the Tokio scheduler 10x faster by carllerche on Monday October 14, 2019 @02:16PM (#21251164)
Relaxed ordering impacts the compiler. There are a number of optimizations it cannot make. I am not sure exactly what those are, but it is measurable.
Re:Making the Tokio scheduler 10x faster by CodesInChaos on Tuesday October 15, 2019 @07:34AM (#21257443)
The only forbidden optimization I could come up with is:

    x = load-relaxed(a)
    ...
    f(x)
cannot be turned into

    x0 = load-relaxed(a)
    ...
    x1 = load-relaxed(a)
    f(x1)
while this would be possible with normal memory access.

so under register pressure the compiler would be required to spill something onto the stack instead of just reloading `x` from the original location.

Re:Making the Tokio scheduler 10x faster by carllerche on Tuesday October 15, 2019 @08:24AM (#21257663)
Last time I spoke about this topic w/ the rust compiler devs, they mentioned there were some LLVM "bugs" with regards to optimizations and Relaxed, as in LLVM is too conservative.
Re:Making the Tokio scheduler 10x faster by dunkelheit on Monday October 14, 2019 @02:54PM (#21251496)
Probably some reordering? Would be interesting to compare generated assembly.
Re:Making the Tokio scheduler 10x faster by carllerche on Monday October 14, 2019 @11:32PM (#21255331)
I believe there are some LLVM "bugs" with regards to Relaxed ordering. I don't know the specifics.