htop
htop copied to clipboard
Linux: `/proc/<pid>/status` refactor no2
#1211 showed reading /proc/<pid>/status
might have a significant
performance impact. Do not read by default only if actually needed,
since the permitted capabilities are no longer gather from it.
Improves: https://github.com/htop-dev/htop/commit/8ea144df7494bad0c46d3bf4f16c9a6556c500d2 ("Linux: Refactor /proc/
Can we just detect container status once per process instead of per thread? According to pid_namespaces(7)
, threads are required to be in the same PID namespace, so doing that once per thread seems to be extra work with no gain.
@cgzones What's missing from this branch to be ready?
@cgzones Thank you very much for these Patches. We would love to try these in production. This PR only applies to current upstream and not latest 3.3.0 release. Since we are unfortunately not as firm with C we can only do so much as to rebuild the debian package for 3.3.0 with a patch applied. This fails when trying this PR for obvious reasons since it has been based on latest upstream master, which apparently includes some significant changes compared to 3.3.0.
So may I ask you in case this is not a lot of effort, could you provide with a patch which includes your improvements and cleanly applies to release 3.3.0? Thanks so much in advance!
@kartoffelheinz The code in linux/LinuxProcessTable.c changed quite a lot with conflicting changes, so at the moment I am unable to supply rebased patches for 3.3.0.