rusted-kernel.com
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.
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
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.
Kernel SLOC by language · 7.1.3
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.
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 files per version
Comment lines per version
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.
| Version | Released | Files | Size | SLOC | Comments | Blank | Δ SLOC | Kernel SLOC | Rust % |
|---|---|---|---|---|---|---|---|---|---|
| 6.0.19 | 2023-01-12 | 0 | 0 B | 0 | 0 | 0 | — | 25,029,959 | 0.000% |
| 6.1.177 | 2026-07-04 | 29 | 345.2 KiB | 4,877 | 4,750 | 826 | +4,877 | 25,411,667 | 0.019% |
| 6.2.16 | 2023-05-17 | 37 | 388.4 KiB | 5,543 | 5,454 | 948 | +666 | 25,552,823 | 0.022% |
| 6.3.13 | 2023-07-11 | 38 | 400.3 KiB | 5,538 | 5,696 | 980 | -5 | 25,619,851 | 0.022% |
| 6.4.16 | 2023-09-13 | 55 | 570.7 KiB | 7,696 | 8,126 | 1,280 | +2,158 | 25,929,516 | 0.030% |
| 6.5.13 | 2023-11-28 | 55 | 601.4 KiB | 8,086 | 8,524 | 1,333 | +390 | 26,179,852 | 0.031% |
| 6.6.144 | 2026-07-04 | 61 | 647.9 KiB | 8,704 | 9,020 | 1,429 | +618 | 26,422,294 | 0.033% |
| 6.7.12 | 2024-04-03 | 61 | 665.7 KiB | 8,838 | 9,387 | 1,456 | +134 | 26,791,593 | 0.033% |
| 6.8.12 | 2024-05-30 | 64 | 710.6 KiB | 9,444 | 9,922 | 1,565 | +606 | 26,991,688 | 0.035% |
| 6.9.12 | 2024-07-27 | 65 | 727.5 KiB | 9,717 | 10,061 | 1,598 | +273 | 27,325,387 | 0.036% |
| 6.10.14 | 2024-10-10 | 54 | 421.2 KiB | 5,642 | 5,625 | 980 | -4,075 | 27,476,112 | 0.021% |
| 6.11.11 | 2024-12-05 | 66 | 495.0 KiB | 6,513 | 6,589 | 1,169 | +871 | 28,015,512 | 0.023% |
| 6.12.95 | 2026-07-04 | 79 | 717.0 KiB | 9,651 | 9,123 | 1,775 | +3,138 | 28,232,844 | 0.034% |
| 6.13.12 | 2025-04-20 | 91 | 794.4 KiB | 10,538 | 10,243 | 1,993 | +887 | 28,305,706 | 0.037% |
| 6.14.11 | 2025-06-10 | 105 | 881.2 KiB | 11,769 | 11,310 | 2,321 | +1,231 | 28,480,734 | 0.041% |
| 6.15.11 | 2025-08-20 | 131 | 1.0 MiB | 14,195 | 13,151 | 2,792 | +2,426 | 28,796,193 | 0.049% |
| 6.16.12 | 2025-10-12 | 158 | 1.3 MiB | 19,071 | 16,730 | 3,843 | +4,876 | 28,997,206 | 0.066% |
| 6.17.13 | 2025-12-18 | 182 | 1.6 MiB | 23,186 | 19,474 | 4,752 | +4,115 | 29,153,996 | 0.080% |
| 6.18.38 | 2026-07-04 | 243 | 2.3 MiB | 36,225 | 25,249 | 6,989 | +13,039 | 29,317,955 | 0.124% |
| 6.19.14 | 2026-04-22 | 338 | 4.4 MiB | 89,336 | 35,461 | 11,140 | +53,111 | 29,607,055 | 0.302% |
| 7.0.14 | 2026-06-27 | 345 | 4.5 MiB | 90,607 | 35,502 | 11,446 | +1,271 | 29,902,966 | 0.303% |
| 7.1.3 | 2026-07-04 | 349 | 4.6 MiB | 93,245 | 37,782 | 11,974 | +2,638 | 30,101,072 | 0.310% |
Expand any release for its full category breakdown, driver subsystems and largest files.
| Category | Purpose | Files | Size | SLOC | Share |
|---|
| Path | Size | SLOC |
|---|
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Vendored crates | Third-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros | 13 | 302.6 KiB | 4,115 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 3 | 15.3 KiB | 284 | |
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 6 | 17.5 KiB | 238 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 1 | 5.2 KiB | 132 | |
| Samples & examples | Reference modules demonstrating the Rust API | 4 | 1.3 KiB | 38 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 1 | 1.7 KiB | 37 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.6 KiB | 33 |
| Path | Size | SLOC |
|---|---|---|
| rust/alloc/vec/mod.rs | 104.9 KiB | 1,060 |
| rust/alloc/boxed.rs | 64.2 KiB | 829 |
| rust/alloc/slice.rs | 42.6 KiB | 597 |
| rust/alloc/raw_vec.rs | 20.4 KiB | 273 |
| rust/alloc/borrow.rs | 13.6 KiB | 260 |
| rust/alloc/alloc.rs | 15.6 KiB | 245 |
| rust/alloc/vec/into_iter.rs | 12.1 KiB | 239 |
| rust/macros/module.rs | 12.1 KiB | 235 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Vendored crates | Third-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros | 13 | 307.0 KiB | 4,146 | |
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 10 | 49.4 KiB | 720 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 5 | 19.3 KiB | 389 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 1 | 5.2 KiB | 132 | |
| Samples & examples | Reference modules demonstrating the Rust API | 5 | 3.0 KiB | 79 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 2 | 3.0 KiB | 45 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.5 KiB | 32 |
| Path | Size | SLOC |
|---|---|---|
| rust/alloc/vec/mod.rs | 108.0 KiB | 1,070 |
| rust/alloc/boxed.rs | 64.2 KiB | 829 |
| rust/alloc/slice.rs | 42.6 KiB | 597 |
| rust/kernel/str.rs | 18.0 KiB | 305 |
| rust/alloc/raw_vec.rs | 21.7 KiB | 294 |
| rust/alloc/borrow.rs | 13.6 KiB | 260 |
| rust/alloc/alloc.rs | 15.6 KiB | 245 |
| rust/alloc/vec/into_iter.rs | 12.1 KiB | 239 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Vendored crates | Third-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros | 12 | 293.6 KiB | 3,890 | |
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 12 | 74.5 KiB | 970 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 5 | 19.3 KiB | 389 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 1 | 5.2 KiB | 132 | |
| Samples & examples | Reference modules demonstrating the Rust API | 5 | 3.0 KiB | 79 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 2 | 3.2 KiB | 45 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.5 KiB | 33 |
| Path | Size | SLOC |
|---|---|---|
| rust/alloc/vec/mod.rs | 108.1 KiB | 1,073 |
| rust/alloc/boxed.rs | 64.2 KiB | 829 |
| rust/alloc/slice.rs | 42.6 KiB | 597 |
| rust/kernel/str.rs | 18.0 KiB | 305 |
| rust/alloc/raw_vec.rs | 21.7 KiB | 294 |
| rust/alloc/alloc.rs | 15.6 KiB | 245 |
| rust/alloc/vec/into_iter.rs | 12.1 KiB | 239 |
| rust/macros/module.rs | 8.5 KiB | 225 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Vendored crates | Third-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros | 14 | 304.8 KiB | 4,106 | |
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 23 | 219.4 KiB | 2,620 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 8 | 32.4 KiB | 652 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 1 | 5.2 KiB | 132 | |
| Samples & examples | Reference modules demonstrating the Rust API | 5 | 3.5 KiB | 92 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 2 | 3.2 KiB | 45 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.5 KiB | 33 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 727 B | 16 |
| Path | Size | SLOC |
|---|---|---|
| rust/alloc/vec/mod.rs | 112.9 KiB | 1,125 |
| rust/alloc/boxed.rs | 64.2 KiB | 829 |
| rust/alloc/slice.rs | 42.6 KiB | 597 |
| rust/kernel/init.rs | 48.2 KiB | 546 |
| rust/kernel/init/macros.rs | 39.0 KiB | 408 |
| rust/kernel/str.rs | 18.0 KiB | 305 |
| rust/alloc/raw_vec.rs | 21.7 KiB | 294 |
| rust/alloc/alloc.rs | 15.6 KiB | 245 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Vendored crates | Third-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros | 14 | 325.6 KiB | 4,323 | |
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 23 | 224.2 KiB | 2,689 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 8 | 37.6 KiB | 758 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 1 | 5.2 KiB | 132 | |
| Samples & examples | Reference modules demonstrating the Rust API | 5 | 3.5 KiB | 92 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 2 | 3.2 KiB | 45 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.5 KiB | 32 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 703 B | 15 |
| Path | Size | SLOC |
|---|---|---|
| rust/alloc/vec/mod.rs | 123.6 KiB | 1,181 |
| rust/alloc/boxed.rs | 77.7 KiB | 986 |
| rust/kernel/init.rs | 48.3 KiB | 546 |
| rust/alloc/slice.rs | 30.0 KiB | 452 |
| rust/kernel/init/macros.rs | 39.4 KiB | 408 |
| rust/kernel/str.rs | 18.7 KiB | 318 |
| rust/alloc/raw_vec.rs | 21.7 KiB | 294 |
| rust/alloc/vec/into_iter.rs | 14.9 KiB | 279 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Vendored crates | Third-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros | 14 | 321.9 KiB | 4,271 | |
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 24 | 244.5 KiB | 2,894 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 10 | 50.6 KiB | 936 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 18.0 KiB | 315 | |
| Drivers | Production device drivers written in Rust | 1 | 3.9 KiB | 95 | |
| Samples & examples | Reference modules demonstrating the Rust API | 5 | 3.5 KiB | 92 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 2 | 3.3 KiB | 53 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.6 KiB | 33 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 703 B | 15 |
| Subsystem | Files | Size | SLOC |
|---|---|---|---|
| drivers/net (Networking) | 1 | 3.9 KiB | 95 |
| Path | Size | SLOC |
|---|---|---|
| rust/alloc/vec/mod.rs | 122.1 KiB | 1,137 |
| rust/alloc/boxed.rs | 77.1 KiB | 999 |
| rust/kernel/init/macros.rs | 55.1 KiB | 691 |
| rust/alloc/slice.rs | 30.7 KiB | 469 |
| rust/kernel/init.rs | 45.6 KiB | 389 |
| rust/kernel/str.rs | 18.8 KiB | 318 |
| rust/alloc/raw_vec.rs | 22.7 KiB | 304 |
| rust/alloc/vec/into_iter.rs | 15.3 KiB | 283 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Vendored crates | Third-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros | 14 | 321.9 KiB | 4,271 | |
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 25 | 269.6 KiB | 3,134 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 10 | 47.4 KiB | 926 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 18.0 KiB | 315 | |
| Samples & examples | Reference modules demonstrating the Rust API | 5 | 3.5 KiB | 92 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 2 | 3.3 KiB | 53 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.5 KiB | 32 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 703 B | 15 |
| Path | Size | SLOC |
|---|---|---|
| rust/alloc/vec/mod.rs | 122.1 KiB | 1,137 |
| rust/alloc/boxed.rs | 77.1 KiB | 999 |
| rust/kernel/init/macros.rs | 55.1 KiB | 691 |
| rust/alloc/slice.rs | 30.7 KiB | 469 |
| rust/kernel/init.rs | 44.9 KiB | 389 |
| rust/kernel/str.rs | 18.8 KiB | 318 |
| rust/alloc/raw_vec.rs | 22.7 KiB | 304 |
| rust/alloc/vec/into_iter.rs | 15.3 KiB | 283 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Vendored crates | Third-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros | 14 | 325.7 KiB | 4,288 | |
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 27 | 301.3 KiB | 3,610 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 10 | 52.5 KiB | 939 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 18.3 KiB | 322 | |
| Drivers | Production device drivers written in Rust | 1 | 3.9 KiB | 95 | |
| Samples & examples | Reference modules demonstrating the Rust API | 5 | 3.5 KiB | 92 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 2 | 3.3 KiB | 53 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.4 KiB | 30 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 703 B | 15 |
| Subsystem | Files | Size | SLOC |
|---|---|---|---|
| drivers/net (Networking) | 1 | 3.9 KiB | 95 |
| Path | Size | SLOC |
|---|---|---|
| rust/alloc/vec/mod.rs | 125.2 KiB | 1,153 |
| rust/alloc/boxed.rs | 77.1 KiB | 999 |
| rust/kernel/init/macros.rs | 55.1 KiB | 691 |
| rust/alloc/slice.rs | 30.8 KiB | 469 |
| rust/kernel/net/phy.rs | 30.8 KiB | 464 |
| rust/kernel/init.rs | 45.4 KiB | 389 |
| rust/kernel/str.rs | 18.9 KiB | 323 |
| rust/alloc/raw_vec.rs | 22.7 KiB | 304 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Vendored crates | Third-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros | 14 | 330.1 KiB | 4,357 | |
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 28 | 313.7 KiB | 3,812 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 10 | 52.5 KiB | 939 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 18.4 KiB | 324 | |
| Drivers | Production device drivers written in Rust | 1 | 3.9 KiB | 95 | |
| Samples & examples | Reference modules demonstrating the Rust API | 5 | 3.5 KiB | 92 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 2 | 3.3 KiB | 53 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.4 KiB | 30 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 703 B | 15 |
| Subsystem | Files | Size | SLOC |
|---|---|---|---|
| drivers/net (Networking) | 1 | 3.9 KiB | 95 |
| Path | Size | SLOC |
|---|---|---|
| rust/alloc/vec/mod.rs | 127.1 KiB | 1,181 |
| rust/alloc/boxed.rs | 77.4 KiB | 1,002 |
| rust/kernel/init/macros.rs | 55.1 KiB | 691 |
| rust/alloc/slice.rs | 30.8 KiB | 469 |
| rust/kernel/net/phy.rs | 30.9 KiB | 464 |
| rust/kernel/str.rs | 25.9 KiB | 447 |
| rust/kernel/init.rs | 45.4 KiB | 389 |
| rust/alloc/raw_vec.rs | 24.3 KiB | 326 |
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.
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 31 | 334.6 KiB | 4,057 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 10 | 55.2 KiB | 975 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 18.5 KiB | 325 | |
| Drivers | Production device drivers written in Rust | 1 | 3.9 KiB | 95 | |
| Samples & examples | Reference modules demonstrating the Rust API | 5 | 3.6 KiB | 92 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 2 | 3.3 KiB | 53 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.4 KiB | 30 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 703 B | 15 |
| Subsystem | Files | Size | SLOC |
|---|---|---|---|
| drivers/net (Networking) | 1 | 3.9 KiB | 95 |
| Path | Size | SLOC |
|---|---|---|
| rust/kernel/init/macros.rs | 56.0 KiB | 706 |
| rust/kernel/str.rs | 28.9 KiB | 469 |
| rust/kernel/net/phy.rs | 30.9 KiB | 464 |
| rust/kernel/init.rs | 45.7 KiB | 389 |
| rust/kernel/sync/arc.rs | 27.5 KiB | 279 |
| rust/macros/module.rs | 12.6 KiB | 252 |
| rust/kernel/workqueue.rs | 24.6 KiB | 239 |
| rust/kernel/error.rs | 11.7 KiB | 177 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 42 | 404.5 KiB | 4,845 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 10 | 56.7 KiB | 989 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 19.2 KiB | 341 | |
| Drivers | Production device drivers written in Rust | 2 | 5.7 KiB | 143 | |
| Samples & examples | Reference modules demonstrating the Rust API | 5 | 3.6 KiB | 92 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 2 | 3.3 KiB | 56 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.4 KiB | 31 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 718 B | 16 |
| Subsystem | Files | Size | SLOC |
|---|---|---|---|
| drivers/net (Networking) | 1 | 3.9 KiB | 95 |
| drivers/block (Block) | 1 | 1.8 KiB | 48 |
| Path | Size | SLOC |
|---|---|---|
| rust/kernel/init/macros.rs | 56.0 KiB | 706 |
| rust/kernel/str.rs | 28.9 KiB | 469 |
| rust/kernel/net/phy.rs | 30.9 KiB | 464 |
| rust/kernel/init.rs | 45.6 KiB | 384 |
| rust/kernel/sync/arc.rs | 27.5 KiB | 279 |
| rust/macros/module.rs | 13.0 KiB | 266 |
| rust/kernel/workqueue.rs | 24.7 KiB | 239 |
| rust/kernel/types.rs | 16.8 KiB | 181 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 51 | 583.7 KiB | 7,023 | |
| Drivers | Production device drivers written in Rust | 4 | 42.9 KiB | 998 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 10 | 57.3 KiB | 990 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 21.7 KiB | 398 | |
| Samples & examples | Reference modules demonstrating the Rust API | 5 | 3.6 KiB | 93 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 3 | 4.6 KiB | 80 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.7 KiB | 36 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 981 B | 21 | |
| Other subsystems | Rust code elsewhere in the tree | 1 | 592 B | 12 |
| Subsystem | Files | Size | SLOC |
|---|---|---|---|
| drivers/gpu (GPU / DRM) | 1 | 33.4 KiB | 793 |
| drivers/net (Networking) | 2 | 7.6 KiB | 157 |
| drivers/block (Block) | 1 | 1.8 KiB | 48 |
| Path | Size | SLOC |
|---|---|---|
| drivers/gpu/drm/drm_panic_qr.rs | 33.4 KiB | 793 |
| rust/kernel/init/macros.rs | 61.9 KiB | 759 |
| rust/kernel/rbtree.rs | 48.0 KiB | 496 |
| rust/kernel/str.rs | 29.2 KiB | 483 |
| rust/kernel/net/phy.rs | 31.1 KiB | 469 |
| rust/kernel/init.rs | 48.1 KiB | 408 |
| rust/kernel/alloc/kvec.rs | 27.4 KiB | 401 |
| rust/kernel/list.rs | 26.6 KiB | 327 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 63 | 657.5 KiB | 7,899 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 10 | 61.0 KiB | 1,004 | |
| Drivers | Production device drivers written in Rust | 4 | 42.9 KiB | 999 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 21.3 KiB | 386 | |
| Samples & examples | Reference modules demonstrating the Rust API | 5 | 4.0 KiB | 103 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 3 | 4.6 KiB | 80 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.6 KiB | 35 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 896 B | 20 | |
| Other subsystems | Rust code elsewhere in the tree | 1 | 592 B | 12 |
| Subsystem | Files | Size | SLOC |
|---|---|---|---|
| drivers/gpu (GPU / DRM) | 1 | 33.4 KiB | 793 |
| drivers/net (Networking) | 2 | 7.6 KiB | 157 |
| drivers/block (Block) | 1 | 1.9 KiB | 49 |
| Path | Size | SLOC |
|---|---|---|
| drivers/gpu/drm/drm_panic_qr.rs | 33.4 KiB | 793 |
| rust/kernel/init/macros.rs | 56.3 KiB | 707 |
| rust/kernel/rbtree.rs | 48.0 KiB | 496 |
| rust/kernel/str.rs | 29.2 KiB | 483 |
| rust/kernel/net/phy.rs | 31.3 KiB | 471 |
| rust/kernel/init.rs | 48.1 KiB | 408 |
| rust/kernel/alloc/kvec.rs | 27.2 KiB | 400 |
| rust/kernel/list.rs | 26.5 KiB | 326 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 73 | 732.9 KiB | 8,874 | |
| Drivers | Production device drivers written in Rust | 4 | 43.1 KiB | 1,004 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 10 | 60.9 KiB | 997 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 21.3 KiB | 386 | |
| Samples & examples | Reference modules demonstrating the Rust API | 9 | 15.2 KiB | 359 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 3 | 4.6 KiB | 80 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.7 KiB | 36 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 981 B | 21 | |
| Other subsystems | Rust code elsewhere in the tree | 1 | 592 B | 12 |
| Subsystem | Files | Size | SLOC |
|---|---|---|---|
| drivers/gpu (GPU / DRM) | 1 | 33.4 KiB | 793 |
| drivers/net (Networking) | 2 | 7.6 KiB | 157 |
| drivers/block (Block) | 1 | 2.0 KiB | 54 |
| Path | Size | SLOC |
|---|---|---|
| drivers/gpu/drm/drm_panic_qr.rs | 33.4 KiB | 793 |
| rust/kernel/init/macros.rs | 56.3 KiB | 707 |
| rust/kernel/rbtree.rs | 47.9 KiB | 496 |
| rust/kernel/str.rs | 29.4 KiB | 484 |
| rust/kernel/net/phy.rs | 31.3 KiB | 471 |
| rust/kernel/init.rs | 48.3 KiB | 408 |
| rust/kernel/alloc/kvec.rs | 27.3 KiB | 401 |
| rust/kernel/list.rs | 26.6 KiB | 327 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 78 | 727.8 KiB | 8,803 | |
| pin-init crate | Safe in-place (pinned) initialisation primitives | 15 | 155.1 KiB | 2,275 | |
| Drivers | Production device drivers written in Rust | 10 | 52.3 KiB | 1,270 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 9 | 52.3 KiB | 853 | |
| Samples & examples | Reference modules demonstrating the Rust API | 10 | 17.7 KiB | 436 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 21.4 KiB | 388 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 3 | 5.1 KiB | 101 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.7 KiB | 36 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 981 B | 21 | |
| Other subsystems | Rust code elsewhere in the tree | 1 | 592 B | 12 |
| Subsystem | Files | Size | SLOC |
|---|---|---|---|
| drivers/gpu (GPU / DRM) | 7 | 42.6 KiB | 1,059 |
| drivers/net (Networking) | 2 | 7.7 KiB | 157 |
| drivers/block (Block) | 1 | 2.0 KiB | 54 |
| Path | Size | SLOC |
|---|---|---|
| drivers/gpu/drm/drm_panic_qr.rs | 32.8 KiB | 773 |
| rust/pin-init/src/macros.rs | 56.2 KiB | 711 |
| rust/kernel/str.rs | 30.6 KiB | 513 |
| rust/kernel/rbtree.rs | 47.9 KiB | 496 |
| rust/kernel/net/phy.rs | 31.3 KiB | 471 |
| rust/kernel/alloc/kvec.rs | 27.4 KiB | 401 |
| rust/kernel/list.rs | 36.4 KiB | 392 |
| rust/pin-init/src/lib.rs | 48.4 KiB | 329 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 96 | 995.2 KiB | 12,582 | |
| pin-init crate | Safe in-place (pinned) initialisation primitives | 15 | 163.6 KiB | 2,422 | |
| Drivers | Production device drivers written in Rust | 17 | 81.1 KiB | 1,924 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 9 | 54.0 KiB | 894 | |
| Samples & examples | Reference modules demonstrating the Rust API | 12 | 26.0 KiB | 677 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 21.7 KiB | 402 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 3 | 5.1 KiB | 101 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.7 KiB | 36 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 981 B | 21 | |
| Other subsystems | Rust code elsewhere in the tree | 1 | 592 B | 12 |
| Subsystem | Files | Size | SLOC |
|---|---|---|---|
| drivers/gpu (GPU / DRM) | 13 | 64.6 KiB | 1,555 |
| drivers/cpufreq (CPU frequency) | 1 | 6.8 KiB | 158 |
| drivers/net (Networking) | 2 | 7.7 KiB | 157 |
| drivers/block (Block) | 1 | 2.0 KiB | 54 |
| Path | Size | SLOC |
|---|---|---|
| rust/pin-init/src/macros.rs | 59.2 KiB | 792 |
| drivers/gpu/drm/drm_panic_qr.rs | 33.5 KiB | 787 |
| rust/kernel/cpufreq.rs | 45.2 KiB | 694 |
| rust/kernel/opp.rs | 37.3 KiB | 580 |
| rust/kernel/alloc/kvec.rs | 39.9 KiB | 552 |
| rust/kernel/str.rs | 30.3 KiB | 507 |
| rust/kernel/configfs.rs | 36.4 KiB | 505 |
| rust/kernel/rbtree.rs | 47.8 KiB | 493 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 106 | 1.1 MiB | 14,195 | |
| Drivers | Production device drivers written in Rust | 31 | 191.0 KiB | 4,243 | |
| pin-init crate | Safe in-place (pinned) initialisation primitives | 15 | 168.7 KiB | 2,500 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 9 | 55.0 KiB | 907 | |
| Samples & examples | Reference modules demonstrating the Rust API | 12 | 31.0 KiB | 761 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 21.9 KiB | 404 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 3 | 5.1 KiB | 101 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 1.8 KiB | 39 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 1.0 KiB | 24 | |
| Other subsystems | Rust code elsewhere in the tree | 1 | 592 B | 12 |
| Subsystem | Files | Size | SLOC |
|---|---|---|---|
| drivers/gpu (GPU / DRM) | 27 | 174.5 KiB | 3,874 |
| drivers/cpufreq (CPU frequency) | 1 | 6.8 KiB | 158 |
| drivers/net (Networking) | 2 | 7.7 KiB | 157 |
| drivers/block (Block) | 1 | 2.0 KiB | 54 |
| Path | Size | SLOC |
|---|---|---|
| drivers/gpu/nova-core/vbios.rs | 38.4 KiB | 800 |
| rust/pin-init/src/macros.rs | 59.2 KiB | 792 |
| drivers/gpu/drm/drm_panic_qr.rs | 33.5 KiB | 787 |
| rust/kernel/cpufreq.rs | 45.0 KiB | 689 |
| rust/kernel/opp.rs | 37.2 KiB | 580 |
| rust/kernel/alloc/kvec.rs | 40.9 KiB | 569 |
| rust/kernel/str.rs | 31.4 KiB | 515 |
| rust/kernel/configfs.rs | 36.0 KiB | 497 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 130 | 1.4 MiB | 18,388 | |
| Drivers | Production device drivers written in Rust | 64 | 591.2 KiB | 12,596 | |
| pin-init crate | Safe in-place (pinned) initialisation primitives | 15 | 178.0 KiB | 2,635 | |
| Samples & examples | Reference modules demonstrating the Rust API | 15 | 41.8 KiB | 1,039 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 9 | 54.6 KiB | 901 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 22.1 KiB | 408 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 3 | 5.1 KiB | 101 | |
| Library code | Shared library-style Rust code | 1 | 2.8 KiB | 79 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 2.1 KiB | 41 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 1.1 KiB | 25 | |
| Other subsystems | Rust code elsewhere in the tree | 1 | 592 B | 12 |
| Subsystem | Files | Size | SLOC |
|---|---|---|---|
| drivers/android (Android (binder)) | 18 | 320.1 KiB | 6,840 |
| drivers/gpu (GPU / DRM) | 41 | 246.9 KiB | 5,148 |
| drivers/block (Block) | 2 | 9.7 KiB | 295 |
| drivers/net (Networking) | 2 | 7.7 KiB | 157 |
| drivers/cpufreq (CPU frequency) | 1 | 6.8 KiB | 156 |
| Path | Size | SLOC |
|---|---|---|
| drivers/android/binder/process.rs | 58.3 KiB | 1,316 |
| drivers/android/binder/thread.rs | 60.5 KiB | 1,246 |
| rust/pin-init/src/macros.rs | 68.1 KiB | 921 |
| drivers/android/binder/node.rs | 38.6 KiB | 844 |
| drivers/gpu/nova-core/vbios.rs | 38.1 KiB | 792 |
| drivers/gpu/drm/drm_panic_qr.rs | 33.5 KiB | 787 |
| rust/kernel/cpufreq.rs | 45.0 KiB | 687 |
| rust/kernel/alloc/kvec.rs | 42.5 KiB | 590 |
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.
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Vendored crates | Third-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros | 75 | 1.8 MiB | 46,958 | |
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 140 | 1.5 MiB | 20,680 | |
| Drivers | Production device drivers written in Rust | 71 | 757.3 KiB | 16,030 | |
| pin-init crate | Safe in-place (pinned) initialisation primitives | 15 | 179.9 KiB | 2,651 | |
| Samples & examples | Reference modules demonstrating the Rust API | 17 | 48.4 KiB | 1,200 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 10 | 66.7 KiB | 1,153 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 21.9 KiB | 405 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 3 | 5.1 KiB | 102 | |
| Library code | Shared library-style Rust code | 1 | 2.8 KiB | 79 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 2.1 KiB | 41 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 1.1 KiB | 25 | |
| Other subsystems | Rust code elsewhere in the tree | 1 | 592 B | 12 |
| Subsystem | Files | Size | SLOC |
|---|---|---|---|
| drivers/gpu (GPU / DRM) | 47 | 401.3 KiB | 8,302 |
| drivers/android (Android (binder)) | 18 | 319.9 KiB | 6,833 |
| drivers/block (Block) | 2 | 9.7 KiB | 295 |
| drivers/pwm (pwm) | 1 | 11.9 KiB | 279 |
| drivers/net (Networking) | 2 | 7.9 KiB | 165 |
| drivers/cpufreq (CPU frequency) | 1 | 6.7 KiB | 156 |
| Path | Size | SLOC |
|---|---|---|
| rust/syn/gen/visit.rs | 122.5 KiB | 3,933 |
| rust/syn/gen/fold.rs | 133.8 KiB | 3,894 |
| rust/syn/gen/visit_mut.rs | 124.6 KiB | 3,750 |
| rust/syn/expr.rs | 138.5 KiB | 3,377 |
| rust/syn/gen/debug.rs | 124.4 KiB | 3,235 |
| rust/syn/item.rs | 118.7 KiB | 3,001 |
| rust/syn/gen/hash.rs | 75.2 KiB | 2,873 |
| rust/syn/gen/eq.rs | 91.0 KiB | 2,303 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Vendored crates | Third-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros | 75 | 1.8 MiB | 46,958 | |
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 146 | 1.6 MiB | 21,824 | |
| Drivers | Production device drivers written in Rust | 71 | 771.8 KiB | 16,404 | |
| pin-init crate | Safe in-place (pinned) initialisation primitives | 15 | 135.0 KiB | 2,388 | |
| Samples & examples | Reference modules demonstrating the Rust API | 18 | 50.9 KiB | 1,325 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 9 | 58.0 KiB | 1,007 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 22.1 KiB | 409 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 3 | 5.1 KiB | 102 | |
| Library code | Shared library-style Rust code | 1 | 2.8 KiB | 79 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 2.4 KiB | 53 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 1.1 KiB | 25 | |
| Tooling & tests | Out-of-tree tooling and test harnesses | 1 | 503 B | 21 | |
| Other subsystems | Rust code elsewhere in the tree | 1 | 592 B | 12 |
| Subsystem | Files | Size | SLOC |
|---|---|---|---|
| drivers/gpu (GPU / DRM) | 47 | 413.5 KiB | 8,637 |
| drivers/android (Android (binder)) | 18 | 322.5 KiB | 6,881 |
| drivers/block (Block) | 2 | 9.6 KiB | 290 |
| drivers/pwm (pwm) | 1 | 11.8 KiB | 278 |
| drivers/net (Networking) | 2 | 7.8 KiB | 163 |
| drivers/cpufreq (CPU frequency) | 1 | 6.7 KiB | 155 |
| Path | Size | SLOC |
|---|---|---|
| rust/syn/gen/visit.rs | 122.5 KiB | 3,933 |
| rust/syn/gen/fold.rs | 133.8 KiB | 3,894 |
| rust/syn/gen/visit_mut.rs | 124.6 KiB | 3,750 |
| rust/syn/expr.rs | 138.5 KiB | 3,377 |
| rust/syn/gen/debug.rs | 124.4 KiB | 3,235 |
| rust/syn/item.rs | 118.7 KiB | 3,001 |
| rust/syn/gen/hash.rs | 75.2 KiB | 2,873 |
| rust/syn/gen/eq.rs | 91.0 KiB | 2,303 |
| Category | Purpose | Files | Size | SLOC | Share |
|---|---|---|---|---|---|
| Vendored crates | Third-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros | 75 | 1.8 MiB | 46,958 | |
| Kernel crate | Safe Rust abstractions layered over the C kernel APIs | 150 | 1.7 MiB | 23,811 | |
| Drivers | Production device drivers written in Rust | 71 | 785.9 KiB | 16,988 | |
| pin-init crate | Safe in-place (pinned) initialisation primitives | 15 | 136.8 KiB | 2,419 | |
| Samples & examples | Reference modules demonstrating the Rust API | 18 | 51.7 KiB | 1,368 | |
| Procedural macros | Compiler plumbing: module!, #[vtable], pin-data, etc. | 9 | 57.7 KiB | 1,004 | |
| Kernel build tooling | Codegen and helpers used during the kernel build | 3 | 22.1 KiB | 409 | |
| Core runtime & shims | compiler_builtins, ffi and other crate-root shims | 3 | 5.1 KiB | 102 | |
| Library code | Shared library-style Rust code | 1 | 2.8 KiB | 79 | |
| Generated bindings | Auto-generated raw FFI bindings to C kernel symbols | 1 | 2.2 KiB | 51 | |
| UAPI bindings | Raw bindings to the kernel's userspace API headers | 1 | 909 B | 23 | |
| Tooling & tests | Out-of-tree tooling and test harnesses | 1 | 503 B | 21 | |
| Other subsystems | Rust code elsewhere in the tree | 1 | 592 B | 12 |
| Subsystem | Files | Size | SLOC |
|---|---|---|---|
| drivers/gpu (GPU / DRM) | 47 | 423.6 KiB | 9,120 |
| drivers/android (Android (binder)) | 18 | 327.3 KiB | 6,984 |
| drivers/block (Block) | 2 | 9.6 KiB | 290 |
| drivers/pwm (pwm) | 1 | 10.9 KiB | 276 |
| drivers/net (Networking) | 2 | 7.8 KiB | 163 |
| drivers/cpufreq (CPU frequency) | 1 | 6.7 KiB | 155 |
| Path | Size | SLOC |
|---|---|---|
| rust/syn/gen/visit.rs | 122.5 KiB | 3,933 |
| rust/syn/gen/fold.rs | 133.8 KiB | 3,894 |
| rust/syn/gen/visit_mut.rs | 124.6 KiB | 3,750 |
| rust/syn/expr.rs | 138.5 KiB | 3,377 |
| rust/syn/gen/debug.rs | 124.4 KiB | 3,235 |
| rust/syn/item.rs | 118.7 KiB | 3,001 |
| rust/syn/gen/hash.rs | 75.2 KiB | 2,873 |
| rust/syn/gen/eq.rs | 91.0 KiB | 2,303 |
How each .rs file is classified by its location in the kernel tree.
Safe Rust abstractions layered over the C kernel APIs
Compiler plumbing: module!, #[vtable], pin-data, etc.
Safe in-place (pinned) initialisation primitives
Auto-generated raw FFI bindings to C kernel symbols
Raw bindings to the kernel's userspace API headers
Reference modules demonstrating the Rust API
Production device drivers written in Rust
Codegen and helpers used during the kernel build
Out-of-tree tooling and test harnesses
Shared library-style Rust code
Third-party crates vendored in-tree (syn, quote, proc-macro2) to build the kernel's procedural macros
compiler_builtins, ffi and other crate-root shims
Rust code elsewhere in the tree
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.