How Is Linux Built? A Conversation with Greg Kroah-Hartman preview image

This is a summary of an interview with Greg Kroah-Hartman, a Linux kernel maintainer who has participated in Linux kernel development for 25 years, covering how Linux is developed and maintained. It provides deep insights into the development process, community structure, and how technical and human elements harmonize. It also explores why Linux has become the most widely used operating system in the world.


Linux's Development Cycle and Structure

The 9-Week Release Cycle

  • Linux performs a new release every 9 weeks.
    • First 2 weeks: The Merge Window opens for merging new features.
    • Following 7 weeks: Only bug fixes and regression fixes are made.
  • Greg's explanation:

    "The 9-week cycle relieves pressure on developers. If a feature isn't ready, you just wait for the next 9 weeks. This creates an environment where maintainers don't have to force-merge incomplete features."

Differences from Past Long Development Cycles

  • In the past, development cycles lasted 6 months to 2-3 years, which created enormous pressure for merging new features.
  • The current short cycle provides flexibility and efficiency.

    "If a feature isn't ready, just put it in the next release. This provides a better environment for both developers and maintainers."


Linux's Ubiquity

Linux Is Everywhere

  • Linux is used in Android devices, servers, smart TVs, embedded systems, the International Space Station (ISS), European air traffic control systems, financial markets, and more.
  • Greg's statement:

    "Linux has taken over the world, but nobody noticed. Android devices alone number over 4 billion running Linux."

Mobile vs Server: Differences in Lines of Code

  • The Linux kernel consists of approximately 40 million lines of code.
    • Servers: approximately 1.5 million lines
    • Mobile (Android): approximately 4 million lines
  • Why is mobile more complex?
    • Mobile devices must interact with diverse hardware including power management, clock control, battery management, and modem communication.

      "Smartphones are among the most complex devices in terms of software."


Linux Kernel Structure and Role

Difference Between Kernel and User Space

  • Kernel: Controls hardware, manages memory and devices, and provides a common interface to user space.
  • User space: Applications and processes running on top of the kernel.
  • Greg's explanation:

    "The kernel's role is to abstract all hardware so that programs work the same way."

Drivers and Kernel Integration

  • Linux adopts a monolithic kernel structure, with all drivers included within the kernel.
    • This integrates common code across drivers, reduces code size, and facilitates maintenance.

      "Linux drivers are on average about one-third smaller than drivers on other operating systems."


The Human Element of Linux Development

A Trust-Based Development Model

  • Linux development is based on trust.
    • Maintainers trust not only the quality of code but also whether contributors will continue to participate in maintenance.

      "We all make mistakes. What matters is that there's someone to fix them."

Hierarchical Structure

  • The Linux kernel has a hierarchical structure consisting of approximately 800 maintainers and 4,000 contributors.
    • Contributors send patches to maintainers.
    • Maintainers pass them up the hierarchy, and ultimately Linus Torvalds merges them.

Contributor Diversity

  • Every year, approximately 4,000 developers from about 500 companies contribute to Linux.
    • Most contributors are paid by their companies and contribute to Linux according to company needs.

      "Linux was built to solve everyone's problems. When you solve one person's problem, it ends up solving everyone's problem."


How to Contribute to Linux

Tips for Your First Contribution

  • Contributing to Linux is simpler than you might think.
    1. Find and fix a small issue (e.g., fixing a typo in a comment).
    2. Write a patch and email it to the maintainer.
    3. Receive a review, revise if needed, and resubmit.

      "Everyone has their moment of submitting their first patch. Start with small fixes."

Benefits of Contributing

  • Skill improvement: The Linux community gathers the world's best developers, and you can grow by collaborating with them.
  • Job opportunities: Experience contributing to Linux is a significant strength on a resume.

    "There's a joke that if you contribute to Linux three times, you're guaranteed a job. But it's not really a joke."


Linux and New Technologies

The Introduction of Rust

  • Linux has recently adopted the Rust language to strengthen memory safety.
    • Currently, approximately 25,000 lines of Rust code are included in the kernel.
    • Rust is expected to be particularly useful in driver development.

      "Rust can prevent many bugs. But it's not a perfect solution, and logical bugs can still exist."

Future Changes

  • Linux continues to evolve to accommodate new hardware and use cases.
    • Examples: new I/O paths, security models, power management features, etc.

      "Linux is evolution. Not intelligent design, but change driven by necessity."


Conclusion

Linux is not just an operating system; it is a community where people and technology harmonize. Based on trust and collaboration, it has become the most widely used operating system in the world and will continue to evolve. Contributing to Linux goes beyond writing code; it is participating in building a better world.

"Linux never ends. As long as new hardware comes out, Linux will continue to evolve." - Greg Kroah-Hartman