rusted-kernel.com

Rust in the Linux Kernel

A version-by-version measurement of how Rust is growing inside the mainline kernel tree — every .rs file counted, sized, categorised by purpose and measured with cloc.

6.0 7.1  · 19.1× SLOC · 12.0× files since 6.1 · 0.31% of the kernel

Range 6.0.19 … 7.1.3  ·  Series 22  ·  Generated 2026-07-09  ·  CLOC tool v1.98  ·  Source kernel.org

Latest snapshot · 7.1.3

Where Rust stands in the newest analysed release.

Files · 7.1.3

349

Rust source files (.rs)

Lines of code

93,245

SLOC (cloc, excl. comments/blanks)

On-disk size

4.6 MiB

total .rs payload

Comment lines

37,782

doc density 0.41× code

Share of kernel

0.31%

of 30.1M SLOC · all languages

Categories

13

distinct purposes in-tree

Driver subsystems

6

shipping Rust drivers

Rust's share of the kernel

The whole mainline tree is about 30.1M lines of code across 44 languages — overwhelmingly C and C headers. Rust is still a sliver, but a fast-growing one: it went from 0% in 6.0 (no .rs at all) to 0.019% when it first landed in 6.1, to 0.31% in 7.1.

0.31% of the kernel's 30.1M SLOC is Rust (93,245 of 30,101,072 lines). Of that, ~47.0k is vendored crates; first-party kernel Rust is 46.3k (0.154%).

Rust share of kernel · per version

~/rusted-kernel.com0.00%0.12%0.23%0.35%6.0.19: 0.000% of kernel SLOC6.06.1.177: 0.019% of kernel SLOC6.16.2.16: 0.022% of kernel SLOC6.26.3.13: 0.022% of kernel SLOC6.36.4.16: 0.030% of kernel SLOC6.46.5.13: 0.031% of kernel SLOC6.56.6.144: 0.033% of kernel SLOC6.66.7.12: 0.033% of kernel SLOC6.76.8.12: 0.035% of kernel SLOC6.86.9.12: 0.036% of kernel SLOC6.96.10.14: 0.021% of kernel SLOC6.106.11.11: 0.023% of kernel SLOC6.116.12.95: 0.034% of kernel SLOC6.126.13.12: 0.037% of kernel SLOC6.136.14.11: 0.041% of kernel SLOC6.146.15.11: 0.049% of kernel SLOC6.156.16.12: 0.066% of kernel SLOC6.166.17.13: 0.080% of kernel SLOC6.176.18.38: 0.124% of kernel SLOC6.186.19.14: 0.302% of kernel SLOC6.197.0.14: 0.303% of kernel SLOC7.07.1.3: 0.310% of kernel SLOC7.1

Kernel SLOC by language · 7.1.3

C: 19,432,437 SLOC (64.56%)C64.6%C/C++ headers: 8,232,703 SLOC (27.35%)C/C++ headers27.4%Other: 2,110,113 SLOC (7.01%)Assembly: 232,574 SLOC (0.77%)Rust: 93,245 SLOC (0.31%)Rust · 0.31%
C · 64.56%C/C++ headers · 27.35%Other · 7.01%Assembly · 0.77%Rust · 0.31%

Growth by category

Rust source lines (SLOC) per kernel release, stacked by purpose. Two stories overlap here: the kernel's own Rust — the safe-abstraction crate plus production drivers — grows steadily release over release, while the large step at 6.19 is the one-time in-tree vendoring of the proc-macro crates (syn, quote, proc-macro2) that the kernel's macros depend on.

RUST SLOC BY PURPOSEsource: kernel.org · latest patch of each series · 6.0 → 7.1025,00050,00075,000100,00006.06.1.177 — Kernel crate: 238 SLOC6.1.177 — Vendored crates: 4,115 SLOC6.1.177 — Procedural macros: 284 SLOC6.1.177 — Generated bindings: 33 SLOC6.1.177 — Core runtime & shims: 37 SLOC6.1.177 — Samples & examples: 38 SLOC6.1.177 — Kernel build tooling: 132 SLOC4,8776.16.2.16 — Kernel crate: 720 SLOC6.2.16 — Vendored crates: 4,146 SLOC6.2.16 — Procedural macros: 389 SLOC6.2.16 — Generated bindings: 32 SLOC6.2.16 — Core runtime & shims: 45 SLOC6.2.16 — Samples & examples: 79 SLOC6.2.16 — Kernel build tooling: 132 SLOC5,5436.26.3.13 — Kernel crate: 970 SLOC6.3.13 — Vendored crates: 3,890 SLOC6.3.13 — Procedural macros: 389 SLOC6.3.13 — Generated bindings: 33 SLOC6.3.13 — Core runtime & shims: 45 SLOC6.3.13 — Samples & examples: 79 SLOC6.3.13 — Kernel build tooling: 132 SLOC5,5386.36.4.16 — Kernel crate: 2,620 SLOC6.4.16 — Vendored crates: 4,106 SLOC6.4.16 — Procedural macros: 652 SLOC6.4.16 — Generated bindings: 33 SLOC6.4.16 — UAPI bindings: 16 SLOC6.4.16 — Core runtime & shims: 45 SLOC6.4.16 — Samples & examples: 92 SLOC6.4.16 — Kernel build tooling: 132 SLOC7,6966.46.5.13 — Kernel crate: 2,689 SLOC6.5.13 — Vendored crates: 4,323 SLOC6.5.13 — Procedural macros: 758 SLOC6.5.13 — Generated bindings: 32 SLOC6.5.13 — UAPI bindings: 15 SLOC6.5.13 — Core runtime & shims: 45 SLOC6.5.13 — Samples & examples: 92 SLOC6.5.13 — Kernel build tooling: 132 SLOC8,0866.56.6.144 — Kernel crate: 2,894 SLOC6.6.144 — Drivers: 95 SLOC6.6.144 — Vendored crates: 4,271 SLOC6.6.144 — Procedural macros: 936 SLOC6.6.144 — Generated bindings: 33 SLOC6.6.144 — UAPI bindings: 15 SLOC6.6.144 — Core runtime & shims: 53 SLOC6.6.144 — Samples & examples: 92 SLOC6.6.144 — Kernel build tooling: 315 SLOC8,7046.66.7.12 — Kernel crate: 3,134 SLOC6.7.12 — Vendored crates: 4,271 SLOC6.7.12 — Procedural macros: 926 SLOC6.7.12 — Generated bindings: 32 SLOC6.7.12 — UAPI bindings: 15 SLOC6.7.12 — Core runtime & shims: 53 SLOC6.7.12 — Samples & examples: 92 SLOC6.7.12 — Kernel build tooling: 315 SLOC8,8386.76.8.12 — Kernel crate: 3,610 SLOC6.8.12 — Drivers: 95 SLOC6.8.12 — Vendored crates: 4,288 SLOC6.8.12 — Procedural macros: 939 SLOC6.8.12 — Generated bindings: 30 SLOC6.8.12 — UAPI bindings: 15 SLOC6.8.12 — Core runtime & shims: 53 SLOC6.8.12 — Samples & examples: 92 SLOC6.8.12 — Kernel build tooling: 322 SLOC9,4446.86.9.12 — Kernel crate: 3,812 SLOC6.9.12 — Drivers: 95 SLOC6.9.12 — Vendored crates: 4,357 SLOC6.9.12 — Procedural macros: 939 SLOC6.9.12 — Generated bindings: 30 SLOC6.9.12 — UAPI bindings: 15 SLOC6.9.12 — Core runtime & shims: 53 SLOC6.9.12 — Samples & examples: 92 SLOC6.9.12 — Kernel build tooling: 324 SLOC9,7176.96.10.14 — Kernel crate: 4,057 SLOC6.10.14 — Drivers: 95 SLOC6.10.14 — Procedural macros: 975 SLOC6.10.14 — Generated bindings: 30 SLOC6.10.14 — UAPI bindings: 15 SLOC6.10.14 — Core runtime & shims: 53 SLOC6.10.14 — Samples & examples: 92 SLOC6.10.14 — Kernel build tooling: 325 SLOC5,6426.106.11.11 — Kernel crate: 4,845 SLOC6.11.11 — Drivers: 143 SLOC6.11.11 — Procedural macros: 989 SLOC6.11.11 — Generated bindings: 31 SLOC6.11.11 — UAPI bindings: 16 SLOC6.11.11 — Core runtime & shims: 56 SLOC6.11.11 — Samples & examples: 92 SLOC6.11.11 — Kernel build tooling: 341 SLOC6,5136.116.12.95 — Kernel crate: 7,023 SLOC6.12.95 — Drivers: 998 SLOC6.12.95 — Procedural macros: 990 SLOC6.12.95 — Generated bindings: 36 SLOC6.12.95 — UAPI bindings: 21 SLOC6.12.95 — Core runtime & shims: 80 SLOC6.12.95 — Samples & examples: 93 SLOC6.12.95 — Kernel build tooling: 398 SLOC6.12.95 — Other subsystems: 12 SLOC9,6516.126.13.12 — Kernel crate: 7,899 SLOC6.13.12 — Drivers: 999 SLOC6.13.12 — Procedural macros: 1,004 SLOC6.13.12 — Generated bindings: 35 SLOC6.13.12 — UAPI bindings: 20 SLOC6.13.12 — Core runtime & shims: 80 SLOC6.13.12 — Samples & examples: 103 SLOC6.13.12 — Kernel build tooling: 386 SLOC6.13.12 — Other subsystems: 12 SLOC10,5386.136.14.11 — Kernel crate: 8,874 SLOC6.14.11 — Drivers: 1,004 SLOC6.14.11 — Procedural macros: 997 SLOC6.14.11 — Generated bindings: 36 SLOC6.14.11 — UAPI bindings: 21 SLOC6.14.11 — Core runtime & shims: 80 SLOC6.14.11 — Samples & examples: 359 SLOC6.14.11 — Kernel build tooling: 386 SLOC6.14.11 — Other subsystems: 12 SLOC11,7696.146.15.11 — Kernel crate: 8,803 SLOC6.15.11 — Drivers: 1,270 SLOC6.15.11 — Procedural macros: 853 SLOC6.15.11 — Generated bindings: 36 SLOC6.15.11 — UAPI bindings: 21 SLOC6.15.11 — pin-init crate: 2,275 SLOC6.15.11 — Core runtime & shims: 101 SLOC6.15.11 — Samples & examples: 436 SLOC6.15.11 — Kernel build tooling: 388 SLOC6.15.11 — Other subsystems: 12 SLOC14,1956.156.16.12 — Kernel crate: 12,582 SLOC6.16.12 — Drivers: 1,924 SLOC6.16.12 — Procedural macros: 894 SLOC6.16.12 — Generated bindings: 36 SLOC6.16.12 — UAPI bindings: 21 SLOC6.16.12 — pin-init crate: 2,422 SLOC6.16.12 — Core runtime & shims: 101 SLOC6.16.12 — Samples & examples: 677 SLOC6.16.12 — Kernel build tooling: 402 SLOC6.16.12 — Other subsystems: 12 SLOC19,0716.166.17.13 — Kernel crate: 14,195 SLOC6.17.13 — Drivers: 4,243 SLOC6.17.13 — Procedural macros: 907 SLOC6.17.13 — Generated bindings: 39 SLOC6.17.13 — UAPI bindings: 24 SLOC6.17.13 — pin-init crate: 2,500 SLOC6.17.13 — Core runtime & shims: 101 SLOC6.17.13 — Samples & examples: 761 SLOC6.17.13 — Kernel build tooling: 404 SLOC6.17.13 — Other subsystems: 12 SLOC23,1866.176.18.38 — Kernel crate: 18,388 SLOC6.18.38 — Drivers: 12,596 SLOC6.18.38 — Procedural macros: 901 SLOC6.18.38 — Generated bindings: 41 SLOC6.18.38 — UAPI bindings: 25 SLOC6.18.38 — pin-init crate: 2,635 SLOC6.18.38 — Core runtime & shims: 101 SLOC6.18.38 — Samples & examples: 1,039 SLOC6.18.38 — Kernel build tooling: 408 SLOC6.18.38 — Library code: 79 SLOC6.18.38 — Other subsystems: 12 SLOC36,2256.186.19.14 — Kernel crate: 20,680 SLOC6.19.14 — Drivers: 16,030 SLOC6.19.14 — Vendored crates: 46,958 SLOC6.19.14 — Procedural macros: 1,153 SLOC6.19.14 — Generated bindings: 41 SLOC6.19.14 — UAPI bindings: 25 SLOC6.19.14 — pin-init crate: 2,651 SLOC6.19.14 — Core runtime & shims: 102 SLOC6.19.14 — Samples & examples: 1,200 SLOC6.19.14 — Kernel build tooling: 405 SLOC6.19.14 — Library code: 79 SLOC6.19.14 — Other subsystems: 12 SLOC89,3366.197.0.14 — Kernel crate: 21,824 SLOC7.0.14 — Drivers: 16,404 SLOC7.0.14 — Vendored crates: 46,958 SLOC7.0.14 — Procedural macros: 1,007 SLOC7.0.14 — Generated bindings: 53 SLOC7.0.14 — UAPI bindings: 25 SLOC7.0.14 — pin-init crate: 2,388 SLOC7.0.14 — Core runtime & shims: 102 SLOC7.0.14 — Samples & examples: 1,325 SLOC7.0.14 — Kernel build tooling: 409 SLOC7.0.14 — Tooling & tests: 21 SLOC7.0.14 — Library code: 79 SLOC7.0.14 — Other subsystems: 12 SLOC90,6077.07.1.3 — Kernel crate: 23,811 SLOC7.1.3 — Drivers: 16,988 SLOC7.1.3 — Vendored crates: 46,958 SLOC7.1.3 — Procedural macros: 1,004 SLOC7.1.3 — Generated bindings: 51 SLOC7.1.3 — UAPI bindings: 23 SLOC7.1.3 — pin-init crate: 2,419 SLOC7.1.3 — Core runtime & shims: 102 SLOC7.1.3 — Samples & examples: 1,368 SLOC7.1.3 — Kernel build tooling: 409 SLOC7.1.3 — Tooling & tests: 21 SLOC7.1.3 — Library code: 79 SLOC7.1.3 — Other subsystems: 12 SLOC93,2457.1~/rusted-kernel.comSLOC = code lines, excl. comments & blanks · cloc 1.98
Kernel crateDriversVendored cratesProcedural macrosGenerated bindingsUAPI bindingspin-init crateCore runtime & shimsSamples & examplesKernel build toolingTooling & testsLibrary codeOther subsystems

Same chart, kernel & vendored crates excluded

The rust/kernel abstraction crate and the vendored third-party crates together dwarf everything else, flattening the rest of the chart. Dropping both isolates the growth of Rust's applied surface — production drivers, samples, generated & UAPI bindings, procedural macros, pin-init and core shims.

RUST SLOC BY PURPOSE — CRATES EXCLUDEDexcl. Kernel crate + Vendored crates · 6.0 → 7.107,50015,00022,50030,00006.06.1.177 — Procedural macros: 284 SLOC6.1.177 — Generated bindings: 33 SLOC6.1.177 — Core runtime & shims: 37 SLOC6.1.177 — Samples & examples: 38 SLOC6.1.177 — Kernel build tooling: 132 SLOC5246.16.2.16 — Procedural macros: 389 SLOC6.2.16 — Generated bindings: 32 SLOC6.2.16 — Core runtime & shims: 45 SLOC6.2.16 — Samples & examples: 79 SLOC6.2.16 — Kernel build tooling: 132 SLOC6776.26.3.13 — Procedural macros: 389 SLOC6.3.13 — Generated bindings: 33 SLOC6.3.13 — Core runtime & shims: 45 SLOC6.3.13 — Samples & examples: 79 SLOC6.3.13 — Kernel build tooling: 132 SLOC6786.36.4.16 — Procedural macros: 652 SLOC6.4.16 — Generated bindings: 33 SLOC6.4.16 — UAPI bindings: 16 SLOC6.4.16 — Core runtime & shims: 45 SLOC6.4.16 — Samples & examples: 92 SLOC6.4.16 — Kernel build tooling: 132 SLOC9706.46.5.13 — Procedural macros: 758 SLOC6.5.13 — Generated bindings: 32 SLOC6.5.13 — UAPI bindings: 15 SLOC6.5.13 — Core runtime & shims: 45 SLOC6.5.13 — Samples & examples: 92 SLOC6.5.13 — Kernel build tooling: 132 SLOC1,0746.56.6.144 — Drivers: 95 SLOC6.6.144 — Procedural macros: 936 SLOC6.6.144 — Generated bindings: 33 SLOC6.6.144 — UAPI bindings: 15 SLOC6.6.144 — Core runtime & shims: 53 SLOC6.6.144 — Samples & examples: 92 SLOC6.6.144 — Kernel build tooling: 315 SLOC1,5396.66.7.12 — Procedural macros: 926 SLOC6.7.12 — Generated bindings: 32 SLOC6.7.12 — UAPI bindings: 15 SLOC6.7.12 — Core runtime & shims: 53 SLOC6.7.12 — Samples & examples: 92 SLOC6.7.12 — Kernel build tooling: 315 SLOC1,4336.76.8.12 — Drivers: 95 SLOC6.8.12 — Procedural macros: 939 SLOC6.8.12 — Generated bindings: 30 SLOC6.8.12 — UAPI bindings: 15 SLOC6.8.12 — Core runtime & shims: 53 SLOC6.8.12 — Samples & examples: 92 SLOC6.8.12 — Kernel build tooling: 322 SLOC1,5466.86.9.12 — Drivers: 95 SLOC6.9.12 — Procedural macros: 939 SLOC6.9.12 — Generated bindings: 30 SLOC6.9.12 — UAPI bindings: 15 SLOC6.9.12 — Core runtime & shims: 53 SLOC6.9.12 — Samples & examples: 92 SLOC6.9.12 — Kernel build tooling: 324 SLOC1,5486.96.10.14 — Drivers: 95 SLOC6.10.14 — Procedural macros: 975 SLOC6.10.14 — Generated bindings: 30 SLOC6.10.14 — UAPI bindings: 15 SLOC6.10.14 — Core runtime & shims: 53 SLOC6.10.14 — Samples & examples: 92 SLOC6.10.14 — Kernel build tooling: 325 SLOC1,5856.106.11.11 — Drivers: 143 SLOC6.11.11 — Procedural macros: 989 SLOC6.11.11 — Generated bindings: 31 SLOC6.11.11 — UAPI bindings: 16 SLOC6.11.11 — Core runtime & shims: 56 SLOC6.11.11 — Samples & examples: 92 SLOC6.11.11 — Kernel build tooling: 341 SLOC1,6686.116.12.95 — Drivers: 998 SLOC6.12.95 — Procedural macros: 990 SLOC6.12.95 — Generated bindings: 36 SLOC6.12.95 — UAPI bindings: 21 SLOC6.12.95 — Core runtime & shims: 80 SLOC6.12.95 — Samples & examples: 93 SLOC6.12.95 — Kernel build tooling: 398 SLOC6.12.95 — Other subsystems: 12 SLOC2,6286.126.13.12 — Drivers: 999 SLOC6.13.12 — Procedural macros: 1,004 SLOC6.13.12 — Generated bindings: 35 SLOC6.13.12 — UAPI bindings: 20 SLOC6.13.12 — Core runtime & shims: 80 SLOC6.13.12 — Samples & examples: 103 SLOC6.13.12 — Kernel build tooling: 386 SLOC6.13.12 — Other subsystems: 12 SLOC2,6396.136.14.11 — Drivers: 1,004 SLOC6.14.11 — Procedural macros: 997 SLOC6.14.11 — Generated bindings: 36 SLOC6.14.11 — UAPI bindings: 21 SLOC6.14.11 — Core runtime & shims: 80 SLOC6.14.11 — Samples & examples: 359 SLOC6.14.11 — Kernel build tooling: 386 SLOC6.14.11 — Other subsystems: 12 SLOC2,8956.146.15.11 — Drivers: 1,270 SLOC6.15.11 — Procedural macros: 853 SLOC6.15.11 — Generated bindings: 36 SLOC6.15.11 — UAPI bindings: 21 SLOC6.15.11 — pin-init crate: 2,275 SLOC6.15.11 — Core runtime & shims: 101 SLOC6.15.11 — Samples & examples: 436 SLOC6.15.11 — Kernel build tooling: 388 SLOC6.15.11 — Other subsystems: 12 SLOC5,3926.156.16.12 — Drivers: 1,924 SLOC6.16.12 — Procedural macros: 894 SLOC6.16.12 — Generated bindings: 36 SLOC6.16.12 — UAPI bindings: 21 SLOC6.16.12 — pin-init crate: 2,422 SLOC6.16.12 — Core runtime & shims: 101 SLOC6.16.12 — Samples & examples: 677 SLOC6.16.12 — Kernel build tooling: 402 SLOC6.16.12 — Other subsystems: 12 SLOC6,4896.166.17.13 — Drivers: 4,243 SLOC6.17.13 — Procedural macros: 907 SLOC6.17.13 — Generated bindings: 39 SLOC6.17.13 — UAPI bindings: 24 SLOC6.17.13 — pin-init crate: 2,500 SLOC6.17.13 — Core runtime & shims: 101 SLOC6.17.13 — Samples & examples: 761 SLOC6.17.13 — Kernel build tooling: 404 SLOC6.17.13 — Other subsystems: 12 SLOC8,9916.176.18.38 — Drivers: 12,596 SLOC6.18.38 — Procedural macros: 901 SLOC6.18.38 — Generated bindings: 41 SLOC6.18.38 — UAPI bindings: 25 SLOC6.18.38 — pin-init crate: 2,635 SLOC6.18.38 — Core runtime & shims: 101 SLOC6.18.38 — Samples & examples: 1,039 SLOC6.18.38 — Kernel build tooling: 408 SLOC6.18.38 — Library code: 79 SLOC6.18.38 — Other subsystems: 12 SLOC17,8376.186.19.14 — Drivers: 16,030 SLOC6.19.14 — Procedural macros: 1,153 SLOC6.19.14 — Generated bindings: 41 SLOC6.19.14 — UAPI bindings: 25 SLOC6.19.14 — pin-init crate: 2,651 SLOC6.19.14 — Core runtime & shims: 102 SLOC6.19.14 — Samples & examples: 1,200 SLOC6.19.14 — Kernel build tooling: 405 SLOC6.19.14 — Library code: 79 SLOC6.19.14 — Other subsystems: 12 SLOC21,6986.197.0.14 — Drivers: 16,404 SLOC7.0.14 — Procedural macros: 1,007 SLOC7.0.14 — Generated bindings: 53 SLOC7.0.14 — UAPI bindings: 25 SLOC7.0.14 — pin-init crate: 2,388 SLOC7.0.14 — Core runtime & shims: 102 SLOC7.0.14 — Samples & examples: 1,325 SLOC7.0.14 — Kernel build tooling: 409 SLOC7.0.14 — Tooling & tests: 21 SLOC7.0.14 — Library code: 79 SLOC7.0.14 — Other subsystems: 12 SLOC21,8257.07.1.3 — Drivers: 16,988 SLOC7.1.3 — Procedural macros: 1,004 SLOC7.1.3 — Generated bindings: 51 SLOC7.1.3 — UAPI bindings: 23 SLOC7.1.3 — pin-init crate: 2,419 SLOC7.1.3 — Core runtime & shims: 102 SLOC7.1.3 — Samples & examples: 1,368 SLOC7.1.3 — Kernel build tooling: 409 SLOC7.1.3 — Tooling & tests: 21 SLOC7.1.3 — Library code: 79 SLOC7.1.3 — Other subsystems: 12 SLOC22,4767.1~/rusted-kernel.comSLOC = code lines, excl. comments & blanks · cloc 1.98
DriversProcedural macrosGenerated bindingsUAPI bindingspin-init crateCore runtime & shimsSamples & examplesKernel build toolingTooling & testsLibrary codeOther subsystems

Rust files per version

~/rusted-kernel.com01332664006.0.19: 0 files6.06.1.177: 29 files6.16.2.16: 37 files6.26.3.13: 38 files6.36.4.16: 55 files6.46.5.13: 55 files6.56.6.144: 61 files6.66.7.12: 61 files6.76.8.12: 64 files6.86.9.12: 65 files6.96.10.14: 54 files6.106.11.11: 66 files6.116.12.95: 79 files6.126.13.12: 91 files6.136.14.11: 105 files6.146.15.11: 131 files6.156.16.12: 158 files6.166.17.13: 182 files6.176.18.38: 243 files6.186.19.14: 338 files6.197.0.14: 345 files7.07.1.3: 349 files7.1

Comment lines per version

~/rusted-kernel.com013k27k40k6.0.19: 0 comment lines6.06.1.177: 4,750 comment lines6.16.2.16: 5,454 comment lines6.26.3.13: 5,696 comment lines6.36.4.16: 8,126 comment lines6.46.5.13: 8,524 comment lines6.56.6.144: 9,020 comment lines6.66.7.12: 9,387 comment lines6.76.8.12: 9,922 comment lines6.86.9.12: 10,061 comment lines6.96.10.14: 5,625 comment lines6.106.11.11: 6,589 comment lines6.116.12.95: 9,123 comment lines6.126.13.12: 10,243 comment lines6.136.14.11: 11,310 comment lines6.146.15.11: 13,151 comment lines6.156.16.12: 16,730 comment lines6.166.17.13: 19,474 comment lines6.176.18.38: 25,249 comment lines6.186.19.14: 35,461 comment lines6.197.0.14: 35,502 comment lines7.07.1.3: 37,782 comment lines7.1

Per-version totals

Files, on-disk size and cloc line counts for each release, with the change in SLOC versus the previous series. Kernel SLOC is the whole tree (all languages) and Rust % is Rust's share of it.

VersionReleasedFilesSize SLOCCommentsBlank Δ SLOCKernel SLOCRust %
6.0.192023-01-1200 B00025,029,9590.000%
6.1.1772026-07-0429345.2 KiB4,8774,750826+4,87725,411,6670.019%
6.2.162023-05-1737388.4 KiB5,5435,454948+66625,552,8230.022%
6.3.132023-07-1138400.3 KiB5,5385,696980-525,619,8510.022%
6.4.162023-09-1355570.7 KiB7,6968,1261,280+2,15825,929,5160.030%
6.5.132023-11-2855601.4 KiB8,0868,5241,333+39026,179,8520.031%
6.6.1442026-07-0461647.9 KiB8,7049,0201,429+61826,422,2940.033%
6.7.122024-04-0361665.7 KiB8,8389,3871,456+13426,791,5930.033%
6.8.122024-05-3064710.6 KiB9,4449,9221,565+60626,991,6880.035%
6.9.122024-07-2765727.5 KiB9,71710,0611,598+27327,325,3870.036%
6.10.142024-10-1054421.2 KiB5,6425,625980-4,07527,476,1120.021%
6.11.112024-12-0566495.0 KiB6,5136,5891,169+87128,015,5120.023%
6.12.952026-07-0479717.0 KiB9,6519,1231,775+3,13828,232,8440.034%
6.13.122025-04-2091794.4 KiB10,53810,2431,993+88728,305,7060.037%
6.14.112025-06-10105881.2 KiB11,76911,3102,321+1,23128,480,7340.041%
6.15.112025-08-201311.0 MiB14,19513,1512,792+2,42628,796,1930.049%
6.16.122025-10-121581.3 MiB19,07116,7303,843+4,87628,997,2060.066%
6.17.132025-12-181821.6 MiB23,18619,4744,752+4,11529,153,9960.080%
6.18.382026-07-042432.3 MiB36,22525,2496,989+13,03929,317,9550.124%
6.19.142026-04-223384.4 MiB89,33635,46111,140+53,11129,607,0550.302%
7.0.142026-06-273454.5 MiB90,60735,50211,446+1,27129,902,9660.303%
7.1.32026-07-043494.6 MiB93,24537,78211,974+2,63830,101,0720.310%

Version detail

Expand any release for its full category breakdown, driver subsystems and largest files.

6.0.19 2023-01-12 0 files · 0 SLOC · 0 B
CategoryPurposeFiles SizeSLOCShare

Largest files

PathSize SLOC
6.1.177 2026-07-04 29 files · 4,877 SLOC · 345.2 KiB
CategoryPurposeFiles SizeSLOCShare
Vendored cratesThird-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros13302.6 KiB4,115
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.315.3 KiB284
Kernel crateSafe Rust abstractions layered over the C kernel APIs617.5 KiB238
Kernel build toolingCodegen and helpers used during the kernel build15.2 KiB132
Samples & examplesReference modules demonstrating the Rust API41.3 KiB38
Core runtime & shimscompiler_builtins, ffi and other crate-root shims11.7 KiB37
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.6 KiB33

Largest files

PathSize SLOC
rust/alloc/vec/mod.rs104.9 KiB1,060
rust/alloc/boxed.rs64.2 KiB829
rust/alloc/slice.rs42.6 KiB597
rust/alloc/raw_vec.rs20.4 KiB273
rust/alloc/borrow.rs13.6 KiB260
rust/alloc/alloc.rs15.6 KiB245
rust/alloc/vec/into_iter.rs12.1 KiB239
rust/macros/module.rs12.1 KiB235
6.2.16 2023-05-17 37 files · 5,543 SLOC · 388.4 KiB
CategoryPurposeFiles SizeSLOCShare
Vendored cratesThird-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros13307.0 KiB4,146
Kernel crateSafe Rust abstractions layered over the C kernel APIs1049.4 KiB720
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.519.3 KiB389
Kernel build toolingCodegen and helpers used during the kernel build15.2 KiB132
Samples & examplesReference modules demonstrating the Rust API53.0 KiB79
Core runtime & shimscompiler_builtins, ffi and other crate-root shims23.0 KiB45
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.5 KiB32

Largest files

PathSize SLOC
rust/alloc/vec/mod.rs108.0 KiB1,070
rust/alloc/boxed.rs64.2 KiB829
rust/alloc/slice.rs42.6 KiB597
rust/kernel/str.rs18.0 KiB305
rust/alloc/raw_vec.rs21.7 KiB294
rust/alloc/borrow.rs13.6 KiB260
rust/alloc/alloc.rs15.6 KiB245
rust/alloc/vec/into_iter.rs12.1 KiB239
6.3.13 2023-07-11 38 files · 5,538 SLOC · 400.3 KiB
CategoryPurposeFiles SizeSLOCShare
Vendored cratesThird-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros12293.6 KiB3,890
Kernel crateSafe Rust abstractions layered over the C kernel APIs1274.5 KiB970
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.519.3 KiB389
Kernel build toolingCodegen and helpers used during the kernel build15.2 KiB132
Samples & examplesReference modules demonstrating the Rust API53.0 KiB79
Core runtime & shimscompiler_builtins, ffi and other crate-root shims23.2 KiB45
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.5 KiB33

Largest files

PathSize SLOC
rust/alloc/vec/mod.rs108.1 KiB1,073
rust/alloc/boxed.rs64.2 KiB829
rust/alloc/slice.rs42.6 KiB597
rust/kernel/str.rs18.0 KiB305
rust/alloc/raw_vec.rs21.7 KiB294
rust/alloc/alloc.rs15.6 KiB245
rust/alloc/vec/into_iter.rs12.1 KiB239
rust/macros/module.rs8.5 KiB225
6.4.16 2023-09-13 55 files · 7,696 SLOC · 570.7 KiB
CategoryPurposeFiles SizeSLOCShare
Vendored cratesThird-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros14304.8 KiB4,106
Kernel crateSafe Rust abstractions layered over the C kernel APIs23219.4 KiB2,620
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.832.4 KiB652
Kernel build toolingCodegen and helpers used during the kernel build15.2 KiB132
Samples & examplesReference modules demonstrating the Rust API53.5 KiB92
Core runtime & shimscompiler_builtins, ffi and other crate-root shims23.2 KiB45
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.5 KiB33
UAPI bindingsRaw bindings to the kernel's userspace API headers1727 B16

Largest files

PathSize SLOC
rust/alloc/vec/mod.rs112.9 KiB1,125
rust/alloc/boxed.rs64.2 KiB829
rust/alloc/slice.rs42.6 KiB597
rust/kernel/init.rs48.2 KiB546
rust/kernel/init/macros.rs39.0 KiB408
rust/kernel/str.rs18.0 KiB305
rust/alloc/raw_vec.rs21.7 KiB294
rust/alloc/alloc.rs15.6 KiB245
6.5.13 2023-11-28 55 files · 8,086 SLOC · 601.4 KiB
CategoryPurposeFiles SizeSLOCShare
Vendored cratesThird-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros14325.6 KiB4,323
Kernel crateSafe Rust abstractions layered over the C kernel APIs23224.2 KiB2,689
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.837.6 KiB758
Kernel build toolingCodegen and helpers used during the kernel build15.2 KiB132
Samples & examplesReference modules demonstrating the Rust API53.5 KiB92
Core runtime & shimscompiler_builtins, ffi and other crate-root shims23.2 KiB45
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.5 KiB32
UAPI bindingsRaw bindings to the kernel's userspace API headers1703 B15

Largest files

PathSize SLOC
rust/alloc/vec/mod.rs123.6 KiB1,181
rust/alloc/boxed.rs77.7 KiB986
rust/kernel/init.rs48.3 KiB546
rust/alloc/slice.rs30.0 KiB452
rust/kernel/init/macros.rs39.4 KiB408
rust/kernel/str.rs18.7 KiB318
rust/alloc/raw_vec.rs21.7 KiB294
rust/alloc/vec/into_iter.rs14.9 KiB279
6.6.144 2026-07-04 61 files · 8,704 SLOC · 647.9 KiB
CategoryPurposeFiles SizeSLOCShare
Vendored cratesThird-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros14321.9 KiB4,271
Kernel crateSafe Rust abstractions layered over the C kernel APIs24244.5 KiB2,894
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.1050.6 KiB936
Kernel build toolingCodegen and helpers used during the kernel build318.0 KiB315
DriversProduction device drivers written in Rust13.9 KiB95
Samples & examplesReference modules demonstrating the Rust API53.5 KiB92
Core runtime & shimscompiler_builtins, ffi and other crate-root shims23.3 KiB53
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.6 KiB33
UAPI bindingsRaw bindings to the kernel's userspace API headers1703 B15

Driver subsystems

SubsystemFiles SizeSLOC
drivers/net (Networking)13.9 KiB95

Largest files

PathSize SLOC
rust/alloc/vec/mod.rs122.1 KiB1,137
rust/alloc/boxed.rs77.1 KiB999
rust/kernel/init/macros.rs55.1 KiB691
rust/alloc/slice.rs30.7 KiB469
rust/kernel/init.rs45.6 KiB389
rust/kernel/str.rs18.8 KiB318
rust/alloc/raw_vec.rs22.7 KiB304
rust/alloc/vec/into_iter.rs15.3 KiB283
6.7.12 2024-04-03 61 files · 8,838 SLOC · 665.7 KiB
CategoryPurposeFiles SizeSLOCShare
Vendored cratesThird-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros14321.9 KiB4,271
Kernel crateSafe Rust abstractions layered over the C kernel APIs25269.6 KiB3,134
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.1047.4 KiB926
Kernel build toolingCodegen and helpers used during the kernel build318.0 KiB315
Samples & examplesReference modules demonstrating the Rust API53.5 KiB92
Core runtime & shimscompiler_builtins, ffi and other crate-root shims23.3 KiB53
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.5 KiB32
UAPI bindingsRaw bindings to the kernel's userspace API headers1703 B15

Largest files

PathSize SLOC
rust/alloc/vec/mod.rs122.1 KiB1,137
rust/alloc/boxed.rs77.1 KiB999
rust/kernel/init/macros.rs55.1 KiB691
rust/alloc/slice.rs30.7 KiB469
rust/kernel/init.rs44.9 KiB389
rust/kernel/str.rs18.8 KiB318
rust/alloc/raw_vec.rs22.7 KiB304
rust/alloc/vec/into_iter.rs15.3 KiB283
6.8.12 2024-05-30 64 files · 9,444 SLOC · 710.6 KiB
CategoryPurposeFiles SizeSLOCShare
Vendored cratesThird-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros14325.7 KiB4,288
Kernel crateSafe Rust abstractions layered over the C kernel APIs27301.3 KiB3,610
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.1052.5 KiB939
Kernel build toolingCodegen and helpers used during the kernel build318.3 KiB322
DriversProduction device drivers written in Rust13.9 KiB95
Samples & examplesReference modules demonstrating the Rust API53.5 KiB92
Core runtime & shimscompiler_builtins, ffi and other crate-root shims23.3 KiB53
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.4 KiB30
UAPI bindingsRaw bindings to the kernel's userspace API headers1703 B15

Driver subsystems

SubsystemFiles SizeSLOC
drivers/net (Networking)13.9 KiB95

Largest files

PathSize SLOC
rust/alloc/vec/mod.rs125.2 KiB1,153
rust/alloc/boxed.rs77.1 KiB999
rust/kernel/init/macros.rs55.1 KiB691
rust/alloc/slice.rs30.8 KiB469
rust/kernel/net/phy.rs30.8 KiB464
rust/kernel/init.rs45.4 KiB389
rust/kernel/str.rs18.9 KiB323
rust/alloc/raw_vec.rs22.7 KiB304
6.9.12 2024-07-27 65 files · 9,717 SLOC · 727.5 KiB
CategoryPurposeFiles SizeSLOCShare
Vendored cratesThird-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros14330.1 KiB4,357
Kernel crateSafe Rust abstractions layered over the C kernel APIs28313.7 KiB3,812
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.1052.5 KiB939
Kernel build toolingCodegen and helpers used during the kernel build318.4 KiB324
DriversProduction device drivers written in Rust13.9 KiB95
Samples & examplesReference modules demonstrating the Rust API53.5 KiB92
Core runtime & shimscompiler_builtins, ffi and other crate-root shims23.3 KiB53
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.4 KiB30
UAPI bindingsRaw bindings to the kernel's userspace API headers1703 B15

Driver subsystems

SubsystemFiles SizeSLOC
drivers/net (Networking)13.9 KiB95

Largest files

PathSize SLOC
rust/alloc/vec/mod.rs127.1 KiB1,181
rust/alloc/boxed.rs77.4 KiB1,002
rust/kernel/init/macros.rs55.1 KiB691
rust/alloc/slice.rs30.8 KiB469
rust/kernel/net/phy.rs30.9 KiB464
rust/kernel/str.rs25.9 KiB447
rust/kernel/init.rs45.4 KiB389
rust/alloc/raw_vec.rs24.3 KiB326
6.10.14 2024-10-10 54 files · 5,642 SLOC · 421.2 KiB

Why totals fall here — a one-time cleanup, not a retreat from Rust. 6.10 removed the in-tree rust/alloc fork: the kernel's private copy of Rust's standard alloc library (Vec, Box, slice, raw_vec, …) — ~4,360 SLOC across 14 files, counted here under Vendored crates — and replaced it with thin allocator abstractions in rust/kernel/alloc/ (box_ext, vec_ext). First-party kernel Rust kept growing straight through the drop: the Kernel crate went 3,812 → 4,057 → 4,845 SLOC across 6.9 → 6.10 → 6.11. Only the vendored standard-library copy went away, so the total fell even as the kernel's own Rust expanded.

CategoryPurposeFiles SizeSLOCShare
Kernel crateSafe Rust abstractions layered over the C kernel APIs31334.6 KiB4,057
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.1055.2 KiB975
Kernel build toolingCodegen and helpers used during the kernel build318.5 KiB325
DriversProduction device drivers written in Rust13.9 KiB95
Samples & examplesReference modules demonstrating the Rust API53.6 KiB92
Core runtime & shimscompiler_builtins, ffi and other crate-root shims23.3 KiB53
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.4 KiB30
UAPI bindingsRaw bindings to the kernel's userspace API headers1703 B15

Driver subsystems

SubsystemFiles SizeSLOC
drivers/net (Networking)13.9 KiB95

Largest files

PathSize SLOC
rust/kernel/init/macros.rs56.0 KiB706
rust/kernel/str.rs28.9 KiB469
rust/kernel/net/phy.rs30.9 KiB464
rust/kernel/init.rs45.7 KiB389
rust/kernel/sync/arc.rs27.5 KiB279
rust/macros/module.rs12.6 KiB252
rust/kernel/workqueue.rs24.6 KiB239
rust/kernel/error.rs11.7 KiB177
6.11.11 2024-12-05 66 files · 6,513 SLOC · 495.0 KiB
CategoryPurposeFiles SizeSLOCShare
Kernel crateSafe Rust abstractions layered over the C kernel APIs42404.5 KiB4,845
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.1056.7 KiB989
Kernel build toolingCodegen and helpers used during the kernel build319.2 KiB341
DriversProduction device drivers written in Rust25.7 KiB143
Samples & examplesReference modules demonstrating the Rust API53.6 KiB92
Core runtime & shimscompiler_builtins, ffi and other crate-root shims23.3 KiB56
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.4 KiB31
UAPI bindingsRaw bindings to the kernel's userspace API headers1718 B16

Driver subsystems

SubsystemFiles SizeSLOC
drivers/net (Networking)13.9 KiB95
drivers/block (Block)11.8 KiB48

Largest files

PathSize SLOC
rust/kernel/init/macros.rs56.0 KiB706
rust/kernel/str.rs28.9 KiB469
rust/kernel/net/phy.rs30.9 KiB464
rust/kernel/init.rs45.6 KiB384
rust/kernel/sync/arc.rs27.5 KiB279
rust/macros/module.rs13.0 KiB266
rust/kernel/workqueue.rs24.7 KiB239
rust/kernel/types.rs16.8 KiB181
6.12.95 2026-07-04 79 files · 9,651 SLOC · 717.0 KiB
CategoryPurposeFiles SizeSLOCShare
Kernel crateSafe Rust abstractions layered over the C kernel APIs51583.7 KiB7,023
DriversProduction device drivers written in Rust442.9 KiB998
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.1057.3 KiB990
Kernel build toolingCodegen and helpers used during the kernel build321.7 KiB398
Samples & examplesReference modules demonstrating the Rust API53.6 KiB93
Core runtime & shimscompiler_builtins, ffi and other crate-root shims34.6 KiB80
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.7 KiB36
UAPI bindingsRaw bindings to the kernel's userspace API headers1981 B21
Other subsystemsRust code elsewhere in the tree1592 B12

Driver subsystems

SubsystemFiles SizeSLOC
drivers/gpu (GPU / DRM)133.4 KiB793
drivers/net (Networking)27.6 KiB157
drivers/block (Block)11.8 KiB48

Largest files

PathSize SLOC
drivers/gpu/drm/drm_panic_qr.rs33.4 KiB793
rust/kernel/init/macros.rs61.9 KiB759
rust/kernel/rbtree.rs48.0 KiB496
rust/kernel/str.rs29.2 KiB483
rust/kernel/net/phy.rs31.1 KiB469
rust/kernel/init.rs48.1 KiB408
rust/kernel/alloc/kvec.rs27.4 KiB401
rust/kernel/list.rs26.6 KiB327
6.13.12 2025-04-20 91 files · 10,538 SLOC · 794.4 KiB
CategoryPurposeFiles SizeSLOCShare
Kernel crateSafe Rust abstractions layered over the C kernel APIs63657.5 KiB7,899
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.1061.0 KiB1,004
DriversProduction device drivers written in Rust442.9 KiB999
Kernel build toolingCodegen and helpers used during the kernel build321.3 KiB386
Samples & examplesReference modules demonstrating the Rust API54.0 KiB103
Core runtime & shimscompiler_builtins, ffi and other crate-root shims34.6 KiB80
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.6 KiB35
UAPI bindingsRaw bindings to the kernel's userspace API headers1896 B20
Other subsystemsRust code elsewhere in the tree1592 B12

Driver subsystems

SubsystemFiles SizeSLOC
drivers/gpu (GPU / DRM)133.4 KiB793
drivers/net (Networking)27.6 KiB157
drivers/block (Block)11.9 KiB49

Largest files

PathSize SLOC
drivers/gpu/drm/drm_panic_qr.rs33.4 KiB793
rust/kernel/init/macros.rs56.3 KiB707
rust/kernel/rbtree.rs48.0 KiB496
rust/kernel/str.rs29.2 KiB483
rust/kernel/net/phy.rs31.3 KiB471
rust/kernel/init.rs48.1 KiB408
rust/kernel/alloc/kvec.rs27.2 KiB400
rust/kernel/list.rs26.5 KiB326
6.14.11 2025-06-10 105 files · 11,769 SLOC · 881.2 KiB
CategoryPurposeFiles SizeSLOCShare
Kernel crateSafe Rust abstractions layered over the C kernel APIs73732.9 KiB8,874
DriversProduction device drivers written in Rust443.1 KiB1,004
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.1060.9 KiB997
Kernel build toolingCodegen and helpers used during the kernel build321.3 KiB386
Samples & examplesReference modules demonstrating the Rust API915.2 KiB359
Core runtime & shimscompiler_builtins, ffi and other crate-root shims34.6 KiB80
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.7 KiB36
UAPI bindingsRaw bindings to the kernel's userspace API headers1981 B21
Other subsystemsRust code elsewhere in the tree1592 B12

Driver subsystems

SubsystemFiles SizeSLOC
drivers/gpu (GPU / DRM)133.4 KiB793
drivers/net (Networking)27.6 KiB157
drivers/block (Block)12.0 KiB54

Largest files

PathSize SLOC
drivers/gpu/drm/drm_panic_qr.rs33.4 KiB793
rust/kernel/init/macros.rs56.3 KiB707
rust/kernel/rbtree.rs47.9 KiB496
rust/kernel/str.rs29.4 KiB484
rust/kernel/net/phy.rs31.3 KiB471
rust/kernel/init.rs48.3 KiB408
rust/kernel/alloc/kvec.rs27.3 KiB401
rust/kernel/list.rs26.6 KiB327
6.15.11 2025-08-20 131 files · 14,195 SLOC · 1.0 MiB
CategoryPurposeFiles SizeSLOCShare
Kernel crateSafe Rust abstractions layered over the C kernel APIs78727.8 KiB8,803
pin-init crateSafe in-place (pinned) initialisation primitives15155.1 KiB2,275
DriversProduction device drivers written in Rust1052.3 KiB1,270
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.952.3 KiB853
Samples & examplesReference modules demonstrating the Rust API1017.7 KiB436
Kernel build toolingCodegen and helpers used during the kernel build321.4 KiB388
Core runtime & shimscompiler_builtins, ffi and other crate-root shims35.1 KiB101
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.7 KiB36
UAPI bindingsRaw bindings to the kernel's userspace API headers1981 B21
Other subsystemsRust code elsewhere in the tree1592 B12

Driver subsystems

SubsystemFiles SizeSLOC
drivers/gpu (GPU / DRM)742.6 KiB1,059
drivers/net (Networking)27.7 KiB157
drivers/block (Block)12.0 KiB54

Largest files

PathSize SLOC
drivers/gpu/drm/drm_panic_qr.rs32.8 KiB773
rust/pin-init/src/macros.rs56.2 KiB711
rust/kernel/str.rs30.6 KiB513
rust/kernel/rbtree.rs47.9 KiB496
rust/kernel/net/phy.rs31.3 KiB471
rust/kernel/alloc/kvec.rs27.4 KiB401
rust/kernel/list.rs36.4 KiB392
rust/pin-init/src/lib.rs48.4 KiB329
6.16.12 2025-10-12 158 files · 19,071 SLOC · 1.3 MiB
CategoryPurposeFiles SizeSLOCShare
Kernel crateSafe Rust abstractions layered over the C kernel APIs96995.2 KiB12,582
pin-init crateSafe in-place (pinned) initialisation primitives15163.6 KiB2,422
DriversProduction device drivers written in Rust1781.1 KiB1,924
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.954.0 KiB894
Samples & examplesReference modules demonstrating the Rust API1226.0 KiB677
Kernel build toolingCodegen and helpers used during the kernel build321.7 KiB402
Core runtime & shimscompiler_builtins, ffi and other crate-root shims35.1 KiB101
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.7 KiB36
UAPI bindingsRaw bindings to the kernel's userspace API headers1981 B21
Other subsystemsRust code elsewhere in the tree1592 B12

Driver subsystems

SubsystemFiles SizeSLOC
drivers/gpu (GPU / DRM)1364.6 KiB1,555
drivers/cpufreq (CPU frequency)16.8 KiB158
drivers/net (Networking)27.7 KiB157
drivers/block (Block)12.0 KiB54

Largest files

PathSize SLOC
rust/pin-init/src/macros.rs59.2 KiB792
drivers/gpu/drm/drm_panic_qr.rs33.5 KiB787
rust/kernel/cpufreq.rs45.2 KiB694
rust/kernel/opp.rs37.3 KiB580
rust/kernel/alloc/kvec.rs39.9 KiB552
rust/kernel/str.rs30.3 KiB507
rust/kernel/configfs.rs36.4 KiB505
rust/kernel/rbtree.rs47.8 KiB493
6.17.13 2025-12-18 182 files · 23,186 SLOC · 1.6 MiB
CategoryPurposeFiles SizeSLOCShare
Kernel crateSafe Rust abstractions layered over the C kernel APIs1061.1 MiB14,195
DriversProduction device drivers written in Rust31191.0 KiB4,243
pin-init crateSafe in-place (pinned) initialisation primitives15168.7 KiB2,500
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.955.0 KiB907
Samples & examplesReference modules demonstrating the Rust API1231.0 KiB761
Kernel build toolingCodegen and helpers used during the kernel build321.9 KiB404
Core runtime & shimscompiler_builtins, ffi and other crate-root shims35.1 KiB101
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols11.8 KiB39
UAPI bindingsRaw bindings to the kernel's userspace API headers11.0 KiB24
Other subsystemsRust code elsewhere in the tree1592 B12

Driver subsystems

SubsystemFiles SizeSLOC
drivers/gpu (GPU / DRM)27174.5 KiB3,874
drivers/cpufreq (CPU frequency)16.8 KiB158
drivers/net (Networking)27.7 KiB157
drivers/block (Block)12.0 KiB54

Largest files

PathSize SLOC
drivers/gpu/nova-core/vbios.rs38.4 KiB800
rust/pin-init/src/macros.rs59.2 KiB792
drivers/gpu/drm/drm_panic_qr.rs33.5 KiB787
rust/kernel/cpufreq.rs45.0 KiB689
rust/kernel/opp.rs37.2 KiB580
rust/kernel/alloc/kvec.rs40.9 KiB569
rust/kernel/str.rs31.4 KiB515
rust/kernel/configfs.rs36.0 KiB497
6.18.38 2026-07-04 243 files · 36,225 SLOC · 2.3 MiB
CategoryPurposeFiles SizeSLOCShare
Kernel crateSafe Rust abstractions layered over the C kernel APIs1301.4 MiB18,388
DriversProduction device drivers written in Rust64591.2 KiB12,596
pin-init crateSafe in-place (pinned) initialisation primitives15178.0 KiB2,635
Samples & examplesReference modules demonstrating the Rust API1541.8 KiB1,039
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.954.6 KiB901
Kernel build toolingCodegen and helpers used during the kernel build322.1 KiB408
Core runtime & shimscompiler_builtins, ffi and other crate-root shims35.1 KiB101
Library codeShared library-style Rust code12.8 KiB79
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols12.1 KiB41
UAPI bindingsRaw bindings to the kernel's userspace API headers11.1 KiB25
Other subsystemsRust code elsewhere in the tree1592 B12

Driver subsystems

SubsystemFiles SizeSLOC
drivers/android (Android (binder))18320.1 KiB6,840
drivers/gpu (GPU / DRM)41246.9 KiB5,148
drivers/block (Block)29.7 KiB295
drivers/net (Networking)27.7 KiB157
drivers/cpufreq (CPU frequency)16.8 KiB156

Largest files

PathSize SLOC
drivers/android/binder/process.rs58.3 KiB1,316
drivers/android/binder/thread.rs60.5 KiB1,246
rust/pin-init/src/macros.rs68.1 KiB921
drivers/android/binder/node.rs38.6 KiB844
drivers/gpu/nova-core/vbios.rs38.1 KiB792
drivers/gpu/drm/drm_panic_qr.rs33.5 KiB787
rust/kernel/cpufreq.rs45.0 KiB687
rust/kernel/alloc/kvec.rs42.5 KiB590
6.19.14 2026-04-22 338 files · 89,336 SLOC · 4.4 MiB

Total Rust leaps from 36,225 SLOC (6.18) to 89,336 — but almost all of that is vendored crates: third-party libraries from the Rust ecosystem (crates.io) copied verbatim into rust/, because the kernel build is self-contained and can't fetch dependencies over the network. In 6.19 the standard procedural-macro toolchain was vendored in one go — syn (41,716 SLOC, a full Rust-source parser), proc-macro2 (3,782) and quote (1,460): 46,958 SLOC across 75 files — so the kernel's own macros (rust/macros/) can lean on them instead of hand-rolled parsing. This is external tooling, not kernel logic: set it aside and first-party kernel Rust grew steadily, 36,225 → 42,378 SLOC (6.18 → 6.19). The hero chart breaks it out as its own "Vendored crates" band for exactly this reason.

CategoryPurposeFiles SizeSLOCShare
Vendored cratesThird-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros751.8 MiB46,958
Kernel crateSafe Rust abstractions layered over the C kernel APIs1401.5 MiB20,680
DriversProduction device drivers written in Rust71757.3 KiB16,030
pin-init crateSafe in-place (pinned) initialisation primitives15179.9 KiB2,651
Samples & examplesReference modules demonstrating the Rust API1748.4 KiB1,200
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.1066.7 KiB1,153
Kernel build toolingCodegen and helpers used during the kernel build321.9 KiB405
Core runtime & shimscompiler_builtins, ffi and other crate-root shims35.1 KiB102
Library codeShared library-style Rust code12.8 KiB79
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols12.1 KiB41
UAPI bindingsRaw bindings to the kernel's userspace API headers11.1 KiB25
Other subsystemsRust code elsewhere in the tree1592 B12

Driver subsystems

SubsystemFiles SizeSLOC
drivers/gpu (GPU / DRM)47401.3 KiB8,302
drivers/android (Android (binder))18319.9 KiB6,833
drivers/block (Block)29.7 KiB295
drivers/pwm (pwm)111.9 KiB279
drivers/net (Networking)27.9 KiB165
drivers/cpufreq (CPU frequency)16.7 KiB156

Largest files

PathSize SLOC
rust/syn/gen/visit.rs122.5 KiB3,933
rust/syn/gen/fold.rs133.8 KiB3,894
rust/syn/gen/visit_mut.rs124.6 KiB3,750
rust/syn/expr.rs138.5 KiB3,377
rust/syn/gen/debug.rs124.4 KiB3,235
rust/syn/item.rs118.7 KiB3,001
rust/syn/gen/hash.rs75.2 KiB2,873
rust/syn/gen/eq.rs91.0 KiB2,303
7.0.14 2026-06-27 345 files · 90,607 SLOC · 4.5 MiB
CategoryPurposeFiles SizeSLOCShare
Vendored cratesThird-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros751.8 MiB46,958
Kernel crateSafe Rust abstractions layered over the C kernel APIs1461.6 MiB21,824
DriversProduction device drivers written in Rust71771.8 KiB16,404
pin-init crateSafe in-place (pinned) initialisation primitives15135.0 KiB2,388
Samples & examplesReference modules demonstrating the Rust API1850.9 KiB1,325
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.958.0 KiB1,007
Kernel build toolingCodegen and helpers used during the kernel build322.1 KiB409
Core runtime & shimscompiler_builtins, ffi and other crate-root shims35.1 KiB102
Library codeShared library-style Rust code12.8 KiB79
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols12.4 KiB53
UAPI bindingsRaw bindings to the kernel's userspace API headers11.1 KiB25
Tooling & testsOut-of-tree tooling and test harnesses1503 B21
Other subsystemsRust code elsewhere in the tree1592 B12

Driver subsystems

SubsystemFiles SizeSLOC
drivers/gpu (GPU / DRM)47413.5 KiB8,637
drivers/android (Android (binder))18322.5 KiB6,881
drivers/block (Block)29.6 KiB290
drivers/pwm (pwm)111.8 KiB278
drivers/net (Networking)27.8 KiB163
drivers/cpufreq (CPU frequency)16.7 KiB155

Largest files

PathSize SLOC
rust/syn/gen/visit.rs122.5 KiB3,933
rust/syn/gen/fold.rs133.8 KiB3,894
rust/syn/gen/visit_mut.rs124.6 KiB3,750
rust/syn/expr.rs138.5 KiB3,377
rust/syn/gen/debug.rs124.4 KiB3,235
rust/syn/item.rs118.7 KiB3,001
rust/syn/gen/hash.rs75.2 KiB2,873
rust/syn/gen/eq.rs91.0 KiB2,303
7.1.3 2026-07-04 349 files · 93,245 SLOC · 4.6 MiB
CategoryPurposeFiles SizeSLOCShare
Vendored cratesThird-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros751.8 MiB46,958
Kernel crateSafe Rust abstractions layered over the C kernel APIs1501.7 MiB23,811
DriversProduction device drivers written in Rust71785.9 KiB16,988
pin-init crateSafe in-place (pinned) initialisation primitives15136.8 KiB2,419
Samples & examplesReference modules demonstrating the Rust API1851.7 KiB1,368
Procedural macrosCompiler plumbing: module!, #[vtable], pin-data, etc.957.7 KiB1,004
Kernel build toolingCodegen and helpers used during the kernel build322.1 KiB409
Core runtime & shimscompiler_builtins, ffi and other crate-root shims35.1 KiB102
Library codeShared library-style Rust code12.8 KiB79
Generated bindingsAuto-generated raw FFI bindings to C kernel symbols12.2 KiB51
UAPI bindingsRaw bindings to the kernel's userspace API headers1909 B23
Tooling & testsOut-of-tree tooling and test harnesses1503 B21
Other subsystemsRust code elsewhere in the tree1592 B12

Driver subsystems

SubsystemFiles SizeSLOC
drivers/gpu (GPU / DRM)47423.6 KiB9,120
drivers/android (Android (binder))18327.3 KiB6,984
drivers/block (Block)29.6 KiB290
drivers/pwm (pwm)110.9 KiB276
drivers/net (Networking)27.8 KiB163
drivers/cpufreq (CPU frequency)16.7 KiB155

Largest files

PathSize SLOC
rust/syn/gen/visit.rs122.5 KiB3,933
rust/syn/gen/fold.rs133.8 KiB3,894
rust/syn/gen/visit_mut.rs124.6 KiB3,750
rust/syn/expr.rs138.5 KiB3,377
rust/syn/gen/debug.rs124.4 KiB3,235
rust/syn/item.rs118.7 KiB3,001
rust/syn/gen/hash.rs75.2 KiB2,873
rust/syn/gen/eq.rs91.0 KiB2,303

What the categories mean

How each .rs file is classified by its location in the kernel tree.

Kernel crate

Safe Rust abstractions layered over the C kernel APIs

Procedural macros

Compiler plumbing: module!, #[vtable], pin-data, etc.

pin-init crate

Safe in-place (pinned) initialisation primitives

Generated bindings

Auto-generated raw FFI bindings to C kernel symbols

UAPI bindings

Raw bindings to the kernel's userspace API headers

Samples & examples

Reference modules demonstrating the Rust API

Drivers

Production device drivers written in Rust

Kernel build tooling

Codegen and helpers used during the kernel build

Tooling & tests

Out-of-tree tooling and test harnesses

Library code

Shared library-style Rust code

Vendored crates

Third-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros

Core runtime & shims

compiler_builtins, ffi and other crate-root shims

Other subsystems

Rust code elsewhere in the tree

Methodology

How the numbers are produced — fully reproducible from the scripts in the repository.

For each kernel series ≥ 6.0 the latest patch release is resolved from https://cdn.kernel.org/pub/linux/kernel, the source tarball downloaded and only *.rs files extracted. File sizes come from the extracted sources; line counts (code / comment / blank) from CLOC tool v1.98. Generated bindings that are produced only at build time are not shipped in the tarball and therefore not counted. The share-of-kernel figures come from a second cloc pass over the entire extracted tree (all languages), so the denominator is the whole kernel's SLOC measured the same way as the Rust numerator. Data regenerated with scripts/build.sh; machine-readable results live in data/kernels.json.