Linux Optimization Patches Significantly Speed-Up Debuggers Using /proc/kcore
A set of Linux kernel patches posted on Friday by Meta/Facebook provide for sizable performance optimizations for applications leveraging /proc/kcore such as for debuggers.
The /proc/kcore file is for representing the physical memory of the system in core file format. The /proc/kcore file is commonly used by debuggers like GDB and Drgn but it turns out it can be much better optimized.
Meta engineer Omar Sandoval posted the set of four patches on Friday for speeding-up interactions with /proc/kcore:
Drgn is a programmable debugger that supports scripting in Python and can be used for debugging the Linux kernel and other purposes. Drgn particularly prides itself on its scripting abilities and originated at Meta for their efforts on debugging the Linux kernel.
For those using Drgn or other /proc/kcore users can find these new kernel optimization patches via the Linux kernel mailing list.
The /proc/kcore file is for representing the physical memory of the system in core file format. The /proc/kcore file is commonly used by debuggers like GDB and Drgn but it turns out it can be much better optimized.
Meta engineer Omar Sandoval posted the set of four patches on Friday for speeding-up interactions with /proc/kcore:
"The performance of /proc/kcore reads has been showing up as a bottleneck for drgn. 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 patch series fixes 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.
Since I have a stake in /proc/kcore and have modified it several times, the final patch volunteers me to maintain it."
Drgn is a programmable debugger that supports scripting in Python and can be used for debugging the Linux kernel and other purposes. Drgn particularly prides itself on its scripting abilities and originated at Meta for their efforts on debugging the Linux kernel.
For those using Drgn or other /proc/kcore users can find these new kernel optimization patches via the Linux kernel mailing list.
3 Comments