Linux Gained Some Weight The Past Two Weeks: Around 200,000 Lines
Written by Michael Larabel in Linux Kernel on 29 May 2016 at 10:49 AM EDT. 37 Comments
LINUX KERNEL --
Over the past two weeks of the merge window for the Linux 4.7 kernel, around 200,000 lines of code was added.

If you didn't already read it, this morning I published my usual feature overview of the new Linux 4.7 kernel features that covers all of the big additions for Linux 4.7. Check that out for details, this article is just about the code-base size.

This morning on Linux Git I ran CLOC to get an estimate for the latest stats about the kernel's code-base.
Linux Git 2016-05-29:
---------------------------------------------------------------------------------------
Language                             files          blank        comment           code
---------------------------------------------------------------------------------------
C                                    23045        2222971        2045822       11328147
C/C++ Header                         17558         426824         729449        2797662
Assembly                              1415          47390         110839         241709
XML                                    181           3436            243          50370
make                                  2192           8266           7870          34967
Perl                                    47           4622           3597          24340
Bourne Shell                           190           2011           3367          10710
Python                                  44           1578           1677           8568
yacc                                     8            655            355           4327
HTML                                     4            509              0           4284
lex                                      8            299            288           1891
Bourne Again Shell                      48            390            261           1612
C++                                      1            231             58           1581
awk                                     10            132            129           1130
ASP.Net                                 16             21              0            571
NAnt script                              2            128              0            475
Pascal                                   3             49              0            231
Lisp                                     1             63              0            218
Objective C++                            1             55              0            189
m4                                       1             15              1             95
XSLT                                     6             13             27             71
vim script                               1              3             12             27
Windows Module Definition                1              0              0              8
---------------------------------------------------------------------------------------
SUM:                                 44783        2719661        2903995       14513183
---------------------------------------------------------------------------------------
CLOC pegs the lines of code at 14,513,183 while taking out comments, blank lines, etc. Though CLOC may not be 100% accurate as it does indicate a few lines of ASP.net code and such in the kernel, but provides a concise overview anyhow. The CLOC numbers are also fun for looking at the amount of Assembly still in the kernel (241,709 lines) relative to C (11,328,147 and 2,797,662 in headers).

Comparing that to running CLOC on the Linux v4.6 tag (14321350 code lines), that puts the kernel as gaining just under 200,000 lines of code for 4.7 (191,833 to be exact).

This is only somewhat larger than Linux 4.5 that clocked in at 14,141,508, or a 179k LOC difference between 4.5 and 4.6.

Of course, with some Git magic we can get a look at how much code really changed around between v4.6 and Git master: 9317 files changed, 562804 insertions(+), 270510 deletions(-). That's of course including documentation, Kconfig changes, etc. Comparing Linux 4.6 to Git master, that's more than a half million lines of code inserted and just over a quarter million lines of code deleted.

Representing a lot of this new code in Linux 4.7 comes down to the AMDGPU Polaris support. The AMDGPU changes amounted to more than 61,000 lines of new code in Linux 4.7: almost a third of the new lines added during the 4.7 merge window for the entire kernel. That's a lot to add AMD Polaris GPU support, but it will get even bigger!

In Linux 4.7 the Polaris support is using the existing AMDGPU display code while in Linux 4.8 or later is when the DAL display abstraction layer is coming to AMDGPU. AMDGPU's DAL code will allow for new display features and is based upon the proprietary driver code-base. DAL will make it possible to support FreeSync, HDMI 2.0, and more for this open-source kernel driver. But this yet-to-land DAL code weighs in at over 93,000 lines of code! That's part of the reason why it wasn't sent in for Linux 4.7 as the developers are still cleaning it up, removing some of the abstractions, etc. That cleaned up code will be smaller than when it was when originally published, but it's still going to be another significant addition to the kernel's code-base when it lands in a future cycle.

Anyhow, those are the numbers if you are curious about the size of Linux 4.7 so far. At least with the increased line count comes a ton of exciting Linux 4.7 features.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Popular News This Week