this may not be an error. i’m doing high performance gamedev on a 7950x with smt off. 16 cores. i can only use 8 to run the game. mutex and other synchronization gets highly variable latency if the first 8 cores try to talk to the second 8. i hadn’t heard of this before i started this game, but apparently it’s well known, and nobody makes a chip with more than 8 cores that can have low variability synchronization. li…
You’re describing behaviour with AMD’s Infinity Fabric, which groups cores into CCDs of 8 on 7000 series chips. Essentially, a 16 core AMD CPU is actually two separate 8 core CPUs glued together with a link. Intel does not have this limitation.
The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
31–40 of 58 posts
Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#32Performance was critical, and we had beefy developer machines (for the time), all with 8 cores. Development was done in C++, and as the project progressed the system performed very well, and more than exceeded our performance goals.
Fast forward a couple of years and it became time to put the thing into production on a massive 128 core Windows server. Much to our surprise the performance completely tanked when scaled to all 128 cores.
After much debugging, it turned out that the system spent most of its time context switching instead of doing actual work, and because we used atomic operations for message queue functionality (compare & swap), it effectively meant clearing the cache for every core working with/on that piece of heap memory, so every time a task passed a message to something else, it effectively reset the CPU cache, which would then have to be refetched from RAM. This was not (as big) a problem on the developer machines, as there were fewer cores and each task had more work queued up for it, but with 16 as many cores to work with, it simply ran out of tasks to do faster.
The "cure" was to limit the system to run on 8 cores just like the developer machines, and AFAIK it still runs in that way all these years later.
Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#33Wow big oooff One thing I noticed is that min/max functions are tricky to use and it's easily to accidentally do the wrong thing, like in this case Because you think "you want the minimum (that is, the number should be at least 8) of those numbers to be 8" then you slap min(). And you got it wrong. You should have used max()
But that aside, I feel your pain around min() and max(). In my case, I feel the problem comes from language (I mean, the real life one): I speak Italian and in Italian the words for "at most" are "al massimo" (i.e. "at max") and the words for "at least" are "come minimo" (i.e. "as min") that is, the exact opposite of their mathematical meaning. I've taken an habit of reviewing 3 times any piece of code where I write "min" or "max" for this reason.
Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#34Wow big oooff One thing I noticed is that min/max functions are tricky to use and it's easily to accidentally do the wrong thing, like in this case Because you think "you want the minimum (that is, the number should be at least 8) of those numbers to be 8" then you slap min(). And you got it wrong. You should have used max()
I appears the author has misunderstood exactly what was its purpose, and that setting this scaling factor unbound beyond 8 cores would have detrimental effects even if there are more cores available.
Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#35If I've understood this article right (possibly not as it's not so clear): * On single core machines the scheduler interval is quite fine grained to ensure responsiveness. * As the number of cores grows, the scheduler interval increases (by default), presumably because there's greater cost to task switching across more cores and the greater number of cores inherently increases the responsiveness anyway. * BUT – and t…
Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#36If capped to 8 it would be very clear
Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#37Earlier quoted context omitted.
You’re describing behaviour with AMD’s Infinity Fabric, which groups cores into CCDs of 8 on 7000 series chips. Essentially, a 16 core AMD CPU is actually two separate 8 core CPUs glued together with a link. Intel does not have this limitation.
yeah? a xeon with 16 cores might have to be my next pc. pricey though.
Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#38Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#39Reading the other comments here it seems the title is stupid and wrong and my suspicion that this can't be right was correct.
Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#40Wow big oooff One thing I noticed is that min/max functions are tricky to use and it's easily to accidentally do the wrong thing, like in this case Because you think "you want the minimum (that is, the number should be at least 8) of those numbers to be 8" then you slap min(). And you got it wrong. You should have used max()
x.atLeast(10).atMost(100)
Very easy to read in my opinion