Linux Kernel Approaching 40 Million Lines of Code as AMD Driver Surpasses 6 Million
#Regulation

Linux Kernel Approaching 40 Million Lines of Code as AMD Driver Surpasses 6 Million

Hardware Reporter
3 min read

Despite removing legacy code, the Linux kernel continues to grow rapidly, with Linux 7.1 approaching the 40 million line mark while the AMD GPU driver expands past 6 million lines.

The Linux kernel development continues its relentless expansion, with Linux 7.1 on track to breach the 40 million line of code milestone despite recent cleanup efforts. As we approach the Linux 7.1-rc1 release closing the merge window, measurements show the kernel has grown by approximately 259,000 lines even with significant code removals.

Code Removals Not Enough to Slow Growth

Linux 7.1 has undergone substantial cleanup, removing several legacy components:

  • ISDN (Integrated Services Digital Network) subsystem
  • Ham radio drivers
  • Obsolete PCMCIA drivers
  • Some PCI drivers
  • Beginning stages of Russia's Baikal CPU support removal
  • Initial decommissioning of Intel 486 CPU support

These removals totaled 138,000 lines of code, which would have been significant in smaller projects. However, for the Linux kernel, this represents only a small fraction of the overall growth.

Breaking Down the Numbers

The cloc (count lines of code) utility provides detailed measurements of the kernel composition:

Linux 7.0:

  • Total lines: 39,621,378
  • Blank lines: 4,991,874
  • Code comments: 4,737,829
  • Actual code: 29,891,675

Linux 7.1 (current):

  • Total lines: 39,880,636
  • Blank lines: 5,015,790
  • Code comments: 4,775,889
  • Actual code: 30,088,957

The kernel has crossed the significant threshold of 30 million lines of actual code, with blank lines and comments pushing the total toward 40 million. Linux 7.2 is expected to be the release that crosses the 40 million line mark in total.

AMD Driver Expansion

While the overall kernel grows, the AMD GPU driver stack shows particularly significant expansion. The modern AMD kernel graphics driver, including AMDGPU, AMDKFD, display core (DC), and auto-generated headers, has grown from 6,049,235 lines in Linux 7.0 to 6,162,946 lines in Linux 7.1 - an increase of over 113,000 lines.

Linux size AMD driver

This growth reflects the increasing complexity of modern graphics drivers as they support more features, newer hardware, and more sophisticated power management and virtualization capabilities.

Context and Implications

The continued growth of the Linux kernel, despite removal efforts, highlights several important aspects of modern operating system development:

  1. Feature Expansion: New hardware support, security enhancements, and performance improvements continue to outweigh code removals.

  2. Maintenance Challenge: Larger codebases increase maintenance burden, though the kernel's modular design helps mitigate this.

  3. Developer Productivity: Tools like cloc help developers understand codebase composition and identify optimization opportunities.

  4. Legacy Code Removal: While difficult, the ongoing cleanup of legacy components (like ISDN and 486 support) is essential for long-term kernel health.

The kernel's growth trajectory shows no signs of slowing, with each release adding more functionality than is deprecated. This pattern has continued for decades, suggesting that the 50 million line mark may not be far off in the coming years.

For kernel developers and maintainers, these statistics provide valuable context for planning development cycles, allocating resources, and prioritizing features. The balance between adding new capabilities and maintaining code quality remains one of the central challenges in Linux kernel development.

Those interested in tracking kernel development can monitor the official Linux kernel mailing list and the kernel.org website for the latest releases and development discussions.

Comments

Loading comments...