Hacker News
Uncovering Hidden TCP Throttling in the Linux Kernel
freedomben
|next
[-]
waschl
|root
|parent
|next
[-]
whilenot-dev
|root
|parent
[-]
The rest is reading through the well documented linux source code, with the help of a map[3] I guess.
[0]: https://www.brendangregg.com/systems-performance-2nd-edition...
[1]: https://www.brendangregg.com/bpf-performance-tools-book.html
rid
|next
|previous
[-]
cgroup.memory=nosocket
If you're not bothered about socket memory counting towards the cgroup's limit (it's usually negligible).
basilikum
|next
|previous
[-]
Maybe I'm missing something, but can someone explain why memory pressure is detected like this in the first place? The article goes on to say that there was a TODO comment in the source to scale the scanning window proportional to the memory size, but why is memory pressure even measured like this without considering the free memory at all? Am I missing something or does that indeed make no sense?
majke
|root
|parent
[-]
basilikum
|root
|parent
|next
[-]
> The memory controller helps you set limits for the maximum memory consumption of a service, which we are actually not using. It's the well-known memory.high, memory.max, etc. But the memory controller has an undocumented feature, which activates when the controller is only loaded.
Why is there even memory pressure in the first place when the cgroup does not have a limit and there is lots of free memory?
montjoy
|next
|previous
[-]
> We launch nginx as a systemd service, and systemd places each service into its own cgroup and sets default controllers
Thank you for sharing.
InsidiousWombat
|next
|previous
[-]
IIRC tmpfs is also charged to the cgroup that uses it.
It makes sense from memory system perspective (else there would be a ways for cgroup to leak memory usage) but it also leads to many unintuitive debug sessions, and under-utilization of free RAM for caching
dedalus
|next
|previous
[-]
jeffbee
|next
|previous
[-]
mk12
|root
|parent
|next
[-]
the8472
|root
|parent
|next
|previous
[-]
hosteur
|root
|parent
|next
[-]
InsidiousWombat
|root
|parent
[-]
Many, many apps do "download to tmpfile then move to final location when finished", from browsers thru Steam to package managers.
jeffbee
|root
|parent
|previous
[-]
tremon
|root
|parent
|next
|previous
[-]
It would take major engineering effort in the VFS layer to avoid locking the page table during writeout, but that's what a proper solution would look like in my eyes.
tonymet
|next
|previous
[-]
great effort debugging and isolating the root cause, but also an unnecessary issue.
eikenberry
|next
|previous
[-]
That TODO was removed about a month ago but remains there in spirit.
https://github.com/torvalds/linux/commit/0041eef981cc55bb1f3...
bakugo
|root
|parent
[-]
> It appears that TODOs to LLMs are like red rags to a bull.
So... big open source projects are now forced to remove important TODOs from their code, because of vibe coders spamming patches for them?
Every day, I discover a new way in which AI is killing open source.
wongarsu
|root
|parent
|next
[-]
The structural issue is more that the threshold for getting the initial limit in when you first write the code is very low, the standard of evidence for changing it afterwards is very high because you don't want to make things worse for anyone
The issue is more in how to communicate to all potential contributors (of which there are a lot more, now that llms promise an easier path to the still prestigious mark of "kernel contributor"). Improving on the current approach surely isn't hard, proving that your version is better is the hard part, and that has to be communicated
InsidiousWombat
|root
|parent
|previous
[-]
Roadmap or a ticketing system is far better place for it, I only use it in currently work in progress code to denote which part isn't implemented yet
kalak
|next
|previous
[-]
The disclaimer now belongs on articles that were human written?
fullstop
|root
|parent
[-]
hollowonepl
|root
|parent
[-]
rstuart4133
|next
|previous
[-]
But limiting TCP socket memory use on a cgroup that could have TB of memory available to it and is not under memory pressure - WTF? The global kernel algorithm for socket memory still applies, so why have this extra socket limit on a cgroup when the user hasn't constrained the cgroup's memory?
We regularly see posts from kernel devs sweating blood to squeeze an extra couple of % of performance under some rare circumstances, yet here we have a process being throttled by more than 80% for no good reason. This has got to be one of the most egregious kernel performance bugs I've seen in a long time. And it's been this way for 11 years.