I'm a bit disappointed and slightly annoyed that this was published without a comment from any of the Kernel maintainers.
The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
11–20 of 58 posts
Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#12> The Linux kernel has been accidentally hardcoded to a maximum of 8 cores for the past 15 years and nobody noticed I can understand having a bug like that, but unnoticed for 15 years? more than 8 cores was rare 15 years ago, and as a percentage of chips sold is still rare, but presumably people with threadrippers ran benchmarks? optimized? etc? just doesn't seem possible
From what I understand what was limited to 8 cores is the scaling of the preemption delay (min_granularity / min_slice). Again from what I understand that what this is is the window during which a process can not be preempted, so this is only relevant when the scheduler has more tasks to run than available slices (the system is heavily / over - loaded).
I would assume well-administered systems where this would be relevant:
1. Are not overloaded
2. Have the important tasks pinned to avoid migrations
3. Have priorities configured to avoid preempting / descheduling their primary workloads
As such, on a well-administered system this would mostly translate to possibly over-pre-empting low-priority tasks (and most likely not pre-empting anything because the machine is configured with capacity for those ancillary / transient low priority tasks). This may show up during transient overloads, and worsen an already bad situation, but it probably wouldn’t show up during normal operations.
It also doesn’t seem accidental, the maintainers literally slapped an `min(8, …)` on there, so they explicitly designed the scaling to have an upper bound. Maybe it’s a mistake, maybe it’s too low, maybe it should be a tunable, but I’d think it makes sense to not allow the preemption delay to grow infinitely.
Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#13> The Linux kernel has been accidentally hardcoded to a maximum of 8 cores for the past 15 years and nobody noticed I can understand having a bug like that, but unnoticed for 15 years? more than 8 cores was rare 15 years ago, and as a percentage of chips sold is still rare, but presumably people with threadrippers ran benchmarks? optimized? etc? just doesn't seem possible
Yeah how come people running massive computers didn’t notice the limit?
Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#14One 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()
Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#15Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#16i’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.
linux running on 8 cores seems like a potentially good idea. one wants the kernel to have low latency with low variability.
Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#17Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#18Why? The article show no evidence of this being problematic.
> It can’t be good to reschedule hundreds of tasks every few milliseconds, maybe on a different core, maybe on a different die. It can’t be good for performance and cache locality.
Make a PoC and prove it.
Re: The Linux kernel has been accidentally hardcoded to a maximum of 8 cores
#19> The Linux kernel has been accidentally hardcoded to a maximum of 8 cores for the past 15 years and nobody noticed I can understand having a bug like that, but unnoticed for 15 years? more than 8 cores was rare 15 years ago, and as a percentage of chips sold is still rare, but presumably people with threadrippers ran benchmarks? optimized? etc? just doesn't seem possible
Yeah how come people running massive computers didn’t notice the limit?
The issue us more subtle: "[the minimum granularity] is supposed to allow tasks to run for a minimum amount of [3ms] when the system is overloaded".
That's supposed to scale with number of cores, but the scaling us limited to 8 cores. However, imho that's not even necessarily a bad thing. It's a trade off between responsiveness and throughput in overload situations. You don't want slices to become too tiny/large...