Linux 6.14 To Perform Better With The Drgn Debugger Via Faster /proc/kcore Reads
- Reference: 0001519743
- News link: https://www.phoronix.com/news/Linux-6.14-Faster-kcore-Reads
- Source link:
Back in November I originally brought up the tentative patches at the time around [1]Linux kernel optimizations for speeding-up debuggers reading /proc/kcore . That work has now crossed the finish line and has been submitted for pulling by Linus Torvalds into the Linux 6.14 kernel.
Christian Brauner explains in the pull request:
"The performance of /proc/kcore reads has been showing up as a bottleneck for the drgn debugger. drgn scripts often spend ~25% of their time in the kernel reading from /proc/kcore.
A lot of this overhead comes from silly inefficiencies. This pull request contains fixes for the low-hanging fruit. The fixes are all fairly small and straightforward. The result is a 25% improvement in read latency in micro-benchmarks (from ~235 nanoseconds to ~175) and a 15% improvement in execution time for real-world drgn scripts:
- Make /proc/kcore entry permanent.
- Avoid walking the list on every read.
- Use percpu_rw_semaphore for kclist_lock.
- Make Omar Sandoval the official maintainer for /proc/kcore."
More details via [2]this pull request .
Drgn is the programmable debugger developed by Meta that can allow using Python scripts for debugging the Linux kernel and more. More details on Drgn can be found via the [3]GitHub project site .
[1] https://www.phoronix.com/news/Linux-Faster-Dragn-proc-kcore
[2] https://lore.kernel.org/lkml/20250118-vfs-kcore-913a66eabd03@brauner/
[3] https://github.com/osandov/drgn
Type44Q