News for hackers. Stuff that matters.
Re:No nuances, just buggy code (was: related to Spinlock imp... by rowanG077 on Sunday January 05, 2020 @01:53PM (#21963098)
How is it possible that there are only 2 background processes? Any normal Linux system has hundreds maybe even thousands of processes running.
Re:No nuances, just buggy code (was: related to Spinlock imp... by Dylan16807 on Sunday January 05, 2020 @02:13PM (#21963225)
Two processes that aren't asleep.

What's your CPU use right now? I bet it's less than 200%. Or will be if you exclude your web browser.

The typical background process is active far less than one percent of the time.

Re:No nuances, just buggy code (was: related to Spinlock imp... by rowanG077 on Sunday January 05, 2020 @04:42PM (#21964336)
That doesn't matter that still doesn't guaranty yielding the thread will allow another specific process to run. Especially not if that process is soft locked to a different core.
Re:No nuances, just buggy code (was: related to Spinlock imp... by Dylan16807 on Sunday January 05, 2020 @05:55PM (#21964796)
> That doesn't matter that still doesn't guaranty yielding the thread will allow another specific process to run.

Right, but you would expect the "switch to another thread" function to eventually pick the one that's sitting there with a growing and growing time since it last got a chance to run.

It would be easy to guarantee that if any thread has been waiting for at least x amount of time, then any context switch without long-waiting local threads will pick that thread. (If it's on the same NUMA node, at least.) But in the actual implementation that time can build up to a huge amount with no effect, even as thousands of yield calls go by.

> Especially not if that process is soft locked to a different core.

Yeah, that's the problem, it's getting locked to a core even though other cores are desperate for threads to run.