How much of the Linux kernel is currently coded in rust?

Its a curiosity thing, but I would like to know How much of the Linux kernel is currently coded in rust ? I means in percent, and if you known it which part ? is there only drivers or is it real part of the kernel in pure rust ?

NB : from the github.com/torvalds/linux page there is a statistic that report no rust.

C 98.3%
Assembly 0.7%
Shell 0.4%
Makefile 0.2%
Python 0.2%
Perl 0.1%
Other 0.1%
Asked By: dominix

||

Running scc on the current kernel tree shows:

───────────────────────────────────────────────────────────────────────────────
Language                 Files     Lines   Blanks  Comments     Code Complexity
───────────────────────────────────────────────────────────────────────────────
C                        33535  23766166  3418052   2665352 17682762    2350608
C Header                 24532   9561797   730157   1434776  7396864      51421
[…]
Rust                        64     20887     1538      9857     9492        877
[…]
───────────────────────────────────────────────────────────────────────────────
Total                    79107  37438114  4702768   4249053 28486293    2424920
───────────────────────────────────────────────────────────────────────────────

so 0.03% of the code (ignoring comments) is written in Rust. For now that’s mostly support code; 6.8 will likely have one phy driver written in Rust.

Answered By: Stephen Kitt
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.