News for hackers. Stuff that matters.
Re:No nuances, just buggy code (was: related to Spinlock imp... by pizlonator on Sunday January 05, 2020 @01:17PM (#21962852)
I’m pretty sure that the Linux behavior makes sched_yield more suitable to the 40-yields optimization I use for locks.

I don’t buy claims about lock behavior based on microbenchmarks. Microbenchmarks have wildly different behavior from one another so it stands to reason that they have wildly different behavior from real code.

Linus’s excuse is that if you use a real lock then shit is good. That’s a pretty good excuse IMO.

Re:No nuances, just buggy code (was: related to Spinlock imp... by gok on Sunday January 05, 2020 @02:51PM (#21963555)
Yeah Linus is correct here, he's just not directly addressing why it works on some other schedulers.
Re:No nuances, just buggy code (was: related to Spinlock imp... by spamizbad on Monday January 06, 2020 @10:52AM (#21970018)
One reason they might act that way: They have nowhere near the amount of NUMA or cache locality optimization work the Linux kernel possesses. Thinking of the 2nd-generation Threadripper issues in Windows in particular.
Re:No nuances, just buggy code (was: related to Spinlock imp... by pizlonator on Monday January 06, 2020 @01:55PM (#21971899)
That's quite likely. I think that the sched_yield behavior is throughput-optimized, which is consistent with what you get when an OS is server-optimized like Linux.
Re:No nuances, just buggy code (was: related to Spinlock imp... by pizlonator on Sunday January 05, 2020 @03:30PM (#21963828)
Agreed.