bk99.de entertain the web since 1997

Kernel developer wants to escape “dependency hell”

Summary

In January 2022 Ingo Molnar presented the “Fast Kernel Headers” project, a comprehensive overhaul of the Linux kernel’s roughly 10,000 header files. With more than 2,200 patches changing more than half of all source files, the “dependency hell” was to be untangled. According to initial benchmarks, build time was reduced by 78 percent, and in some cases considerably more for incremental builds.

Ideas

  • Intertwined header dependencies force the compiler to process far more code than necessary.
  • Type and API definitions were separated from each other.
  • Inline functions were moved out of headers.
  • Headers were to become compilable on their own.

Insights

  • In large projects, technical debt in the build structure costs a lot of computing time every day.
  • Very large restructurings are hard to get into the main branch, even when they help measurably.

Facts

  • The patches had been ported to four CPU architectures.
  • Greg Kroah-Hartman gave the first, positive feedback.

References

Critique

  • The report adopts the author’s benchmark figures; independent measurements are missing.

Recommendations

  • Use ccache or incremental builds to speed up kernel compilation.
  • In your own C projects, keep headers lean and avoid unnecessary mutual inclusion.

Read the original article

Search the Web Archive