The Linux Scheduler: A Decade of Wasted Cores [pdf]
I&#x27;ve worked scheduling bugs in other kernels before (Linux is not an outlier here). The key metric we keep an eye on is run queue latency, to detect when threads are waiting longer than one would expect. And there&#x27;s many ways to measure it; my most recent is runqlat from bcc&#x2F;BPF tools, which shows it as a histogram. eg:<p><pre><code>   # .&#x2F;runqlat 
   Tracing run queue latency... Hit Ctrl-C to end.
   ^C
        usecs               : count     distribution
            0 -&gt; 1          : 233      |***********                             |
            2 -&gt; 3          : 742      |************************************    |
            4 -&gt; 7          : 203      |**********                              |
            8 -&gt; 15         : 173      |********                                |
           16 -&gt; 31         : 24       |*                                       |
           32 -&gt; 63         : 0        |                                        |
           64 -&gt; 127        : 30       |*                                       |
          128 -&gt; 255        : 6        |                                        |
          256 -&gt; 511        : 3        |                                        |
          512 -&gt; 1023       : 5        |                                        |
         1024 -&gt; 2047       : 27       |*                                       |
         2048 -&gt; 4095       : 30       |*                                       |
         4096 -&gt; 8191       : 20       |                                        |
         8192 -&gt; 16383      : 29       |*                                       |
        16384 -&gt; 32767      : 809      |****************************************|
        32768 -&gt; 65535      : 64       |***                                     |
</code></pre>
I&#x27;ll also use metrics that sum it by thread to estimate speed up (which helps quantify the issue), and do sanity tests.<p>Note that this isolates one issue -- wait time in the scheduler -- whereas NUMA and scheduling also effects memory placement, so the runtime of applications can become slower with longer latency memory I&#x2F;O from accessing remote memory. I like to measure and isolate that separately (PMCs).<p>So I haven&#x27;t generally seen such severe scheduling issues on our 1 or 2 node Linux systems. Although they are testing on 8 node, which may exacerbate the issue. Whatever the bugs are, though, I&#x27;ll be happy to see them fixed, and may help encourage people to upgrade to newer Linux kernels (which come with other benefits, like BPF).