Content deleted Content added
Robbe~enwiki (talk | contribs) stable series nomenclature; archs: some more, organise by CPU |
Fix Disambiguation link Tags: Visual edit Mobile edit Mobile web edit |
||
Line 1:
{{Use dmy dates|date=April 2024}}
{{Infobox software
| name = Linux
| title = Linux Kernel
| logo = [[File:Tux.svg|120px|Tux]]
| logo caption = [[Tux (mascot)|Tux]] the penguin, mascot of Linux<ref name="HvDj4">{{cite web|date=2008 |title=Linux Logos and Mascots |publisher=Linux Online |url=https://www.linux.org/info/logos.html |access-date=19 September 2024|archive-url=https://web.archive.org/web/20100815085106/http://www.linux.org/info/logos.html |archive-date=15 August 2010 |url-status=dead}}</ref>
| screenshot = File:Linux 6.1.0-27 kernel (running on Debian Bookworm).png
| caption = Linux kernel 6.1.0 kernel booting, under [[Debian Bookworm|Debian]]
| developer = Community contributors <br /> [[Linus Torvalds]]
| programming language = [[C (programming language)|C]] (with [[GNU Compiler Collection|GNU extension]]s<!-- also working with clang -->;<ref>{{Cite web |title=GNU Extensions |url=https://people.netfilter.org/rusty/unreliable-guides/kernel-hacking/conventions-gnu-extns.html |access-date=2025-08-04 |website=people.netfilter.org}}</ref> [[C11 (C standard revision)|C11]] (gnu11)<ref>{{Cite web |last=MaskRay |date=2024-05-12 |title=Exploring GNU extensions in the Linux kernel |url=https://maskray.me/blog/2024-05-12-exploring-gnu-extensions-in-linux-kernel |access-date=2025-08-04 |website=MaskRay}}</ref> since 5.18, [[C89 (C version)|C89]] (gnu89) before),<ref>{{cite web |url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e8c07082a810f |title=Kbuild: move to -std=gnu11 |first=Arnd |last=Bergmann |date=3 March 2022 |website=git.kernel.org}}</ref><br /> [[Assembly language]],<br />
[[Rust (programming language)|Rust]], others
| released = 0.02 <small>({{Start date and age|1991|10|5|df=yes}})</small><!--note that 0.01 was not released to public-->
| latest release version = {{wikidata|property|preferred|references|edit|Q14579|P348|P548=Q2804309}}
| latest release date = {{wikidata|qualifier|preferred|single|Q14579|P348|P548=Q2804309|P577}}
| latest preview version = {{wikidata|property|preferred|references|edit|Q14579|P348|P548=Q1072356}}
| latest preview date = {{wikidata|qualifier|preferred|single|Q14579|P348|P548=Q1072356|P577}}
| language = English
| license = [[GNU General Public License|GPL-2.0-only]] with Linux-syscall-note<ref name="COPYING_File" /><ref name="spdx.org GPL-2.0-only">{{cite web|url=https://spdx.org/licenses/GPL-2.0-only.html|title=GPL-2.0-only|website=spdx.org|access-date=2 September 2021}}</ref><ref name="spdx.org Linux-syscall-note">{{cite web|url=https://spdx.org/licenses/Linux-syscall-note.html|title=Linux-syscall-note|website=spdx.org|access-date=2 September 2021}}</ref>{{efn|As a whole, Linux source is provided under the terms of the [[GNU General Public License|GPL-2.0-only]] license with an explicit syscall exception.<ref name="kernel.org GPL-2.0">{{cite web|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/LICENSES/preferred/GPL-2.0|title=GPL-2.0|website=git.kernel.org}}</ref><ref name="kernel.org Linux-syscall-note">{{cite web|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/LICENSES/exceptions/Linux-syscall-note|title=Linux-syscall-note|website=git.kernel.org}}</ref> Aside from that, individual files can be provided under a different license which is required to be compatible with the GPL-2.0-only license (i.e., the GNU General Public License version 2) or a dual license, with one of the choices being the GPL version 2 or a GPLv2 compatible license.<ref name="Linux_Licensing">{{cite web|url=https://www.kernel.org/doc/html/latest/process/license-rules.html#kernel-licensing|title=Linux kernel licensing rules — The Linux Kernel documentation|website=www.kernel.org|access-date=6 January 2020|archive-date=7 March 2020|archive-url=https://web.archive.org/web/20200307065451/https://www.kernel.org/doc/html/latest/process/license-rules.html#kernel-licensing|url-status=live}}</ref>}}
| author = [[Linus Torvalds]]
}}
The '''Linux kernel''' is a [[Free and open-source software|free and open-source]]<ref name="LoveRobert2010">{{Cite book |last=Love |first=Robert |title=Linux kernel development |publisher=[[Addison-Wesley]] |year=2010 |isbn=978-0-672-32946-3 |edition=3rd |___location=Upper Saddle River, NJ |oclc=268788260 |author-link=Robert Love}}</ref>{{Rp|page=4}} [[Unix-like]] [[kernel (operating system)|kernel]] that is used in many [[computer system]]s worldwide. The kernel was created by [[Linus Torvalds]] in 1991 and was soon adopted as the kernel for the [[GNU]] [[operating system]] (OS) which was created to be a [[free software|free]] replacement for [[Unix]]. Since the late 1990s, it has been included in many [[Linux distribution|operating system distributions]], many of which are called [[Linux]]. One such Linux kernel operating system is [[Android (operating system)|Android]] which is used in many mobile and embedded devices.
Most of the kernel code is written in [[C (programming language)|C]] as supported by the [[GNU Compiler Collection]] (GCC) which has extensions beyond standard C.<ref name="LoveRobert2010" />{{rp|page=18}}<ref name="oounl">{{cite web|title=C Extensions (Using the GNU Compiler Collection (GCC))|url=https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/C-Extensions.html#C-Extensions|access-date=13 November 2020|website=gcc.gnu.org|archive-date=20 November 2020|archive-url=https://web.archive.org/web/20201120064908/https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/C-Extensions.html#C-Extensions|url-status=live}}</ref> The code also contains [[assembly language|assembly]] code for architecture-specific logic such as optimizing memory use and task execution.<ref name="LoveRobert2010" />{{Rp|pages=379–380}} The kernel has a [[Modular programming|modular]] design such that modules can be integrated as [[software component]]s {{endash}} including dynamically loaded. The kernel is [[Monolithic kernel|monolithic]] in an architectural sense since the entire OS kernel runs in [[kernel space]].
Linux is provided under the [[GNU General Public License|GNU General Public License version 2]], although it contains files under other [[GPL compatibility|compatible licenses]].<ref name="Linux_Licensing" />
== History ==
{{See also|History of Linux|Linux kernel version history}}
[[File:LinuxCon Europe Linus Torvalds 03 (cropped).jpg|thumb|upright|[[Linus Torvalds]] at the LinuxCon Europe 2014]]
In 1991, Linus Torvalds was a [[computer science]] student enrolled at the [[University of Helsinki]]. During his time there, he began to develop an operating system as a side-project inspired by UNIX, for a personal computer.<ref name="qqGYY">{{cite web|last=Richardson|first=Marjorie|date=1 November 1999|title=Interview: Linus Torvalds|url=http://www.linuxjournal.com/article/3655|url-status=live|archive-url=https://web.archive.org/web/20110514084627/http://www.linuxjournal.com/article/3655|archive-date=14 May 2011|access-date=20 August 2009|publisher=Linux Journal}}</ref> He started with a [[Context switch|task switcher]] in [[x86 assembly language|Intel 80386 assembly language]] and a [[Pseudo terminal|terminal driver]].<ref name="qqGYY" /> On 25 August 1991, Torvalds posted the following to ''comp.os.minix'', a [[Usenet newsgroup|newsgroup]] on [[Usenet]]:<ref name="Torvlads25Aug91">{{cite newsgroup |last=Torvalds |first=Linus Benedict |author-link=Linus Torvalds |date=26 August 1991 |title=What would you like to see most in minix? |newsgroup=comp.os.minix |message-id=1991Aug25.205708.9541@klaava.Helsinki.FI |url=https://groups.google.com/group/comp.os.minix/msg/b813d52cbc5a044b |access-date=14 September 2016 |archive-date=9 May 2013 |archive-url=https://web.archive.org/web/20130509134305/http://groups.google.com/group/comp.os.minix/msg/b813d52cbc5a044b |url-status=live}}</ref>
{{blockquote|I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) [[IBM Personal Computer/AT|AT]] clones. This has been brewing since April, and is starting to get ready. I'd like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other things).<br>I've currently ported [[bash (Unix shell)|bash]](1.08) and [[GNU Compiler Collection|gcc]](1.40), and things seem to work. This implies that I'll get something practical within a few months [...]<br>Yes - it's free of any minix code, and it has a multi-threaded fs. It is NOT protable{{sic}} (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that's all I have :-(.}}
On 17 September 1991, Torvalds prepared version 0.01 of Linux and put on the "ftp.funet.fi" – FTP server of the Finnish University and Research Network ([[FUNET]]). It was not even executable since its code still needed Minix to compile and test it.<ref name="Running Linux">{{Cite book|last1=Welsh|first1=Matt|title=Running Linux|last2=Dalheimer|first2=Matthias Kalle|last3=Kaufman|first3=Lar|publisher=O'Reilly Media, Inc.|year=1999|isbn=1-56592-976-4|edition=3rd|___location=Sebastopol, California|oclc=50638246|page=5|chapter=1: Introduction to Linux}}</ref>
On 5 October 1991, Torvalds announced the first "official" version of Linux, version 0.02.<ref name="Free minix-like kernel sources for 386-AT">{{cite web|url=https://groups.google.com/g/comp.os.minix/c/4995SivOl9o/m/GwqLJlPSlCEJ|title=Free minix-like kernel sources for 386-AT - Google Groups|date=5 October 1991|website=groups.google.com|access-date=19 March 2020|archive-date=1 March 2021|archive-url=https://web.archive.org/web/20210301162937/https://groups.google.com/g/comp.os.minix/c/4995SivOl9o/m/GwqLJlPSlCEJ|url-status=live}}</ref><ref name="Running Linux" />
{{blockquote|[As] I mentioned a month ago, I'm working on a free version of a Minix-lookalike for AT-386 computers. It has finally reached the stage where it's even usable (though may not be depending on what you want), and I am willing to put out the sources for wider distribution. It is just version 0.02...but I've successfully run bash, gcc, gnu-make, gnu-sed, compress, etc. under it.}}
Linux grew rapidly as many developers, including the [[MINIX]] community, contributed to the project.{{Citation needed|date=February 2022}} At the time, the [[GNU Project]] had completed many components for its free UNIX replacement, [[GNU]], but its kernel, the [[GNU Hurd]], was incomplete. The project adopted the Linux kernel for its OS.<ref name="2Ifyf">{{cite book|last=Williams|first=Sam|title=Free as in Freedom: Richard Stallman's Crusade for Free Software|date=March 2002|publisher=[[O'Reilly Media|O'Reilly]]|isbn=0-596-00287-4|chapter=Chapter 9: The GNU General Public License|access-date=12 November 2010|chapter-url=https://archive.org/details/freeasinfreedomr00will}}</ref>
Torvalds labeled the kernel with major version 0 to indicate that it was not yet intended for general use.<ref name="Christine Bresnahan & Richard Blum 2016 107">{{cite book |title=LPIC-2: Linux Professional Institute Certification Study Guide: Exam 201 and Exam 202 |author= Christine Bresnahan & Richard Blum|year=2016 |publisher=John Wiley & Sons |isbn=9781119150794 |page=107}}</ref> Version 0.11, released in December 1991, was the first version to be [[self-hosting (compilers)|self-hosted]]; compiled on a computer running the Linux kernel.
When Torvalds released version 0.12 in February 1992, he adopted the [[GNU General Public License]] version 2 (GPLv2) over his previous self-drafted license, which had not permitted commercial redistribution.<ref name="Relnotes-0.12">{{cite web |last=Torvalds |first=Linus |author-link=Linus Torvalds |title=Release Notes for Linux v0.12 |publisher=The Linux Kernel Archives |url=https://www.kernel.org/pub/linux/kernel/Historic/old-versions/RELNOTES-0.12 |access-date=21 February 2007 |archive-date=19 August 2007 |archive-url=https://web.archive.org/web/20070819045030/http://www.kernel.org/pub/linux/kernel/Historic/old-versions/RELNOTES-0.12 |url-status=live}}</ref> In contrast to [[Unix]], all [[source files]] of Linux are freely available, including [[device drivers]].<ref name="XzMje">{{cite book|author=Fred Hantelmann|title=LINUX Start-up Guide: A self-contained introduction|publisher=Springer Science & Business Media|year=2016|isbn=9783642607493|page=1}}</ref>
The initial success of Linux was driven by programmers and testers across the world. With the support of the [[POSIX]] APIs, through the libC that, whether needed, acts as an entry point to the kernel address space, Linux could run software and applications that had been developed for Unix.<ref name="Fred Hantelmann 2016 16">{{cite book|author=Fred Hantelmann|title=LINUX Start-up Guide: A self-contained introduction|publisher=Springer Science & Business Media|year=2016|isbn=9783642607493|page=16}}</ref>
[[File:Linux kernel ubiquity.svg|thumb|upright=1.3|The Linux kernel supports various hardware architectures, providing a common platform for software, including [[proprietary software]].]]
On 19 January 1992, the first post to the new newsgroup ''alt.os.linux'' was submitted.<ref name="QFvMn">{{cite newsgroup |last=Summers |first=David W. |date=19 January 1992 |title=Troubles with Partitions |newsgroup=alt.os.linux |message-id=1992Jan19.085628.18752@cseg01.uark.edu |url=https://groups.google.com/group/alt.os.linux/msg/c638df159fa15159 |access-date=7 January 2007 |archive-date=2 June 2013 |archive-url=https://web.archive.org/web/20130602210415/http://groups.google.com/group/alt.os.linux/msg/c638df159fa15159 |url-status=live}}</ref> On 31 March 1992, the newsgroup was renamed ''comp.os.linux''.<ref name="paK4Z">{{cite newsgroup |last=Clegg |first=Alan B. |date=31 March 1992 |title=It's here! |newsgroup=comp.os.linux |message-id=1992Mar31.131811.19832@rock.concert.net |url=https://groups.google.com/group/comp.os.linux/msg/81fe3618c4803d1e |access-date=7 January 2007 |archive-date=2 June 2013 |archive-url=https://web.archive.org/web/20130602203914/http://groups.google.com/group/comp.os.linux/msg/81fe3618c4803d1e |url-status=live}}</ref>
The fact that Linux is a [[monolithic kernel]] rather than a [[microkernel]] was the topic of a debate between [[Andrew S. Tanenbaum]], the creator of MINIX, and Torvalds.<ref name="2BA6C">{{cite book |date=1999 |title=Open Sources: Voices from the Open Source Revolution |chapter-url=https://archive.org/details/isbn_9781565925823 |publisher=[[O'Reilly Media|O'Reilly]] |chapter=Appendix A: The Tanenbaum-Torvalds Debate |isbn=1-56592-582-3 |access-date=22 November 2006}}</ref> The [[Tanenbaum–Torvalds debate]] started in 1992 on the [[Usenet]] group ''comp.os.minix'' as a general discussion about kernel architectures.<ref name="vghTe">{{cite newsgroup |title=LINUX is obsolete |last=Tanenbaum |first=Andy |author-link=Andrew S. Tanenbaum |date=29 January 1992 |newsgroup=comp.os.minix |message-id=12595@star.cs.vu.nl |url=https://groups.google.com/group/comp.os.minix/msg/f447530d082cd95d |access-date=10 May 2006 |archive-date=17 October 2011 |archive-url=https://web.archive.org/web/20111017163006/http://groups.google.com/group/comp.os.minix/msg/f447530d082cd95d |url-status=live}}</ref><ref name="pUfrR">{{cite web |title=Tanenbaum-Torvalds Debate: Part II |url=http://www.cs.vu.nl/~ast/reliable-os/ |last=Tanenbaum |first=Andy |author-link=Andrew S. Tanenbaum |date=12 May 2006 |publisher=[[VU University Amsterdam]] |access-date=6 January 2007 |archive-date=5 August 2015 |archive-url=https://web.archive.org/web/20150805132304/http://www.cs.vu.nl/~ast/reliable-os/ |url-status=live}}</ref>
Version 0.96 released in May 1992 was the first capable of running the [[X Window System]].<ref>{{Cite web|url=https://www.krsaborio.net/linux-kernel/research/1992/0504.html|title=0.96 out next week|website=www.krsaborio.net}}</ref><ref>{{Cite web|url=https://kernel.googlesource.com/pub/scm/linux/kernel/git/nico/archive/+/refs/tags/v0.96a|title=refs/tags/v0.96a - pub/scm/linux/kernel/git/nico/archive - Git at Google|website=kernel.googlesource.com}}</ref> In March 1994, Linux 1.0.0 was released with 176,250 lines of code.<ref name="Jqib7">{{cite web |last=Hayward|first=David|date=22 November 2012 |title=The history of Linux: how time has shaped the penguin |url=https://www.techradar.com/news/software/operating-systems/the-history-of-linux-how-time-has-shaped-the-penguin-1113914/2 |url-status=live |archive-url=https://web.archive.org/web/20200319065522/https://www.techradar.com/news/software/operating-systems/the-history-of-linux-how-time-has-shaped-the-penguin-1113914/2 |archive-date=19 March 2020 |access-date=26 March 2020 |website=TechRadar |language=en}}</ref> As indicated by the version number, it was the first version considered suitable for a [[Deployment environment|production environment]].<ref name="Christine Bresnahan & Richard Blum 2016 107" /> In June 1996, after release 1.3, Torvalds decided that Linux had evolved enough to warrant a new major number, and so labeled the next release as version 2.0.0.<ref name="Christine Bresnahan & Richard Blum 2016 108">{{cite book |title=LPIC-2: Linux Professional Institute Certification Study Guide: Exam 201 and Exam 202 |author= Christine Bresnahan & Richard Blum|year=2016 |publisher=John Wiley & Sons |isbn=9781119150794 |page=108}}</ref><ref name="2.0.0 release">{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/9606.1/0056.html |title=Linux 2.0 really _is_ released.. |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=9 June 1996 |mailing-list=[[LKML]] |access-date=8 March 2015 |archive-date=2 April 2015 |archive-url=https://web.archive.org/web/20150402091044/http://lkml.iu.edu/hypermail/linux/kernel/9606.1/0056.html |url-status=live}}</ref> Significant features of 2.0 included [[symmetric multiprocessing]] (SMP), support for more processors types and support for selecting specific hardware targets and for enabling architecture-specific features and optimizations.<ref name="Fred Hantelmann 2016 16" /> The ''make *config'' family of commands of ''kbuild'' enable and configure options for building ad hoc kernel executables ([[vmlinux]]) and loadable modules.<ref name=":10">{{cite web|title=Kernel Build System — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/kbuild/index.html|access-date=17 July 2020|website=Kernel.org|archive-date=22 July 2020|archive-url=https://web.archive.org/web/20200722122129/https://www.kernel.org/doc/html/latest/kbuild/index.html|url-status=live}}</ref><ref name=":11">{{cite web|title=Kconfig make config — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/kbuild/kconfig.html|access-date=13 September 2020|website=Kernel.org|archive-date=17 July 2020|archive-url=https://web.archive.org/web/20200717132644/https://www.kernel.org/doc/html/latest/kbuild/kconfig.html|url-status=live}}</ref>
Version 2.2, released on 20 January 1999,<ref name="2.2.0 release">{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/9901.2/1084.html |title=2.2.0-final |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=20 January 1999 |mailing-list=[[LKML]] |access-date=8 March 2015 |archive-date=2 April 2015 |archive-url=https://web.archive.org/web/20150402144000/http://lkml.iu.edu/hypermail/linux/kernel/9901.2/1084.html |url-status=live}}</ref> improved locking granularity and SMP management, added [[m68k]], [[PowerPC]], [[SPARC|Sparc64]], [[DEC Alpha|Alpha]], and other 64-bit platforms support.<ref name=":16" /> Furthermore, it added new [[file systems]] including [[Microsoft]]'s [[NTFS]] read-only capability.<ref name=":16">{{cite web |url=http://kniggit.net/wonderful-world-linux/wonderful-world-linux-2-2/ |title=The Wonderful World of Linux 2.2 |date=26 January 1999 |access-date=27 October 2008 |archive-date=6 November 2014 |archive-url=https://web.archive.org/web/20141106030845/http://kniggit.net/wonderful-world-linux/wonderful-world-linux-2-2/ |url-status=live}}</ref> In 1999, IBM published its patches to the Linux 2.2.13 code for the support of the [[IBM System/390|S/390]] architecture.<ref name="df5gk">{{cite web|url=http://linuxvm.org/penguinvm/notes.html|title=Linux/390 Observations and Notes|website=linuxvm.org|access-date=29 March 2020|archive-date=26 February 2019|archive-url=https://web.archive.org/web/20190226085302/http://linuxvm.org/penguinvm/notes.html|url-status=live}}</ref>
Version 2.4.0, released on 4 January 2001,<ref name="2.4.0 release">{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/0101.0/0776.html |title=And oh, btw.. |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=4 January 2001 |mailing-list=[[LKML]] |access-date=8 March 2015 |archive-date=26 January 2016 |archive-url=https://web.archive.org/web/20160126231619/http://lkml.iu.edu/hypermail/linux/kernel/0101.0/0776.html |url-status=live}}</ref> contained support for [[Industry Standard Architecture|ISA]] [[Plug and Play]], [[Universal Serial Bus|USB]], and [[PC Card]]s. Linux 2.4 added support for the [[Pentium 4]] and [[Itanium]] (the latter introduced the [[IA-64|ia64]] ISA that was jointly developed by Intel and Hewlett-Packard to supersede the older [[PA-RISC]]), and for the newer [[MIPS architecture|64-bit MIPS]] processor.<ref name="WWOL24">{{cite web|url=http://kniggit.net/wwol24.html|archive-url=https://web.archive.org/web/20050317071343/http://www.kniggit.net/wwol24.html|url-status=dead|archive-date=17 March 2005|title=The Wonderful World of Linux 2.4|access-date=27 October 2008}}</ref> Development for 2.4.''x'' changed a bit in that more features were made available throughout the series, including support for [[Bluetooth]], [[Logical Volume Manager (Linux)|Logical Volume Manager]] (LVM) version 1, [[RAID]] support, [[InterMezzo (file system)|InterMezzo]] and [[ext3]] file systems.
Version 2.6.0 was released on 17 December 2003.<ref name="2.6.0 release">{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/0312.2/0348.html |title=Linux 2.6.0 |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=17 December 2003 |mailing-list=[[LKML]] |access-date=28 February 2015 |archive-date=2 April 2015 |archive-url=https://web.archive.org/web/20150402162542/http://lkml.iu.edu/hypermail/linux/kernel/0312.2/0348.html |url-status=live}}</ref> The development for 2.6.''x'' changed further towards including new features throughout the series. Among the changes that have been made in the 2.6 series are: integration of [[μClinux]] into the mainline kernel sources, [[Physical Address Extension|PAE]] support, support for several new lines of [[Central processing unit|CPUs]], integration of Advanced Linux Sound Architecture (ALSA) into the mainline kernel sources, support for up to 2<sup>32</sup> users (up from 2<sup>16</sup>), support for up to 2<sup>29</sup> process IDs (64-bit only, 32-bit architectures still limited to 2<sup>15</sup>),<ref name="Lguxu">{{cite web|url=http://man7.org/linux/man-pages/man5/proc.5.html|title=proc(5) - Linux manual page|type=see /proc/sys/kernel/pid_max|access-date=19 February 2014|archive-date=7 February 2014|archive-url=https://web.archive.org/web/20140207232837/http://man7.org/linux/man-pages/man5/proc.5.html|url-status=live}}</ref> substantially increased the number of device types and the number of devices of each type, improved [[64-bit]] support, support for [[file system]]s which support file sizes of up to 16 [[terabyte]]s, in-kernel [[Preemption (computing)|preemption]], support for the [[Native POSIX Thread Library]] (NPTL), [[User-mode Linux]] integration into the mainline kernel sources, [[Security-Enhanced Linux|SELinux]] integration into the mainline kernel sources, [[InfiniBand]] support, and considerably more.
Starting with 2.6.x releases, the kernel supported a large number of file systems; some designed for Linux, like [[ext3]], [[ext4]], [[Filesystem in Userspace|FUSE]], [[Btrfs]],<ref name="rY8Ml">{{cite web|title=btrfs Wiki|url=https://btrfs.wiki.kernel.org/index.php/Main_Page|access-date=17 July 2020|website=btrfs.wiki.kernel.org|archive-date=25 April 2012|archive-url=https://web.archive.org/web/20120425151829/https://btrfs.wiki.kernel.org/|url-status=live}}</ref> and others native to other operating systems like [[JFS (file system)|JFS]], [[XFS]], Minix, [[Xenix]], [[IRIX|Irix]], [[Solaris (operating system)|Solaris]], [[System V]], [[Microsoft Windows|Windows]] and [[MS-DOS]].<ref name="Fred Hantelmann 2016 1–2">{{cite book|author=Fred Hantelmann|title=LINUX Start-up Guide: A self-contained introduction|publisher=Springer Science & Business Media|year=2016|isbn=9783642607493|pages=1–2}}</ref>
Though development had not used a [[version control|version control system]] thus far, in 2002, Linux developers adopted [[BitKeeper]], which was made freely available to them even though it was not [[free software]]. In 2005, because of efforts to [[reverse-engineer]] it, the company which owned the software revoked its support of the Linux community. In response, Torvalds and others wrote [[Git (software)|Git]]. The new system was written within weeks, and in two months the first official kernel made using it was released.<ref name="0eXeT">{{cite mailing list |mailing-list=git-commits-head |author=Linux Kernel Mailing List |url=http://marc.info/?l=git-commits-head&m=111904216911731 |title=Linux 2.6.12 |date=17 June 2005 |access-date=23 January 2008 |archive-date=26 January 2016 |archive-url=https://web.archive.org/web/20160126231629/http://marc.info/?l=git-commits-head&m=111904216911731 |url-status=live}}</ref>
In 2005 the ''stable team'' was formed as a response to the lack of a kernel tree where people could work on [[software bug|bug fixes]], and it would keep updating ''stable'' versions.<ref name="2.6.16-longterm">{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/0608.0/1111.html |title=Adrian Bunk is now taking over the 2.6.16-stable branch |last=Kroah-Hartman |first=Greg |author-link=Greg Kroah-Hartman |date=3 August 2006 |mailing-list=[[LKML]] |access-date=21 February 2015 |archive-date=26 January 2016 |archive-url=https://web.archive.org/web/20160126231617/http://lkml.iu.edu/hypermail/linux/kernel/0608.0/1111.html |url-status=live}}</ref> In February 2008 the ''linux-next'' tree was created to serve as a place where patches aimed to be merged during the next development cycle gathered.<ref name="zZKMh">{{cite mailing list |url=https://lkml.org/lkml/2008/2/11/512 |title=Announce: Linux-next (Or Andrew's dream :-)) |last=Rothwell |first=Stephen |date=12 February 2008 |mailing-list=[[LKML]] |access-date=30 October 2010 |archive-date=24 November 2010 |archive-url=https://web.archive.org/web/20101124235700/http://lkml.org/lkml/2008/2/11/512 |url-status=live}}</ref><ref name="CY4pJ">{{cite web |url=https://lwn.net/Articles/269120/ |title=linux-next and patch management process |last=Corbet |first=Jonathan |date=21 October 2010 |work=[[LWN.net]] |publisher=Eklektix, Inc |access-date=30 October 2010 |archive-date=21 June 2010 |archive-url=https://web.archive.org/web/20100621034215/http://lwn.net/Articles/269120/ |url-status=live}}</ref> Several subsystem maintainers also adopted the suffix ''-next'' for trees containing code which they mean to submit for inclusion in the next release cycle. {{As of|2014|January}}, the in-development version of Linux is held in an unstable branch named ''linux-next''.<ref name="4hjhG">{{cite web |url=http://www.kernel.org |title=The Linux Kernel Archives |publisher=Kernel.org |access-date=22 January 2014 |archive-date=30 January 1998 |archive-url=https://web.archive.org/web/19980130085039/http://www.kernel.org/ |url-status=live}}</ref>
The 20th anniversary of Linux was celebrated by Torvalds in July 2011 with the release of version 3.0.0.<ref name="Christine Bresnahan & Richard Blum 2016 108" /> As 2.6 had been the version number for 8 years, a new ''uname26'' personality that reports 3.x as 2.6.40+x had to be added to the kernel so that old programs would work.<ref name="To3tT">{{cite web |title=Add a personality to report 2.6.x version numbers [LWN.net] |url=https://lwn.net/Articles/451168/ |website=lwn.net |access-date=15 July 2020 |archive-date=16 July 2020 |archive-url=https://web.archive.org/web/20200716092939/https://lwn.net/Articles/451168/ |url-status=live}}</ref>
Version 3.0 was released on 22 July 2011.<ref name="3.0 release">{{cite web |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=21 July 2011 |title=Linux 3.0 release |publisher=[[Linux kernel mailing list]] |url=http://lkml.indiana.edu/hypermail/linux/kernel/1107.2/01843.html |access-date=16 May 2013 |archive-date=18 October 2019 |archive-url=https://web.archive.org/web/20191018044641/http://lkml.iu.edu/hypermail/linux/kernel/1107.2/01843.html |url-status=live}}</ref> On 30 May 2011, Torvalds announced that the big change was "NOTHING. Absolutely nothing." and asked, "...let's make sure we really make the next release not just an all new shiny number, but a good kernel too."<ref name="q0tsu">{{cite mailing list |url=http://permalink.gmane.org/gmane.linux.kernel/1147415 |title=Linux 3.0-rc1 |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=30 May 2011 |mailing-list=[[LKML]] |access-date=1 July 2013 |archive-url=https://web.archive.org/web/20110531232747/http://permalink.gmane.org/gmane.linux.kernel/1147415 |archive-date=31 May 2011 |url-status=dead }}</ref> After the expected 6–7 weeks of the development process, it would be released near the 20th anniversary of Linux.
On 11 December 2012, Torvalds decided to reduce kernel complexity by removing support for [[i386]] processors—specifically by not having to [[Emulator|emulate]]<ref>{{cite web |url=https://yarchive.net/comp/linux/semaphores.html |title=Re: [PATCH] i386 rw_semaphores fix |last=Torvalds |first=Linus |date=2001-04-10 |website=yarchive.net |access-date=2024-05-26}}</ref> the [[Atomic (computer science)|atomic]] [[X86 instruction listings#Added with 80486|CMPXCHG]] instruction introduced with the [[i486]] to allow reliable [[mutex]]es—making the 3.7 kernel series the last one still supporting the original processor.<ref name="KPoEx">{{cite web |url=https://www.zdnet.com/article/good-bye-386-linux-to-drop-support-for-i386-chips-with-next-major-release/ |title=Good-Bye 386: Linux to drop support for i386 chips with next major release |last=Vaughan-Nichols |first=Steven J. |date=13 December 2012 |work=[[ZDNet]] |publisher=[[CBS Interactive]] |access-date=6 February 2013 |archive-date=17 February 2015 |archive-url=https://web.archive.org/web/20150217232706/http://www.zdnet.com/article/good-bye-386-linux-to-drop-support-for-i386-chips-with-next-major-release/ |url-status=live}}</ref><ref name="l9vgy">{{cite web |url=https://www.engadget.com/2012/12/15/linux-to-drop-i386-support-in-the-3-8-kernel/ |title=Linux to drop i386 support in the 3.8 kernel, make us upgrade our Doom rig |last=Fingas |first=Jon |date=15 December 2012 |work=[[Engadget]] |publisher=[[AOL]] |access-date=22 March 2015 |archive-date=2 April 2015 |archive-url=https://web.archive.org/web/20150402141004/http://www.engadget.com/2012/12/15/linux-to-drop-i386-support-in-the-3-8-kernel/ |url-status=live}}</ref> The same series unified support for the [[ARM architecture|ARM]] processor.<ref name="0lwal">{{cite web |url=https://www.zdnet.com/article/linux-3-7-arrives-arm-developers-rejoice/ |title=Linux 3.7 arrives, ARM developers rejoice |last=Vaughan-Nichols |first=Steven J. |date=11 December 2012 |work=[[ZDNet]] |publisher=[[CBS Interactive]] |access-date=6 February 2013 |archive-date=5 November 2014 |archive-url=https://web.archive.org/web/20141105164320/http://www.zdnet.com/linux-3-7-arrives-arm-developers-rejoice-7000008638/ |url-status=live}}</ref>
The numbering change from 2.6.39 to 3.0, and from 3.19 to 4.0, involved no meaningful technical differentiation; the major version number was increased simply to avoid large minor numbers.<ref name="3.0 release" /><ref name="4.0 release">{{cite mailing list |url=https://lkml.org/lkml/2015/4/12/178 |title=Linux 4.0 released |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=12 April 2015 |mailing-list=[[LKML]] |access-date=12 April 2015 |archive-date=13 April 2015 |archive-url=https://web.archive.org/web/20150413015619/https://lkml.org/lkml/2015/4/12/178 |url-status=live}}</ref> Stable 3.x.y kernels were released until 3.19 in February 2015. Version 3.11, released on 2 September 2013,<ref name="3.11.0 release">{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/1309.0/00650.html |title=Linux 3.11 |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=2 September 2013 |mailing-list=[[LKML]] |access-date=3 September 2013 |archive-date=26 February 2014 |archive-url=https://web.archive.org/web/20140226021932/http://lkml.iu.edu//hypermail/linux/kernel/1309.0/00650.html |url-status=live}}</ref> added many new features such as new {{Mono|O_TMPFILE}} flag for {{man|2|open|Linux||inline}} to reduce temporary file vulnerabilities, experimental AMD [[Radeon]] dynamic power management, low-latency network polling, and [[zswap]] (compressed swap cache).<ref name="n7jTp">{{cite web |title=Linux 3.11 |url=http://kernelnewbies.org/Linux_3.11 |publisher=kernelnewbies.org |date=2 September 2013 |access-date=21 January 2014}}</ref>
In April 2015, Torvalds released kernel version 4.0.<ref name="Christine Bresnahan & Richard Blum 2016 108" /> By February 2015, Linux had received contributions from nearly 12,000 programmers from more than 1,200 companies, including some of the world's largest software and hardware vendors.<ref name="3eoKz">{{cite web |date=18 February 2015 |title=The Linux Foundation Releases Linux Development Report |publisher=[[Linux Foundation]] |url=http://www.linuxfoundation.org/news-media/announcements/2015/02/linux-foundation-releases-linux-development-report |access-date=20 February 2015 |url-status=dead |archive-url=https://web.archive.org/web/20160719042639/https://www.linuxfoundation.org/news-media/announcements/2015/02/linux-foundation-releases-linux-development-report |archive-date=19 July 2016 }}</ref> Version 4.1 of Linux, released in June 2015, contains over 19.5 million lines of code contributed by almost 14,000 programmers.<ref name="lx7F0">{{cite web |author=Michael Larabel |date=23 June 2014 |title=Linux Kernel At 19.5 Million Lines Of Code, Continues Rising |publisher=[[Phoronix]] |url=https://www.phoronix.com/scan.php?page=news_item&px=Linux-19.5M-Stats |access-date=23 June 2015 |archive-date=23 November 2020 |archive-url=https://web.archive.org/web/20201123170810/https://www.phoronix.com/scan.php?page=news_item&px=Linux-19.5M-Stats |url-status=live}}</ref>
Linus Torvalds announced that kernel version 4.22 would instead be numbered 5.0 in March 2019, stating that "'5.0' doesn't mean anything more than that the 4.x numbers started getting big enough that I ran out of fingers and toes."<ref name=":17">{{Cite web |last=Torvalds |first=Linus |date=3 March 2019 |title=Linus Torvalds: Linux 5.0 |url=https://lkml.org/lkml/2019/3/3/236 |url-status=live |archive-url=https://web.archive.org/web/20240825123800/https://lkml.org/lkml/2019/3/3/236 |archive-date=25 August 2024 |access-date=25 August 2024 |website=LKML}}</ref> It featured many major additions such as support for the AMD Radeon [[FreeSync]] and [[Nvidia|NVIDIA]] Xavier display, fixes for [[F2FS]], [[Ext4|EXT4]] and [[XFS]], restored support for swap files on the [[Btrfs]] [[file system]] and continued work on the [[Intel]] [[Ice Lake (microprocessor)|Icelake]] Gen11 graphics and on the [[NXP Semiconductors|NXP]] [[I.MX|i.MX8]] SoCs.<ref>{{Cite news |last=Prakash |first=Abhishek |date=11 January 2023 |title=Linux Kernel 5.0 Released! Check Out The New Features |url=https://itsfoss.com/linux-kernel-5/ |access-date=25 August 2024 |work=[[It's FOSS]]}}</ref><ref>{{Cite web |last=Larabel |first=Micheal |date=6 January 2019 |title=The Many New Features & Improvements Of The Linux 5.0 Kernel |url=https://www.phoronix.com/review/linux-2019-features |access-date=2024-08-25 |website=www.phoronix.com |language=en}}</ref> This release was noticeably larger than the rest, Torvalds mentioning that "The overall changes for all of the 5.0 release are much bigger."<ref name=":17" />
A total of 1,991 developers, of whom 334 were first-time collaborators, added more than 553,000 lines of code to version 5.8, breaking the record previously held by version 4.9.<ref name="xkq10">{{cite web|last=Corbet|first=Jonathan|date=3 August 2020|title=Some statistics from the 5.8 kernel cycle|url=https://lwn.net/Articles/827735/|access-date=11 August 2020|website=LWN - Linux Weekly News|archive-date=4 September 2020|archive-url=https://web.archive.org/web/20200904084101/https://lwn.net/Articles/827735/|url-status=live}}</ref>
== Popularity ==
{{Main|Usage share of operating systems}}
According to the Stack Overflow's annual Developer Survey of 2019, more than 53% of all respondents have developed software for [[Linux]] and about 27% for [[Android (operating system)|Android]],<ref name="MqCDa">{{cite web|url=https://insights.stackoverflow.com/survey/2019/|title=Stack Overflow Developer Survey 2019 - most popular technologies|website=Stack Overflow|access-date=17 March 2020|archive-date=8 October 2020|archive-url=https://web.archive.org/web/20201008033536/https://insights.stackoverflow.com/survey/2019/?utm_source=social-share&utm_medium=social&utm_campaign=dev-survey-2019|url-status=live}}</ref> although only about 25% develop with Linux-based operating systems.<ref name="sXZWF">{{cite web|url=https://insights.stackoverflow.com/survey/2019#development-environments-and-tools|title=Stack Overflow Developer Survey 2019 - development environments and tools|website=Stack Overflow|access-date=17 March 2020|archive-date=7 March 2020|archive-url=https://web.archive.org/web/20200307082721/https://insights.stackoverflow.com/survey/2019#development-environments-and-tools|url-status=live}}</ref>
Most websites run on [[Linux|Linux-based operating systems]],<ref name="vjxfE">{{cite web|title=Usage Statistics and Market Share of Operating Systems for Websites, March 2020|url=https://w3techs.com/technologies/overview/operating_system|access-date=17 March 2020|website=w3techs.com}}</ref><ref name="qUSpE">{{cite web|title=Usage Statistics and Market Share of Unix for Websites, March 2020|url=https://w3techs.com/technologies/details/os-unix|access-date=17 March 2020|website=w3techs.com}}</ref> and all of the [[TOP500|world's 500 most powerful supercomputers]] run on Linux.<ref name="top500stats2">{{ cite web |title=TOP500 Supercomputer Sites: Operating system Family / Linux |url=https://www.top500.org/statistics/details/osfam/1 |publisher=Top500.org |url-status= live |archive-url=https://web.archive.org/web/20121119205719/https://www.top500.org/statistics/details/osfam/1 |archive-date=19 November 2012 |access-date= 10 August 2025 }}</ref>
[[Linux distribution]]s bundle the kernel with [[system software]] (e.g., the [[GNU C Library]], [[systemd]], and other [[Unix]] [[Utility software|utilities]] and [[Daemon (computing)|daemons]]) and a wide selection of [[application software]], but their [[Usage share of desktop operating systems|usage share]] in desktops is low in comparison to other operating systems.
[[Android (operating system)|Android]], which runs on a modified Linux kernel, accounts for the majority of mobile device operating systems,<ref name="OVx4S">{{cite press release |title=Gartner Says Sales of Tablets Will Represent Less Than 10 Percent of All Devices in 2014 |url=http://www.gartner.com/newsroom/id/2875017 |___location=[[Egham|Egham, UK]] |publisher=[[Gartner]] |date=15 October 2014 |access-date=19 October 2014 |archive-date=17 October 2014 |archive-url=https://web.archive.org/web/20141017151529/http://www.gartner.com/newsroom/id/2875017 |url-status=dead}}</ref><ref name="oQC5P">{{cite web |url=https://techcrunch.com/2014/10/15/tablet-sales-growth-plummets-in-2014-as-android-smartphones-continue-to-soar-gartner |title=Tablet Sales Growth Plummets In 2014 As Android Smartphones Continue To Soar: Gartner |last=Lunden |first=Ingrid |date=15 October 2014 |work=[[TechCrunch]] |publisher=[[AOL]] |access-date=23 October 2014 |archive-date=23 October 2014 |archive-url=https://web.archive.org/web/20141023114800/http://techcrunch.com/2014/10/15/tablet-sales-growth-plummets-in-2014-as-android-smartphones-continue-to-soar-gartner/ |url-status=live}}</ref><ref name="2c2eU">{{cite press release |title=Global PC Shipments Exceed Forecast with Mild Improvement in Consumer Demand, While Apple Moves to #5 Spot, According to IDC |url=http://www.idc.com/getdoc.jsp?containerId=prUS25187214 |___location=[[Framingham, Massachusetts|Framingham, MA]] |publisher=[[International Data Corporation|IDC]] |date=8 October 2014 |access-date=19 October 2014 |url-status=dead |archive-url=https://web.archive.org/web/20141011215307/http://www.idc.com/getdoc.jsp?containerId=prUS25187214 |archive-date=11 October 2014 }}</ref> and is increasingly being used in [[Linux on embedded systems|embedded devices]], making it a significant driver of Linux adoption.<ref name="Fred Hantelmann 2016 16" />
== Value ==
[[File:Redevelopment costs of Linux kernel.png|thumb|Redevelopment costs of Linux kernel]]
The cost to redevelop version 2.6.0 of the Linux kernel in a traditional proprietary development setting has been estimated to be US$612 million (€467M, £394M) in 2004 prices using the [[COCOMO]] person-month estimation model.<ref name="a4RtJ">{{cite web |url = https://www.dwheeler.com/essays/linux-kernel-cost.html |title = Linux Kernel 2.6: It's Worth More! |last = Wheeler |first = David A. |access-date = 18 January 2007 |archive-date = 20 August 2011 |archive-url = https://web.archive.org/web/20110820092909/http://www.dwheeler.com/essays/linux-kernel-cost.html |url-status = live}}</ref> In 2006, a study funded by the European Union put the redevelopment cost of kernel version 2.6.8 higher, at €882M ($1.14bn, £744M).<ref name="yORjV">{{cite web|url=http://ec.europa.eu/enterprise/sectors/ict/files/2006-11-20-flossimpact_en.pdf|title=Economic impact of FLOSS on innovation and competitiveness of the EU ICT sector|type=Table 3 on page 50|access-date=8 January 2011|archive-date=15 February 2010|archive-url=https://web.archive.org/web/20100215190539/http://ec.europa.eu/enterprise/sectors/ict/files/2006-11-20-flossimpact_en.pdf|url-status=live}}</ref>
This topic was revisited in October 2008 by Amanda McPherson, Brian Proffitt, and Ron Hale-Evans. Using David A. Wheeler's methodology, they estimated redevelopment of the 2.6.25 kernel now costs $1.3bn (part of a total $10.8bn to redevelop Fedora 9).<ref name="e80cn">{{cite web|url=http://www.linuxfoundation.org/publications/estimatinglinux.pdf|title=Estimating Total Development Cost Of a Linux Distribution|type=Table on page 6|url-status=dead|archive-url=https://web.archive.org/web/20100711025812/http://www.linuxfoundation.org/publications/estimatinglinux.pdf|archive-date=11 July 2010}}</ref> Again, Garcia-Garcia and Alonso de Magdaleno from University of Oviedo (Spain) estimate that the value annually added to kernel was about €100M between 2005 and 2007 and €225M in 2008, it would cost also more than €1bn (about $1.4bn as of February 2010) to develop in the European Union.<ref name="mvmLl">{{cite web |url=http://linux.slashdot.org/story/10/02/24/155214/The-Billion-Dollar-Kernel |title=The Billion Dollar Kernel |publisher=Linux.slashdot.org |date=24 February 2010 |access-date=12 November 2010 |archive-date=15 May 2011 |archive-url=https://web.archive.org/web/20110515003125/http://linux.slashdot.org/story/10/02/24/155214/The-Billion-Dollar-Kernel |url-status=live}}</ref>
{{As of|2011|3|7}}, using then-current [[Source lines of code|LOC]] (lines of code) of a 2.6.x Linux kernel and wage numbers with David A. Wheeler's calculations it would cost approximately $3bn (about €2.2bn) to redevelop the Linux kernel as it keeps getting bigger. An updated calculation {{as of|2018|9|26|lc=y}}, using then-current 20,088,609 LOC (lines of code) for the 4.14.14 Linux kernel and the current US national average programmer salary of $75,506 show that it would cost approximately $14,725,449,000 (£11,191,341,000) to rewrite the existing code.<ref name="rjeGU">{{cite web|last=Wheeler|first=David|title=The Linux Kernel: It's Worth More!|url=https://dwheeler.com/essays/linux-kernel-cost.html|access-date=17 September 2012|archive-url=https://web.archive.org/web/20210224011056/https://dwheeler.com/essays/linux-kernel-cost.html |archive-date=24 February 2021 |url-status=live}}</ref>
== Distribution ==
Most who use Linux do so via a [[Linux distribution]]. Some distributions ship the vanilla or stable kernel. However, several vendors (such as [[Red Hat]] and [[Debian]]) maintain a customized source tree. These are usually updated at a slower pace than the vanilla branch, and they usually include all fixes from the relevant stable branch, but at the same time they can also add support for drivers or features which had not been released in the vanilla version the distribution vendor started basing its branch from.
== Developers ==
=== Community ===
{{Chart|definition=Growth of the Linux kernel by number of lines of code.chart|data=Growth of the Linux kernel by number of lines of code.tab|Width=600|caption=Graph of the sizes of Linux Kernel versions in millions of lines of code<ref>{{Cite web |title=The Linux Kernel Archives |url=https://www.kernel.org/ |access-date=28 February 2023 |website=www.kernel.org}}</ref>.}}
<!-- To update, download a kernel version from the citation above (kernel.org), untar and count lines with "find . -type f -not -regex '\./\.git/.*' | xargs cat | wc -l". Only major versions and the last version are displayed for readability. Update at Data:Growth of the Linux kernel by number of lines of code.tab on Commons -->
The community of Linux kernel developers comprises about 5000–6000 members. According to the "2017 State of Linux Kernel Development", a study issued by the Linux Foundation, covering the commits for the releases 4.8 to 4.13, about 1500 developers were contributing from about 200–250 companies on average. The top 30 developers contributed a little more than 16% of the code. For companies, the top contributors are Intel (13.1%) and Red Hat (7.2%), Linaro (5.6%), IBM (4.1%), the second and fifth places are held by the 'none' (8.2%) and 'unknown' (4.1%) categories.<ref name="bXrVc">{{cite web|title=2017 State of Linux Kernel Development|url=https://www.linuxfoundation.org/publications/2017/10/2017-state-of-linux-kernel-development/|date=25 October 2017|website=The Linux Foundation|language=en-US|access-date=27 May 2020|archive-date=27 May 2020|archive-url=https://web.archive.org/web/20200527074644/https://www.linuxfoundation.org/publications/2017/10/2017-state-of-linux-kernel-development/|url-status=live}}</ref>
{{Blockquote|text=
"Instead of a roadmap, there are technical guidelines. Instead of a central resource allocation, there are persons and companies who all have a stake in the further development of the Linux kernel, quite independently from one another:
People like Linus Torvalds and I don’t plan the kernel evolution. We don’t sit there and think up the roadmap for the next two years, then assign resources to the various new features. That's because we don’t have any resources. The resources are all owned by the various corporations who use and contribute to Linux, as well as by the various independent contributors out there. It's those people who own the resources who decide..."|sign=[[Andrew Morton (computer programmer)|Andrew Morton]], 2005}}
{{image frame|align=center|caption=Corporate affiliation of contributions to the Linux kernel, 4.8–4.13<ref name="bXrVc"/>
|width=900
|content={{Stacked bar | height=18px | vertical_caption=
|T1=[[Intel]]|A1=13.1|C1=#0072c6
|T2=''None''|A2=8.2|C2=#ccc
|T3=[[Red Hat]]|A3=7.2|C3=#e00
|T4=[[Linaro]]|A4=5.6|C4=#96c72e
|T5=''Unknown''|A5=4.1|C5=#ccc
|T6=[[IBM]]|A6=4.1|C6=#1870c0
|T7=''Consultants''|A7=3.3|C7=#ccc
|T8=[[Samsung]]|A8=3.2|C8=#004da4
|T9=SUSE|A9=3|C9=#30BA78
|T10=Google|A10=3|C10=#fbbc05
|T11=''nearly 500 other<br/>companies''|A11=45.2|C11=#eee}}
}}
=== Conflict ===
Notable conflicts among Linux kernel developers:
* In July 2007, [[Con Kolivas]] announced that he would cease developing for the Linux kernel.<ref name="ConKolivas">{{cite web |title=Why I quit: kernel developer Con Kolivas |url=http://apcmag.com/node/6735/ |access-date=15 August 2011 |date=24 July 2007 |work=APC Magazine |publisher=ACP Magazines |archive-url=https://web.archive.org/web/20110707151924/http://apcmag.com/why_i_quit_kernel_developer_con_kolivas.htm |archive-date = 7 July 2011}}</ref><ref name="hbWwd">{{cite web |first=Jonathan |last=Corbet |title=Re: -mm merge plans for 2.6.23 |publisher=LWN.net |date=25 July 2007 |url=https://lwn.net/Articles/242768/ |access-date=10 February 2018 |archive-date=11 February 2018 |archive-url=https://web.archive.org/web/20180211131406/https://lwn.net/Articles/242768/ |url-status=live}}</ref>
* In July 2009, [[Alan Cox (computer programmer)|Alan Cox]] quit his role as the [[Tty (Unix)|TTY]] layer maintainer after disagreement with Torvalds.<ref name="Cqshf">{{cite web |first=Alan |last=Cox |title=Re: [PATCH] kdesu broken |url=https://lkml.org/lkml/2009/7/28/375 |date=28 July 2009 |access-date=10 February 2018 |archive-date=11 February 2018 |archive-url=https://web.archive.org/web/20180211190040/https://lkml.org/lkml/2009/7/28/375 |url-status=live}}</ref>
* In December 2010, there was a discussion between Linux SCSI maintainer James Bottomley and SCST maintainer Vladislav Bolkhovitin about which SCSI target stack should be included in the Linux kernel.<ref name="LnsQz">{{cite web |first=Goldwyn |last=Rodrigues |title=A tale of two SCSI targets |url=https://lwn.net/Articles/424004/ |date=22 January 2011 |access-date=14 February 2018 |archive-date=15 February 2018 |archive-url=https://web.archive.org/web/20180215204201/https://lwn.net/Articles/424004/ |url-status=live}}</ref> This made some Linux users upset.<ref name="mvbGZ">{{cite web |first=Andreas |last=Steinmetz |title=LIO - the broken iSCSI target implementation |url=https://lkml.org/lkml/2013/1/16/803 |date=17 January 2013 |access-date=14 February 2018 |archive-date=15 February 2018 |archive-url=https://web.archive.org/web/20180215204140/https://lkml.org/lkml/2013/1/16/803 |url-status=live}}</ref>
* In June 2012, Torvalds made it very clear that he [[The finger|did not agree]] with [[NVIDIA]] releasing its drivers as closed.<ref name="TYyez">{{cite web |last=Paul |first=Ryan |date=19 June 2012 |title=Linus Torvalds says "f–k you" to NVIDIA |url=https://arstechnica.com/information-technology/2012/06/linus-torvalds-says-f-k-you-to-nvidia/ |url-status=live |archive-url=https://web.archive.org/web/20180215023959/https://arstechnica.com/information-technology/2012/06/linus-torvalds-says-f-k-you-to-nvidia/ |archive-date=15 February 2018 |access-date=14 February 2018 |language=en}}</ref>
* In April 2014, Torvalds banned [[Kay Sievers]] from submitting patches to the Linux kernel for failing to deal with [[Software bug|bugs]] that caused [[systemd]] to negatively interact with the kernel.<ref name="SkO7Y">{{cite web |author=John Gold |title=Linus Torvalds suspends key Linux developer: Kernel panic as Systemd dev pokes the bear |url=https://www.networkworld.com/article/2175826/linus-torvalds-suspends-key-linux-developer.html |date=3 April 2014 |access-date=24 March 2019 |archive-date=24 March 2019 |archive-url=https://web.archive.org/web/20190324195212/https://www.networkworld.com/article/2175826/linus-torvalds-suspends-key-linux-developer.html |url-status=live}}</ref>
* In October 2014, [[Lennart Poettering]] accused Torvalds of tolerating the rough discussion style on Linux kernel related mailing lists and of being a bad role model.<ref name="LWM1n">{{cite web |first=Lennart |last=Poettering |title=On the sickness of the Linux Kernel Community |url=https://plus.google.com/+LennartPoetteringTheOneAndOnly/posts/J2TZrTvu7vd |website=Google+ |date=6 October 2014 |access-date=10 February 2018 |archive-url=https://web.archive.org/web/20180527195108/https://plus.google.com/+LennartPoetteringTheOneAndOnly/posts/J2TZrTvu7vd |archive-date=27 May 2018 |url-status=dead}}</ref>
* In March 2015, Christoph Hellwig filed a lawsuit against [[VMware]] for infringement of the copyright on the Linux kernel.<ref name="vMANt">{{cite web |first=Jon |last=Brodkin |title=VMware alleged to have violated Linux's open source license for years |url=https://arstechnica.com/tech-policy/2015/03/vmware-alleged-to-have-violated-linuxs-open-source-license-for-years/ |website=Ars Technica |date=6 March 2015 |access-date=14 February 2018 |archive-date=15 February 2018 |archive-url=https://web.archive.org/web/20180215023512/https://arstechnica.com/tech-policy/2015/03/vmware-alleged-to-have-violated-linuxs-open-source-license-for-years/ |url-status=live}}</ref> Linus Torvalds made it clear that he did not agree with this and similar initiatives by calling lawyers a festering disease.<ref name="7mJER">{{cite web |first=Kieren |last=McCarthy |title=Having offended everyone else in the world, Linus Torvalds calls own lawyers a 'nasty festering disease' |url=https://www.theregister.co.uk/2016/08/26/linus_torvalds_calls_own_lawyers_nasty_festering_disease/ |website=The Register |date=26 August 2016 |access-date=14 February 2018 |archive-date=15 February 2018 |archive-url=https://web.archive.org/web/20180215023540/https://www.theregister.co.uk/2016/08/26/linus_torvalds_calls_own_lawyers_nasty_festering_disease/ |url-status=live}}</ref>
* In April 2021, a team from the [[University of Minnesota]] was found to be submitting "bad faith" patches to the kernel as part of its research. This resulted in the immediate reversion of all patches ever submitted by a member of the university. In addition, a warning was issued by a senior maintainer that any future patch from the university would be rejected on sight.<ref>{{cite web |last1=Kroah-Hartman |first1=Greg |title=[PATCH 000/190] Revertion of all of the umn.edu commits |url=https://lore.kernel.org/lkml/20210421130105.1226686-1-gregkh@linuxfoundation.org/ |website=Linux Kernel Mailing List Archive |access-date=13 January 2022}}</ref><ref>{{cite news |last1=Chin |first1=Monica |title=How a university got itself banned from the Linux kernel |url=https://www.theverge.com/2021/4/30/22410164/linux-kernel-university-of-minnesota-banned-open-source |access-date=13 January 2022 |publisher=The Verge |date=30 April 2021}}</ref>
Prominent Linux kernel developers have been aware of the importance of avoiding conflicts between developers.<ref name="zcauf">{{cite web |first=Jonathan |last=Corbet |title=KS2007: Developer relations and development process |url=https://lwn.net/Articles/249104/ |website=LWN.net |date=10 September 2007 |access-date=11 February 2018 |archive-date=12 February 2018 |archive-url=https://web.archive.org/web/20180212142109/https://lwn.net/Articles/249104/ |url-status=live}}</ref> For a long time there was no code of conduct for kernel developers due to opposition by Torvalds.<ref name="Dfxum">{{cite web |first=Jon |last=Brodkin |title=Linus Torvalds defends his right to shame Linux kernel developers |url=https://arstechnica.com/information-technology/2013/07/linus-torvalds-defends-his-right-to-shame-linux-kernel-developers/ |website=ARS Technica |date=16 July 2013 |access-date=11 February 2018 |archive-date=17 February 2018 |archive-url=https://web.archive.org/web/20180217143017/https://arstechnica.com/information-technology/2013/07/linus-torvalds-defends-his-right-to-shame-linux-kernel-developers/ |url-status=live}}</ref> However, a Linux Kernel ''Code of Conflict'' was introduced on 8 March 2015.<ref name="a51oD">{{cite web |first=Jonathan |last=Corbet |title=The kernel's code of conflict |url=https://lwn.net/Articles/635999/ |website=LWN.net |date=9 March 2015 |access-date=11 February 2018 |archive-date=12 February 2018 |archive-url=https://web.archive.org/web/20180212142143/https://lwn.net/Articles/635999/ |url-status=live}}</ref> It was replaced on 16 September 2018 by a new ''Code of Conduct'' based on the [[Contributor Covenant]]. This coincided with a public apology by Torvalds and a brief break from kernel development.<ref name="gluP1">{{cite web|url=https://lwn.net/SubscriberLink/765108/f1a80a6d6a6ff0f4/|title=Code, conflict, and conduct|first=Jonathan|last=Corbet|publisher=[[LWN.net]]|date=18 September 2018|access-date=19 September 2018|archive-date=19 September 2018|archive-url=https://web.archive.org/web/20180919175320/https://lwn.net/SubscriberLink/765108/f1a80a6d6a6ff0f4/|url-status=live}}</ref><ref name="bLQrs">{{cite magazine|url=https://www.newyorker.com/science/elements/after-years-of-abusive-e-mails-the-creator-of-linux-steps-aside|title=After Years of Abusive E-mails, the Creator of Linux Steps Aside|first=Noam|last=Cohen|magazine=[[The New Yorker]]|date=19 September 2018|access-date=24 September 2018|archive-date=20 February 2020|archive-url=https://web.archive.org/web/20200220085413/https://www.newyorker.com/science/elements/after-years-of-abusive-e-mails-the-creator-of-linux-steps-aside|url-status=live}}</ref> On 30 November 2018, complying with the ''Code of Conduct'', Jarkko Sakkinen of Intel sent out patches replacing instances of "fuck" appearing in source code comments with suitable versions focused on the word 'hug'.<ref name="6hCGb">{{cite web |last1=Larabel |first1=Michael |title=Dropping Profanity In Kernel Code Comments: Linux Gets "Hugs" |url=https://www.phoronix.com/scan.php?page=news_item&px=Linux-Kernel-Hugs |website=Phoronix |access-date=15 June 2019 |archive-date=21 April 2019 |archive-url=https://web.archive.org/web/20190421094724/https://www.phoronix.com/scan.php?page=news_item&px=Linux-Kernel-Hugs |url-status=live}}</ref>
Developers who feel treated unfairly can report this to the [[Linux Foundation]] Technical Advisory Board.<ref name="9XiLD">{{cite web |title=Code of Conflict |url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/code-of-conflict.rst |access-date=4 February 2018}}{{Dead link|date=February 2020 |bot=InternetArchiveBot |fix-attempted=yes}}</ref> In July 2013, the maintainer of the USB 3.0 driver [[Sage Sharp]] asked Torvalds to address the abusive commentary in the kernel development community. In 2014, Sharp backed out of Linux kernel development, saying that "The focus on technical excellence, in combination with overloaded maintainers, and people with different cultural and social norms, means that Linux kernel maintainers are often blunt, rude, or brutal to get their job done".<ref name="XFXHf">{{cite web |first=Simon |last=Sharwood |title=Linux kernel dev who asked Linus Torvalds to stop verbal abuse quits over verbal abuse |url=https://www.theregister.co.uk/2015/10/06/linix_kernel_dev_who_asked_linus_torvalds_to_stop_swearing_quits_over_swearing/ |website=The Register |date=6 October 2015 |access-date=4 February 2018 |archive-date=29 March 2020 |archive-url=https://web.archive.org/web/20200329075939/https://www.theregister.co.uk/2015/10/06/linix_kernel_dev_who_asked_linus_torvalds_to_stop_swearing_quits_over_swearing/ |url-status=live}}</ref> At the linux.conf.au (LCA) conference in 2018, developers expressed the view that the culture of the community has gotten much better in the past few years. Daniel Vetter, the maintainer of the Intel drm/i915 graphics kernel driver, commented that the "rather violent language and discussion" in the kernel community has decreased or disappeared.<ref name="R8yIB">{{cite web |first=Jake |last=Edge |title=Too many lords, not enough stewards |url=https://lwn.net/Articles/745817/ |website=LWN.net |date=31 January 2018 |access-date=4 February 2018 |archive-date=9 November 2020 |archive-url=https://web.archive.org/web/20201109004145/https://lwn.net/Articles/745817/ |url-status=live}}</ref>
Laurent Pinchart asked developers for feedback on their experiences with the kernel community at the 2017 Embedded Linux Conference Europe. The issues brought up were discussed a few days later at the Maintainers Summit. Concerns over the lack of consistency in how maintainers responded to patches submitted by developers were echoed by [[Shuah Khan]], the maintainer of the kernel self-test framework. Torvalds contended that there would never be consistency in the handling of patches because different kernel subsystems have, over time, adopted different development processes. Therefore, it was agreed upon that each kernel subsystem maintainer would document the rules for patch acceptance.<ref name="I88RB">{{cite web |first=Jonathan |last=Corbet |title=Bash the kernel maintainers |url=https://lwn.net/Articles/738222/ |website=LWN.net |date=6 November 2017 |access-date=4 February 2018 |archive-date=26 January 2021 |archive-url=https://web.archive.org/web/20210126003428/https://lwn.net/Articles/738222/ |url-status=live}}</ref>
== Development ==
{{Blockquote|text=Linux is evolution, not [[intelligent design]]!|sign=Linus Torvalds, 2005<ref name="dk5Lm">{{cite web |url=http://www.sprg.uniroma2.it/kernelhacking2008/lectures/lkhc08-01b.pdf |title=Linux Evolution |date=26 March 2008 |access-date=6 November 2013 |archive-date=14 December 2013 |archive-url=https://web.archive.org/web/20131214074153/http://www.sprg.uniroma2.it/kernelhacking2008/lectures/lkhc08-01b.pdf |url-status=live}}</ref><ref name="BSPdA">{{cite web |url=http://www.cs.huji.ac.il/~feit/papers/LinuxDev12JSS.pdf |title=Perpetual Development: A Model of the Linux Kernel Life Cycle |date=25 October 2011 |access-date=6 November 2013 |archive-date=17 October 2013 |archive-url=https://web.archive.org/web/20131017210855/http://www.cs.huji.ac.il/~feit/papers/LinuxDev12JSS.pdf |url-status=live}}</ref><ref name="mv11e">{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/0802.1/2159.html |title=Re: Announce: Linux-next (Or Andrew's dream :-)) |date=12 February 2008 |access-date=30 January 2017 |mailing-list=Linux Kernel Mailing List |last=Kroah-Hartman |first=Greg |archive-date=2 February 2017 |archive-url=https://web.archive.org/web/20170202070946/http://lkml.iu.edu/hypermail/linux/kernel/0802.1/2159.html |url-status=live}}</ref>|source=}}
=== Codebase ===
The kernel source code, a.k.a. source tree, is managed in the [[Git]] [[version control system]] {{endash}} also created by Torvalds.<ref name="eL0QP">{{cite book |title=Linux Kernel Development: Linux Kernel Development |author= Robert Love|year=2010 |publisher=Pearson Education |isbn=9780768696790 |page=11}}</ref>
{{As of|2021}}, the 5.11 release of the Linux kernel had around 30.34 million lines of code. Roughly 14% of the code is part of the "core," including architecture-specific code, kernel code, and memory management code, while 60% is drivers.
<!-- Line counting is done with "find . -type f -not -regex '\./\.git/.*' | xargs cat | wc -l", computation of percentages with "du -s arch/kernel/mm and so on" -->
=== Contributions ===
Contributions are submitted as patches, in the form of text messages on the [[Linux kernel mailing list]] (LKML) (and often also on other mailing lists dedicated to particular subsystems). The patches must conform to a set of rules and to a formal language that, among other things, describes which lines of code are to be deleted and what others are to be added to the specified files. These patches can be automatically processed so that system administrators can apply them in order to make just some changes to the code or to incrementally upgrade to the next version.<ref name="vRGYk">{{cite book |title=Linux Kernel Development: Linux Kernel Development |author= Robert Love|year=2010 |publisher=Pearson Education |isbn=9780768696790 |page=12}}</ref> Linux is distributed also in [[GNU zip]] (gzip) and [[bzip2]] formats.
A developer who wants to change the Linux kernel writes and tests a code change. Depending on how significant the change is and how many subsystems it modifies, the change will either be submitted as a single patch or in multiple patches of [[source code]]. In case of a single subsystem that is maintained by a single maintainer, these patches are sent as e-mails to the maintainer of the subsystem with the appropriate mailing list in Cc. The maintainer and the readers of the mailing list will review the patches and provide feedback. Once the review process has finished the subsystem maintainer accepts the patches in the relevant [[Git]] kernel tree. If the changes to the Linux kernel are bug fixes that are considered important enough, a pull request for the patches will be sent to Torvalds within a few days. Otherwise, a pull request will be sent to Torvalds during the next merge window. The merge window usually lasts two weeks and starts immediately after the release of the previous kernel version.<ref name="nOVy6">{{cite web |title=How the development process works |url=https://www.kernel.org/doc/html/latest/process/2.Process.html |access-date=4 February 2018 |archive-date=9 December 2017 |archive-url=https://web.archive.org/web/20171209130758/https://www.kernel.org/doc/html/latest/process/2.Process.html |url-status=live}}</ref> The Git kernel source tree names all developers who have contributed to the Linux kernel in the ''Credits'' directory and all subsystem maintainers are listed in ''Maintainers''.<ref name="45qbF">{{cite book |title=Linux Kernel Development: Linux Kernel Development |author= Robert Love|year=2010 |publisher=Pearson Education |isbn=9780768696790 |page=13}}</ref>
As with many large open-source software projects, developers are required to adhere to the [[Contributor Covenant]], a [[code of conduct]] intended to address harassment of minority contributors.<ref>{{cite web |title=Contributor Covenant Code of Conduct |url=https://www.kernel.org/doc/html/latest/process/code-of-conduct.html |website=The Linux Kernel documentation |access-date=6 October 2021}}</ref><ref>{{cite web |title=Linux Kernel Contributor Covenant Code of Conduct Interpretation |url=https://www.kernel.org/doc/html/latest/process/code-of-conduct-interpretation.html |website=The Linux Kernel Documentation |access-date=6 October 2021}}</ref> Additionally, to prevent offense the use of [[inclusive language|inclusive terminology]] within the source code is mandated.<ref>{{cite web |last1=Williams |first1=Dan |title=[PATCH] CodingStyle: Inclusive Terminology |url=https://lkml.org/lkml/2020/7/4/229 |website=Linux Kernel Mailing List}}</ref>
=== Programming language ===
{{See also|Rust for Linux}}
Linux is written in a special [[C (programming language)|C programming language]] supported by [[GNU Compiler Collection|GCC]], a compiler that extends the C standard in many ways, for example using [[inline assembler|inline sections of code]] written in the [[assembly language]] (in GCC's "AT&T-style" syntax) of the target architecture.
In September 2021, the GCC version requirement for compiling and building the Linux kernel increased from GCC 4.9 to 5.1, allowing the potential for the kernel to be moved from using C code based on the [[ANSI C#C89|C89]] standard to using code written with the [[C11 (C standard revision)|C11]] standard,<ref>{{Cite web |last=Tim Anderson |title=Linux kernel minimum compiler raised to GCC 5.1, allowing potential C11 use |url=https://www.theregister.com/2021/09/15/linux_kernel_gcc_5_1/ |access-date=12 May 2023 |website=[[The Register]] |language=en}}</ref> with the migration to the standard taking place in March 2022, with the release of Linux 5.18.<ref>{{Cite web |last=Larabel |first=Michael |title=The Switch Has Been Made From C89 To C11/GNU11 With Linux 5.18 |url=https://www.phoronix.com/news/Linux-5.18-Does-C11 |access-date=12 May 2023 |website=www.phoronix.com |language=en}}</ref>
Initial support for the [[Rust (programming language)|Rust]] programming language was added in Linux 6.1<ref name="rust">{{Cite web |last=Proven |first=Liam |title=Linux 6.1: Rust to hit mainline kernel |url=https://www.theregister.com/2022/10/05/rust_kernel_pull_request_pulled/ |access-date=12 May 2023 |website=[[The Register]] |language=en}}</ref> which was released in December 2022,<ref>{{Cite web |last=Sharwood |first=Simon |title=Linus Torvalds reveals Linux kernel 6.1 |url=https://www.theregister.com/2022/12/11/linux_6_1/ |date=11 December 2022 |access-date=12 May 2023 |website=[[The Register]] |language=en}}</ref> with later kernel versions, such as Linux 6.2 and Linux 6.3, further improving the support.<ref>{{Cite web |last=Corbet |first=Jonathan |title=Rust in the 6.2 kernel |url=https://lwn.net/Articles/914458/ |access-date=12 May 2023 |website=[[LWN.net]]}}</ref><ref>{{Cite web |last=Larabel |first=Michael |title=More Rust Code Readied For Linux 6.3 - Closer To Having Rust Drivers Upstreamed |url=https://www.phoronix.com/news/Rust-Linux-6.3-Changes |access-date=12 May 2023 |website=Phoronix |language=en}}</ref>
=== Coding style ===
Since 2002, code must adhere to the 21 rules comprising the ''Linux Kernel Coding Style.''<ref name="tJSfW">{{cite web|url=https://www.kernel.org/doc/html/latest/process/howto.html#documentation|title=HOWTO do Linux kernel development — The Linux Kernel documentation|website=Kernel.org|access-date=4 January 2020|archive-date=7 March 2020|archive-url=https://web.archive.org/web/20200307065439/https://www.kernel.org/doc/html/latest/process/howto.html#documentation|url-status=live}}</ref><ref name="EugD6">{{cite web|url=https://www.kernel.org/doc/html/latest/process/coding-style.html|title=Linux kernel coding style — The Linux Kernel documentation|website=Kernel.org|access-date=4 January 2020|archive-date=5 January 2020|archive-url=https://web.archive.org/web/20200105083545/https://www.kernel.org/doc/html/latest/process/coding-style.html|url-status=live}}</ref>
=== Versioning ===
As for most software, the kernel is versioned as a series of dot-separated numbers.
For early versions, the version consisted of three or four dot-separated numbers called ''major release'', ''minor release'' and ''revision.''<ref name="LoveRobert2010" />{{Rp|page=9}} At that time, odd-numbered minor releases were for development and testing, while even numbered minor releases for production. The optional fourth digit indicated a patch level.<ref name="Christine Bresnahan & Richard Blum 2016 107" /> Development releases were indicated with a release candidate suffix (''-rc'').
The current versioning conventions are different. The odd/even number implying dev/prod has been dropped, and a major version is indicated by the first two numbers together. While the time-frame is open for the development of the next major, the -rcN suffix is used to identify the n'th release candidate for the next version.<ref name=":2">{{cite web|url=https://www.kernel.org/doc/html/latest/process/2.Process.html#the-big-picture|title=How the development process works — The Linux Kernel documentation|website=Kernel.org|access-date=26 March 2020|archive-date=9 December 2017|archive-url=https://web.archive.org/web/20171209130758/https://www.kernel.org/doc/html/latest/process/2.Process.html#the-big-picture|url-status=live}}</ref> For example, the release of the version 4.16 was preceded by seven 4.16-rcN (from -rc1 to -rc7). Once a stable version is released, its maintenance is passed to the ''stable team''. Updates to a stable release are identified by a three-number scheme (e.g., 4.16.1, 4.16.2, ...).<ref name=":2" />
=== Toolchain ===
The kernel is usually built with the [[GNU toolchain]]. The GNU C compiler, GNU cc, part of the [[GNU Compiler Collection]] (GCC), is the default [[compiler]] for mainline Linux. Sequencing is handled by GNU [[Make (Unix)|make]]. The [[GNU Assembler]] (often called GAS or GNU as) outputs the [[object file]]s from the GCC generated [[Assembly language|assembly]] code. Finally, the [[GNU linker|GNU Linker]] (GNU ld) produces a statically linked executable kernel file called {{Mono|[[vmlinux]]}}. Both {{Mono|as}} and {{Mono|ld}} are part of [[GNU Binary Utilities]] (binutils).
GNU cc was for a long time the only compiler capable of correctly building Linux. In 2004, [[Intel]] claimed to have modified the kernel so that [[Intel C++ Compiler|its C compiler]] was also capable of compiling it.<ref name="yXTuf">{{cite web|url=http://www.pyrillion.org/index.html?showframe=linuxkernelpatch.html |title=Linux kernel patch for Intel Compiler |last=Kubbilun |first=Ingo A. |date=2 June 2004 |publisher=Pyrillion.org |access-date=12 November 2010 |archive-url=https://web.archive.org/web/20110722090031/http://www.pyrillion.org/index.html?showframe=linuxkernelpatch.html |archive-date=22 July 2011 |language=de |url-status=dead}}</ref> There was another such reported success in 2009, with a modified 2.6.22 version.<ref name="y2O2m">{{cite web |url=http://linux.slashdot.org/article.pl?sid=09/02/26/2216241 |title=High Performance Linux Kernel Project — LinuxDNA |author=timothy |date=26 February 2009 |work=[[Slashdot|Slashdot Linux]] |publisher=[[Dice Holdings]] |access-date=30 October 2010 |archive-date=18 October 2019 |archive-url=https://web.archive.org/web/20191018044639/https://linux.slashdot.org/story/09/02/26/2216241/high-performance-linux-kernel-project-linuxdna |url-status=live}}</ref><ref name="CdkkU">{{cite web |url=http://www.linuxjournal.com/content/linuxdna-supercharges-linux-intel-cc-compiler |title=LinuxDNA Supercharges Linux with the Intel C/C++ Compiler |last=Ryan |first=Justin |date=25 February 2009 |work=[[Linux Journal]] |publisher=Belltown Media, Inc. |access-date=30 October 2010 |archive-date=9 November 2020 |archive-url=https://web.archive.org/web/20201109011614/https://www.linuxjournal.com/content/linuxdna-supercharges-linux-intel-cc-compiler |url-status=live}}</ref> Support for the Intel compiler has been dropped in 2023.<ref>{{Cite web|title=Linux 6.3 Drops Support For The Intel ICC Compiler|url=https://www.phoronix.com/news/Linux-6.3-Drops-Intel-ICC|last=Larabel|first=Michael|date=5 March 2023|access-date=6 March 2023|website=Phoronix|language=en}}</ref>
Since 2010, effort has been underway to build Linux with [[Clang]], an alternative compiler for the C language;<ref name="ksPmC">{{cite mailing list| url=http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-October/011711.html |title=Clang builds a working Linux Kernel (Boots to RL5 with SMP, networking and X, self hosts) |last=Lelbach |first=Bryce |mailing-list=cfe-dev |date=25 October 2010 |archive-url=https://web.archive.org/web/20150907044958/http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-October/011711.html |archive-date=7 September 2015}}</ref> as of 12 April 2014, the official kernel could almost be compiled by Clang.<ref name="05DS8">{{cite web |url=https://www.phoronix.com/scan.php?page=news_item&px=MTY2MjY |title=Linux 3.15 Can Almost Be Compiled Under LLVM's Clang |last=Larabel |first=Michael |author-link=Michael Larabel |date=12 April 2014 |publisher=[[Phoronix]] |access-date=10 June 2014 |archive-date=13 August 2020 |archive-url=https://web.archive.org/web/20200813143201/https://www.phoronix.com/scan.php?page=news_item&px=MTY2MjY |url-status=live}}</ref><ref name="QlWNo">{{ cite web |last=Larabel |first=Michael |date= 22 August 2014 |title=Patch By Patch, LLVM Clang Gets Better At Building The Linux Kernel |url= https://www.phoronix.com/news/MTc3MDI |publisher=[[Phoronix]] |url-status= live |archive-url=https://web.archive.org/web/20200813143201/https://www.phoronix.com/scan.php?page=news_item&px=MTY2MjY |archive-date=13 August 2020 |access-date= 10 August 2025 |author-link=Michael Larabel }}</ref> The project dedicated to this effort is named ''LLVMLinux'' after the [[LLVM]] compiler infrastructure upon which Clang is built.<ref name="CMJPf">{{cite web |url=https://lwn.net/Articles/549203/ |title=LFCS: The LLVMLinux project |last=Edge |first=Jake |date=7 May 2013 |publisher=[[LWN.net]] |access-date=3 March 2015 |archive-date=10 August 2020 |archive-url=https://web.archive.org/web/20200810165632/https://lwn.net/Articles/549203/ |url-status=live}}</ref> LLVMLinux does not aim to fork either Linux or the LLVM, therefore it is a meta-project composed of patches that are eventually submitted to the upstream projects. By enabling Linux to be compiled by Clang, developers may benefit from shorter compilation times.<ref name="dl3QL">{{cite web |url=http://llvm.org/devmtg/2014-02/slides/moller-llvmlinux.pdf |title=LLVMLinux: The Linux Kernel with Dragon Wings |last=Möller |first=Jan-Simon |date=2 February 2014 |publisher=[[LLVM|LLVM Project]] |access-date=3 March 2015 |archive-date=3 August 2020 |archive-url=https://web.archive.org/web/20200803053328/http://llvm.org/devmtg/2014-02/slides/moller-llvmlinux.pdf |url-status=live}}</ref>
In 2017, developers completed upstreaming patches to support building the Linux kernel with [[Clang]] in the 4.15 release, having [[Backporting|backported]] support for [[X86-64]] and [[AArch64]] to the 4.4, 4.9, and 4.14 branches of the stable kernel tree. Google's [[Pixel 2]] shipped with the first [[Clang]] built [[Linux]] kernel,<ref name="9uQ4P">{{ cite web |last1= Desaulniers |first1= Nick |date= 18 October 2017 |title= 2017 LLVM Developers' Meeting: Compiling Android userspace and Linux kernel with LLVM |url= https://www.youtube.com/watch?v=6l4DtR5exwo&t=2130 |website= youtube.com |publisher= llvm.org |access-date= 10 August 2025 |url-status=live |archive-url=https://web.archive.org/web/20201231030548/https://www.youtube.com/watch?v=6l4DtR5exwo&t=2130 |archive-date=31 December 2020 |language= en |format= video |last2= Hackmann |first2= Greg |last3= Hines |first3= Stephen }}</ref> though patches for [[Pixel (1st generation)]] did exist.<ref name="6Qqwa">{{cite web |url=https://android-review.googlesource.com/q/topic:marlin-nougat-mr1-clang+(status:open+OR+status:closed) |access-date=6 December 2020 |last=Hackmann |first=Greg |title=marlin-nougat-mr1-clang Patch Series |date=2 February 2017 |archive-date=10 December 2020 |archive-url=https://web.archive.org/web/20201210125624/https://android-review.googlesource.com/q/topic:marlin-nougat-mr1-clang+(status:open+OR+status:closed) |url-status=live}}</ref> 2018 saw [[ChromeOS]] move to building kernels with [[Clang]] by default,<ref name="G7ATP">{{cite web |url=https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/1294370 |access-date=6 December 2020 |date=22 October 2018 |last=Kaehlcke |first=Matthias |title=cros-kernel2: Make clang the default compiler for kernel builds |archive-date=10 December 2020 |archive-url=https://web.archive.org/web/20201210015343/https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/1294370 |url-status=live}}</ref> while [[Android (operating system)|Android]] made [[Clang]]<ref name="Rc53w">{{cite web |url=https://www.phoronix.com/scan.php?page=news_item&px=Google-2019-Clang-Kernel |access-date=6 December 2020 |last=Larabel |first=Michael |author-link=Michael Larabel |publisher=[[Phoronix]] |title=Using LLVM Clang To Compile The Linux Kernel Is Heating Up Again Thanks To Google |date=4 February 2019 |archive-date=25 November 2020 |archive-url=https://web.archive.org/web/20201125201932/https://www.phoronix.com/scan.php?page=news_item&px=Google-2019-Clang-Kernel |url-status=live}}</ref> and [[LLVM]]'s linker LLD<ref name="VI8HH">{{cite web |url=https://android-review.googlesource.com/c/platform/test/vts-testcase/kernel/+/1185200 |access-date=6 December 2020 |title=vts: kernel: enforce vts_kernel_toolchain for all TARGET_ARCH for R |last=Desaulniers |first=Nick |date=10 December 2019 |archive-date=10 December 2020 |archive-url=https://web.archive.org/web/20201210125711/https://android-review.googlesource.com/c/platform/test/vts-testcase/kernel/+/1185200 |url-status=live}}</ref> required for kernel builds in 2019. [[Google]] moved its production kernel used throughout its datacenters to being built with [[Clang]] in 2020.<ref name="1XmKl">{{cite web |url=https://lore.kernel.org/lkml/CAKwvOdmKjsJGbR7hHACk3qUgguy-HWvJQerwTnArE0AwhPgfcQ@mail.gmail.com/ |access-date=6 December 2020 |last=Desaulniers |first=Nick |title=Re: violating function pointer signature |date=19 November 2020 |publisher=[[LKML]]}}</ref> The ''[https://clangbuiltlinux.github.io/ ClangBuiltLinux]'' group coordinates fixes to both [[Linux]] and [[LLVM]] to ensure compatibility, both composed of members from ''LLVMLinux'' and having upstreamed patches from ''LLVMLinux''.
=== Debugging ===
{{Main|KGDB|Kernel panic|Linux kernel oops}}
[[File:Kernel-panic.jpg|thumb|Linux kernel panic output]]
As with any software, problems with the Linux kernel can be difficult to [[troubleshoot]]. Common challenges relate to userspace vs. kernel space access, misuse of synchronization primitives, and incorrect hardware management.<ref name="LoveRobert2010" />{{Rp|page=364}}
An [[Linux kernel oops|oops]] is a non-fatal error in the kernel. After such an error, operations continue with suspect reliability.<ref name="z2qVY">{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/0303.1/0009.html |title=Re: what's an OOPS |last=Bradford |first=John |date=8 March 2003 |mailing-list=[[LKML]] |access-date=30 October 2010 |archive-date=31 October 2014 |archive-url=https://web.archive.org/web/20141031032356/http://lkml.iu.edu/hypermail/linux/kernel/0303.1/0009.html |url-status=live}}</ref>
A panic (generated by {{Mono|[[Kernel panic|panic()]]}}) is a fatal error. After such an error, the kernel prints a message and halts the computer.<ref name="LoveRobert2010" />{{Rp|page=371}}
The kernel provides for ''debugging by printing'' via {{Mono|[[printk]]()}} which stores messages in a circular buffer (overwriting older entries with newer). The {{Mono|syslog(2)}} system call provides for reading and clearing the message buffer and for setting the maximum ''log level'' of the messages to be sent to the console.<ref name="a2s1L">{{cite web|title=syslog(2) - Linux manual page|url=https://man7.org/linux/man-pages/man2/syslog.2.html|access-date=15 August 2020|website=man7.org|archive-date=13 October 2020|archive-url=https://web.archive.org/web/20201013152012/https://man7.org/linux/man-pages/man2/syslog.2.html|url-status=live}}</ref> Kernel messages are also exported to userland through the ''/dev/kmsg'' interface.<ref name="2qZWO">{{cite web|title=kmsg: export printk records to the /dev/kmsg interface [LWN.net]|url=https://lwn.net/Articles/493182/|access-date=16 August 2020|website=lwn.net|archive-date=2 October 2015|archive-url=https://web.archive.org/web/20151002050933/http://lwn.net/Articles/493182/|url-status=live}}</ref>
The ''[[ftrace]]'' mechanism allow for debugging by tracing. It is used for monitoring and debugging Linux at runtime and it can analyze user space latencies due to kernel misbehavior.<ref>{{Citation|title=See what your computer is doing with Ftrace utilities| date=24 January 2019 |url=https://www.youtube.com/watch?v=68osT1soAPM |archive-url=https://ghostarchive.org/varchive/youtube/20211215/68osT1soAPM |archive-date=15 December 2021 |url-status=live|language=en|access-date=9 May 2021}}{{cbignore}}</ref><ref name="Zi5c2">{{cite web|title=Debugging the kernel using Ftrace - part 1 [LWN.net]|url=https://lwn.net/Articles/365835/|access-date=15 September 2020|website=lwn.net|archive-date=9 November 2020|archive-url=https://web.archive.org/web/20201109001219/https://lwn.net/Articles/365835/|url-status=live}}</ref><ref name="l6A6o">{{cite web|title=Debugging the kernel using Ftrace - part 2 [LWN.net]|url=https://lwn.net/Articles/366796/|access-date=15 September 2020|website=lwn.net|archive-date=31 March 2020|archive-url=https://web.archive.org/web/20200331222229/https://lwn.net/Articles/366796/|url-status=live}}</ref><ref name="smtxG">{{cite web|title=ftrace - Function Tracer — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/trace/ftrace.html|access-date=15 September 2020|website=Kernel.org|archive-date=19 September 2020|archive-url=https://web.archive.org/web/20200919095357/https://www.kernel.org/doc/html/latest/trace/ftrace.html|url-status=live}}</ref> Furthermore, ''ftrace'' allows users to trace Linux at boot-time.<ref name="LM95V">{{cite web|title=Boot-time tracing — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/trace/boottime-trace.html|access-date=19 September 2020|website=Kernel.org|archive-date=31 October 2020|archive-url=https://web.archive.org/web/20201031200922/https://www.kernel.org/doc/html/latest/trace/boottime-trace.html|url-status=live}}</ref>
''kprobes'' and ''kretprobes'' can break into kernel execution (like debuggers in userspace) and collect information non-disruptively.<ref name="cvH1K">{{cite web|title=Kernel Probes (Kprobes) — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/trace/kprobes.html|access-date=6 October 2020|website=Kernel.org|archive-date=11 October 2020|archive-url=https://web.archive.org/web/20201011030448/https://www.kernel.org/doc/html/latest/trace/kprobes.html|url-status=live}}</ref> ''kprobes'' can be inserted into code at (almost) any address, while kretprobes work at function return. ''uprobes'' have similar purposes but they also have some differences in usage and implementation.<ref name="RQ9e7">{{cite web|title=Uprobe-tracer: Uprobe-based Event Tracing — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/trace/uprobetracer.html|access-date=6 October 2020|website=Kernel.org|archive-date=4 December 2020|archive-url=https://web.archive.org/web/20201204204113/https://www.kernel.org/doc/html/latest/trace/uprobetracer.html|url-status=live}}</ref>
With [[KGDB]] Linux can be debugged in much the same way as userspace programs. KGDB requires an additional machine that runs [[GNU Debugger#Remote debugging|GDB]] and that is connected to the target to be debugged using a [[serial cable]] or [[Ethernet]].<ref name="6e5gH">{{cite web|title=Using kgdb, kdb and the kernel debugger internals|url=https://mirrors.edge.kernel.org/pub/linux/kernel/people/jwessel/kdb/index.html|access-date=3 November 2020|website=mirrors.edge.kernel.org|archive-date=26 January 2021|archive-url=https://web.archive.org/web/20210126003430/https://mirrors.edge.kernel.org/pub/linux/kernel/people/jwessel/kdb/index.html|url-status=live}}</ref>
=== Change process ===
The Linux kernel project integrates new code on a rolling basis. Standard operating procedure is that software checked into the project must work and [[compiling|compile]] without error.
Each kernel subsystem is assigned a maintainer who is responsible for reviewing patches against the kernel code standards and keeping a queue of patches that can be submitted to Torvalds within a merge window that is usually several weeks.
Patches are merged by Torvalds into the source code of the prior stable Linux kernel release, creating the release candidate (-rc) for the next stable release. Once the merge window is closed, only fixes to the new code in the development release are accepted. The -rc development release of the kernel goes through [[regression tests|regression testing]] and once it is considered stable by Torvalds and the subsystem maintainers, a new version is released and the development process starts over again.<ref name="0v6Bk">{{cite book |title=Pro Linux Embedded Systems |author= Gene Sally|year=2010 |publisher=Apress |isbn=9781430272267 |page=252}}</ref>
=== Mainline Linux ===
{{Anchor|MAINLINE}}
The Git tree that contains the Linux kernel source code is referred to as '''mainline Linux'''. Every stable kernel release originates from the mainline tree,<ref>{{Cite book|last=Billimoria|first=Kaiwan N.|title=Linux Kernel Programming A Comprehensive Guide to Kernel Internals, Writing Kernel Modules, and Kernel Synchronization.|date=2021|publisher=Packt Publishing, Limited|isbn=978-1-78995-592-7|___location=Birmingham|page=55|oclc=1240585605}}</ref> and is frequently published on [[kernel.org]]. Mainline Linux has only solid support for a small subset of the many devices that run Linux. Non-mainline support is provided by independent projects, such as [[Yocto Project|Yocto]] or [[Linaro]], but in many cases the kernel from the device vendor is needed.<ref>{{Cite book|last1=Vaduva|first1=Alexandru|last2=Gonzalez|first2=Alex|last3=Simmonds|first3=Chris |title=Linux : embedded development : leverage the power of Linux to develop captivating and powerful embedded Linux projects : a course in three modules|date=2016|publisher=[[Packt Publishing]]|isbn=978-1-78712-445-5|___location=Birmingham, UK|page=663|oclc=960471438}}</ref> Using a vendor kernel likely requires a [[board support package]].
Maintaining a kernel tree outside of mainline Linux has proven to be difficult.<ref>{{Cite book|title=Building embedded Linux systems|date=2008|publisher=O'Reilly Media|author=Karim Yaghmour|isbn=978-0-596-52968-0|edition=2nd|___location=Sebastopol [Calif.]|page=387|oclc=273049576}}</ref>
''Mainlining'' refers to the effort of adding support for a device to the mainline kernel,<ref>{{Cite book|last=Yaghmour|first=Karim|title=Embedded Android|date=2011|publisher=O'Reilly Media|isbn=978-1-4493-2798-9|___location=Sebastopol, CA|page=44|oclc=812180000}}</ref> while there was formerly only support in a fork or no support at all. This usually includes adding drivers or [[device tree]] files. When this is finished, the feature or security fix is considered ''mainlined''.<ref>{{cite web |date=6 November 2014 |title=SoC (System on a Chip) |url=https://openwrt.org/docs/techref/hardware/soc |url-status=live |archive-url=https://web.archive.org/web/20220823021323/https://openwrt.org/docs/techref/hardware/soc |archive-date=23 August 2022 |access-date=15 March 2021 |website=[[OpenWrt]] Wiki |language=en}}</ref>
=== Linux-like kernel ===
The maintainer of the stable branch, [[Greg Kroah-Hartman]], has applied the term ''Linux-like'' to [[Downstream (software development)|downstream]] kernel forks by vendors that add millions of lines of code to the mainline kernel.<ref>{{cite web|title=What to do about CVE numbers [LWN.net]|url=https://lwn.net/Articles/801157/|access-date=15 March 2021|website=lwn.net}}</ref> In 2019, [[Google]] stated that it wanted to use the mainline Linux kernel in [[Android (operating system)|Android]] so the number of kernel forks would be reduced.<ref>{{cite web|last=Amadeo|first=Ron|date=20 November 2019|title=Google outlines plans for mainline Linux kernel support in Android|url=https://arstechnica.com/gadgets/2019/11/google-outlines-plans-for-mainline-linux-kernel-support-in-android/|access-date=31 March 2021|website=Ars Technica|language=en-us}}</ref> The term Linux-like has also been applied to the [[Embeddable Linux Kernel Subset]], which does not include the full mainline Linux kernel but a small modified subset of the code.<ref>{{Citation|last=Bruchon|first=Jody|title=jbruchon/elks|date=24 April 2021|url=https://github.com/jbruchon/elks|access-date=27 April 2021}}</ref>
=== Linux forks ===
[[File:Ipod linux booting kernel.jpg|thumb|An [[iPod]] booting [[iPodLinux]] ]]
There are certain communities that develop kernels based on the official Linux. Some interesting bits of code from these [[Fork (software development)|forks]] that include [[Linux-libre]], [[Compute Node Linux]], [[INK (operating system)|INK]], [[L4Linux]], [[RTLinux]], and [[user-mode Linux|User-Mode Linux]] (UML) have been merged into the mainline.<ref name="jhbmr">{{cite web| url = https://linuxplumbersconf.org/ocw/proposals/49| title = The state of preempt-rt| access-date = 14 June 2016| website = linuxplumbersconf.org| archive-url = https://web.archive.org/web/20161015044835/https://linuxplumbersconf.org/ocw/proposals/49| archive-date = 15 October 2016| url-status = dead| df = dmy-all}}</ref> Some operating systems developed for mobile phones initially used heavily modified versions of Linux, including Google [[Android (operating system)|Android]], [[Firefox OS]], HP [[webOS]], Nokia [[Maemo]] and Jolla [[Sailfish OS]]. In 2010, the Linux community criticised Google for effectively starting its own kernel tree:<ref name="CFIB9">{{cite web |url=https://www.zdnet.com/article/linux-developer-explains-android-kernel-code-removal/ |title=Linux developer explains Android kernel code removal |last=Meyer |first=David |date=3 February 2010 |work=[[ZDNet]] |publisher=[[CBS Interactive]] |access-date=3 February 2010 |archive-date=15 October 2016 |archive-url=https://web.archive.org/web/20161015045139/http://www.zdnet.com/article/linux-developer-explains-android-kernel-code-removal/ |url-status=live}}</ref><ref name="s6out">{{cite book|date=2008 |title=maemo Technology Overview |chapter-url=http://maemo.org/maemo_training_material/maemo4.x/html/maemo_Technology_Overview/Chapter_03_maemo_Platform_Overview.html |publisher=[[Nokia]] |chapter=Chapter 03: maemo Platform Overview |access-date=9 April 2010 |archive-url=https://web.archive.org/web/20080616191310/http://maemo.org/maemo_training_material/maemo4.x/html/maemo_Technology_Overview/Chapter_03_maemo_Platform_Overview.html |archive-date=16 June 2008 |url-status=dead}}</ref>
{{Blockquote|text=This means that any drivers written for Android hardware platforms, can not get merged into the main kernel tree because they have dependencies on code that only lives in Google's kernel tree, causing it to fail to build in the kernel.org tree. Because of this, Google has now prevented a large chunk of hardware drivers and platform code from ever getting merged into the main kernel tree. Effectively creating a kernel branch that a number of different vendors are now relying on.<ref name="psD9l">{{cite web |url=http://www.kroah.com/log/linux/android-kernel-problems.html |title=Android and the Linux kernel community |last=Kroah-Hartman |first=Greg |date=2 February 2010 |access-date=3 February 2010 |archive-date=27 April 2019 |archive-url=https://web.archive.org/web/20190427144039/http://www.kroah.com/log/linux/android-kernel-problems.html |url-status=live}}</ref> |sign=[[Greg Kroah-Hartman]], 2010}}
Today Android uses a customized Linux<ref name="Roger Ye 2017 14">{{cite book |title=Android System Programming |author=Roger Ye|year=2017 |publisher=Packt Publishing |isbn=9781787120389 |page=14}}</ref> where major changes are implemented in device drivers, but some changes to the core kernel code is required. Android developers also submit patches to the official Linux that finally can boot the Android operating system. For example, a [[Nexus 7]] can boot and run the mainline Linux.<ref name="Roger Ye 2017 14" />
At a 2001 presentation at the [[Computer History Museum]], Torvalds had this to say in response to a question about distributions of Linux using precisely the same kernel sources or not:
{{Blockquote |text=They're not... well they are, and they're not. There is no single kernel. Every single distribution has their own changes. That's been going on since pretty much day one. I don't know if you may remember [[Yggdrasil Linux/GNU/X|Yggdrasil]] was known for having quite extreme changes to the kernel and even today all of the major vendors have their own tweaks because they have some portion of the market they're interested in and quite frankly that's how it should be. Because if everybody expects one person, me, to be able to track everything that's not the point of GPL. That's not the point of having an open system. So actually the fact that a distribution decides that something is so important to them that they will add patches for even when it's not in the standard kernel, that's a really good sign for me. So that's for example how something like [[ReiserFS]] got added. And the reason why ReiserFS is the first journaling filesystem that was integrated in the standard kernel was not because I love [[Hans Reiser]]. It was because [[SUSE Linux Enterprise|SUSE]] actually started shipping with ReiserFS as their standard kernel, which told me "ok." This is actually in production use. Normal People are doing this. They must know something I don't know. So in a very real sense what a lot of distribution houses do, they are part of this "let's make our own branch" and "let's make our changes to this." And because of the GPL, I can take the best portions of them.<ref name="rFl9d">{{cite web |url=https://www.youtube.com/watch?v=WVTWCPoUt8w&t=3435 |archive-url=https://ghostarchive.org/varchive/youtube/20211215/WVTWCPoUt8w |archive-date=2021-12-15 |url-status=live|publisher=[[YouTube]] |date=19 September 2001 |last=Torvalds |first=Linus |access-date=6 December 2020 |title=The Origins of Linux—Linus Torvalds}}{{cbignore}}</ref> |sign=[[Linus Torvalds]], 2001}}
=== Long-term support ===
[[File:Linux-x86-under-qemu.png|thumb|upright=1.3|Boot messages of a Linux kernel 2.6.25.17]]
The latest version and older versions are maintained separately. Most of the latest kernel releases were supervised by Torvalds.<ref name="MAINTAINERS">{{cite web |url=https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=MAINTAINERS |archive-url=https://archive.today/20130112231112/http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=MAINTAINERS |url-status=dead |archive-date=12 January 2013 |title=Linux MAINTAINERS file}}</ref>
The Linux kernel developer community maintains a stable kernel by applying fixes for [[software bug]]s that have been discovered during the development of the subsequent stable kernel. Therefore, www.kernel.org always lists two stable kernels. The next stable Linux kernel is released about 8 to 12 weeks later.
Some releases are [[Linux kernel version history|designated]] for [[long-term support]] as ''longterm'' with bug fix releases for two or more years.<ref name="A6uRz">{{cite book |title=Linux: Embedded Development |author= Alexandru Vaduva, Alex Gonzalez & Chris Simmonds|year=2016 |publisher=Packt Publishing|isbn=9781787124455 |page=663}}</ref>
=== Size ===
Some projects have attempted to reduce the size of the Linux kernel. One of them is [[TinyLinux]]. In 2014, Josh Triplett started the -tiny source tree for a reduced size version.<ref>{{Cite web |title=Linux for little systems [LWN.net] |url=https://lwn.net/Articles/63516/ |access-date=2024-11-22 |website=lwn.net}}</ref><ref>{{Cite web |title=Kernel tinification [LWN.net] |url=https://lwn.net/Articles/608945/ |access-date=2024-11-22 |website=lwn.net}}</ref><ref>{{Cite web |last=Brown |first=Eric |date=2017-04-13 |title=Shrinking the Linux Kernel and File System for IoT |url=https://www.linux.com/news/shrinking-linux-kernel-and-file-system-iot/ |access-date=2024-11-22 |website=Linux.com |language=en-US}}</ref><ref>{{Cite book |last1=Shizukuishi |first1=Takuya |last2=Matsubara |first2=Katsuya |chapter=An efficient tinification of the linux kernel for minimizing resource consumption |date=2020-03-30 |title=Proceedings of the 35th Annual ACM Symposium on Applied Computing |chapter-url=https://dl.acm.org/doi/10.1145/3341105.3373913 |language=en |publisher= |pages=1228–1237 |doi=10.1145/3341105.3373913 |isbn=978-1-4503-6866-7}}</ref>
== Architecture and features ==
{{See also|vmlinux}}
[[File:Linux kernel map.png|thumb|upright=1.3|Map of the Linux kernel]]
[[File:Sankey Diagram of Linux Kernel Source Lines of Code.jpg|thumb|[[Sankey diagram]] of Linux Kernel Source Lines of Code]]
Even though seemingly contradictory, the Linux kernel is both monolithic and modular. The kernel is classified as a [[monolithic kernel]] architecturally since the entire OS runs in kernel space. The design is modular since it can be assembled from [[loadable kernel module|modules]] that in some cases are loaded and unloaded at runtime.<ref name="LoveRobert2010" />{{rp|page=338}}<ref name="hS5tR">{{cite web|title=README|url=https://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=README;h=90a07658ede14840346eee6610648bcf4ec79997;hb=f3b8436ad9a8ad36b3c9fa1fe030c7f38e5d3d0b|url-status=dead|archive-url=https://archive.today/20120724163945/http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=README;h=90a07658ede14840346eee6610648bcf4ec79997;hb=f3b8436ad9a8ad36b3c9fa1fe030c7f38e5d3d0b|archive-date=24 July 2012|access-date=24 March 2021|publisher=git.kernel.org}}</ref> It supports features once only available in closed source kernels of non-free operating systems.
The rest of the article makes use of the UNIX and Unix-like operating systems convention of the [[Man page|manual pages]]. The number that follows the name of a command, interface, or other feature specifies the section (i.e. the type of the OS' component or feature) it belongs to. For example {{mono|execve(2)}} refers to a system call, and {{mono|exec(3)}} refers to a userspace library wrapper.
The following is an overview of architectural design and of noteworthy features.
* [[Concurrent computing]] and (with the availability of enough CPU cores for tasks that are ready to run) even [[Parallel computing|true parallel execution]] of many [[Process (computing)|processes]] at once (each of them having one or more [[Thread (computing)|threads of execution]]) on [[Symmetric multiprocessing|SMP]] and [[Non-uniform memory access|NUMA]] architectures.
* Selection and configuration of hundreds of kernel features and drivers (using one of the {{Mono|make *config}} family of commands before building),<ref name=":12">{{cite web|title=KernelBuild - Linux Kernel Newbies|url=https://kernelnewbies.org/KernelBuild|access-date=13 September 2020|website=kernelnewbies.org|archive-date=19 October 2020|archive-url=https://web.archive.org/web/20201019124650/https://kernelnewbies.org/KernelBuild|url-status=live}}</ref><ref name=":11" /><ref name=":10" /> modification of kernel parameters before [[Linux boot|boot]] (usually by inserting instructions into the lines of the [[Grub2|GRUB2]] menu), and fine tuning of kernel behavior at run-time (using the {{mono|sysctl(8)}} interface to {{Mono|/proc/sys/}}).<ref name=":13">{{cite web|title=The Sysctl Interface|url=https://www.linux.it/~rubini/docs/sysctl/sysctl.html|access-date=13 September 2020|website=Linux.it|archive-date=17 February 2020|archive-url=https://web.archive.org/web/20200217004812/http://www.linux.it/~rubini/docs/sysctl/sysctl.html|url-status=live}}</ref><ref name=":14">{{cite web|title=sysctl(8) - Linux manual page|url=https://man7.org/linux/man-pages/man8/sysctl.8.html|access-date=13 September 2020|website=man7.org|archive-date=30 September 2020|archive-url=https://web.archive.org/web/20200930200903/https://man7.org/linux/man-pages/man8/sysctl.8.html|url-status=live}}</ref><ref name=":15">{{cite web|title=procfs(5) - Linux manual page|url=https://man7.org/linux/man-pages/man5/procfs.5.html|access-date=13 September 2020|website=man7.org|archive-date=24 September 2020|archive-url=https://web.archive.org/web/20200924010905/https://man7.org/linux/man-pages/man5/procfs.5.html|url-status=live}}</ref>
* Configuration (again using the {{Mono|make *config}} commands) and run-time modifications of the policies<ref name="erfu2">{{cite web|title=sched(7) - Linux manual page|url=https://man7.org/linux/man-pages/man7/sched.7.html|access-date=27 July 2020|website=man7.org|archive-date=17 July 2020|archive-url=https://web.archive.org/web/20200717155549/https://man7.org/linux/man-pages/man7/sched.7.html|url-status=live}}</ref> (via {{Mono|nice(2)}}, {{Mono|setpriority(2)}}, and the family of {{Mono|sched_*(2)}} syscalls) of the [[Scheduling (computing)|task schedulers]] that allow [[preemptive multitasking]] (both in [[user mode]] and, since the 2.6 series, in [[kernel mode]]<ref name="TaqW6">{{cite web | url = https://kernelnewbies.org/FAQ/Preemption | title = FAQ: Preemption | date = 22 August 2009 | access-date = 7 May 2015 | website = kernelnewbies.org | archive-date = 7 August 2020 | archive-url = https://web.archive.org/web/20200807081640/https://kernelnewbies.org/FAQ/Preemption | url-status = live}}</ref><ref name="lwn-22912">{{cite web | url = https://lwn.net/Articles/22912/ | title = Driver porting: the preemptible kernel | date = 24 February 2003 | access-date = 7 May 2015 | author = Jonathan Corbet | publisher = [[LWN.net]] | archive-date = 10 August 2020 | archive-url = https://web.archive.org/web/20200810170137/https://lwn.net/Articles/22912/ | url-status = live}}</ref>); the [[earliest eligible virtual deadline first scheduling]] (EEVDF) scheduler,<ref name="auto1">{{Cite web|url=https://www.phoronix.com/news/Linux-6.6-EEVDF-Merged|title=EEVDF Scheduler Merged For Linux 6.6, Intel Hybrid Cluster Scheduling Re-Introduced|website=[[Phoronix]]}}</ref> is the default scheduler of Linux since 2023 and it uses a [[Red–black tree|red-black tree]] which can search, insert and delete process information ([[task struct]]) with [[Big O notation|O(log n)]] [[time complexity]], where ''n'' is the number of runnable tasks.<ref name=":5" /><ref name="URgZz">{{cite web|url=https://www.linuxjournal.com/node/10267|title=Completely Fair Scheduler {{!}} Linux Journal|website=Linuxjournal.com|access-date=30 March 2020|archive-date=3 August 2020|archive-url=https://web.archive.org/web/20200803104512/https://www.linuxjournal.com/node/10267|url-status=live}}</ref>
* Advanced [[memory management]] with [[virtual memory|paged virtual memory]].
* [[Inter-process communication]]s and [[Synchronization (computer science)|synchronization]] mechanism.
* A [[Virtual file system|virtual filesystem]] on top of several concrete filesystems ([[ext4]], [[Btrfs]], [[XFS]], [[JFS (file system)|JFS]], [[File Allocation Table|FAT32]], and many more).
* Configurable I/O schedulers, {{Mono|ioctl(2)}}<ref name="9FO10">{{cite web|title=ioctl(2) - Linux manual page|url=https://man7.org/linux/man-pages/man2/ioctl.2.html|access-date=11 August 2020|website=man7.org|archive-date=20 July 2020|archive-url=https://web.archive.org/web/20200720073257/https://man7.org/linux/man-pages/man2/ioctl.2.html|url-status=live}}</ref> syscall that manipulates the underlying device parameters of special files (it is a non standard system call, since arguments, returns, and semantics depends on the device driver in question), support for POSIX asynchronous I/O<ref name="qp47b">{{cite web|title=aio(7) - Linux manual page|url=https://man7.org/linux/man-pages/man7/aio.7.html|access-date=11 August 2020|website=man7.org|archive-date=12 April 2020|archive-url=https://web.archive.org/web/20200412005208/http://man7.org/linux/man-pages/man7/aio.7.html|url-status=live}}</ref> (however, because they scale poorly with multithreaded applications, a family of Linux specific I/O system calls ({{Mono|io_*(2)}}<ref name="Y4P9J">{{cite web|title=io_setup(2) - Linux manual page|url=https://man7.org/linux/man-pages/man2/io_setup.2.html|access-date=11 August 2020|website=man7.org|archive-date=20 August 2020|archive-url=https://web.archive.org/web/20200820190947/https://man7.org/linux/man-pages/man2/io_setup.2.html|url-status=live}}</ref>) had to be created for the management of asynchronous I/O contexts suitable for concurrent processing).
* [[OS-level virtualization]] (with [[Linux-VServer]]), [[paravirtualization]] and [[hardware-assisted virtualization]] (with [[Kernel-based Virtual Machine|KVM]] or [[Xen]], and using [[QEMU]] for hardware emulation);<ref name="bn0PK">{{cite web|url=https://www.linux-kvm.org/page/Main_Page|title=KVM|website=Linux-kvm.org|access-date=29 March 2020|archive-date=28 March 2020|archive-url=https://web.archive.org/web/20200328192644/https://www.linux-kvm.org/page/Main_Page|url-status=live}}</ref><ref name="XJFnS">{{cite web|url=https://virt.kernelnewbies.org/TechComparison|title=TechComparison - Linux Virtualization Wiki|website=Virt.kernelnewbies.org|access-date=29 March 2020|archive-date=3 August 2020|archive-url=https://web.archive.org/web/20200803081859/https://virt.kernelnewbies.org/TechComparison|url-status=live}}</ref><ref name="XTTHB">{{cite web|url=https://kernelnewbies.org/Linux_2_6_20#Virtualization_support_through_KVM|title=Virtualization_support_through_KVM in Linux_2_6_20 - Linux Kernel Newbies|website=Kernelnewbies.org|access-date=29 March 2020|archive-date=29 November 2019|archive-url=https://web.archive.org/web/20191129072053/https://kernelnewbies.org/Linux_2_6_20#Virtualization_support_through_KVM|url-status=live}}</ref><ref name="nE2IA">{{cite web|url=https://blogs.oracle.com/wim/linux-mainline-contains-all-the-xen-code-bits-for-dom0-and-domu-support|title=Linux mainline contains all the Xen code bits for Dom0 and DomU support|last=Coekaerts|first=Wim|website=blogs.oracle.com|access-date=29 March 2020|archive-date=3 August 2020|archive-url=https://web.archive.org/web/20200803103832/https://blogs.oracle.com/wim/linux-mainline-contains-all-the-xen-code-bits-for-dom0-and-domu-support|url-status=live}}</ref><ref name="RUx2A">{{cite web|url=http://blog.xen.org/index.php/2011/06/02/xen-celebrates-full-dom0-and-domu-support-in-linux-3-0/|archive-url=https://web.archive.org/web/20110607003740/http://blog.xen.org/index.php/2011/06/02/xen-celebrates-full-dom0-and-domu-support-in-linux-3-0/|url-status=dead|archive-date=7 June 2011|title=Xen celebrates full Dom0 and DomU support in Linux 3.0 – blog.xen.org|date=7 June 2011|access-date=29 March 2020}}</ref><ref name="sPn6b">{{cite web|url=https://xenproject.org/2014/01/31/linux-3-14-and-pvh/|title=Linux 3.14 and PVH|last=Wilk|first=Konrad Rzeszutek|date=31 January 2014|website=Xen Project|language=en-US|access-date=29 March 2020|archive-date=29 March 2020|archive-url=https://web.archive.org/web/20200329115320/https://xenproject.org/2014/01/31/linux-3-14-and-pvh/|url-status=live}}</ref> On the Xen [[hypervisor]], the Linux kernel provides support to build Linux distributions (such as openSUSE Leap and many others) that work as ''Dom0'', that are virtual machine host servers that provide the management environment for the user's virtual machines (''DomU'').<ref name="W3Q0w">{{cite web|title=Introduction to Xen Virtualization {{!}} Virtualization Guide {{!}} openSUSE Leap 15.2|url=https://doc.opensuse.org/documentation/leap/virtualization/html/book.virt/cha-xen-basics.html|access-date=29 September 2020|website=doc.opensuse.org|archive-date=28 September 2020|archive-url=https://web.archive.org/web/20200928214033/https://doc.opensuse.org/documentation/leap/virtualization/html/book.virt/cha-xen-basics.html|url-status=live}}</ref>
* I/O Virtualization with [[VFIO]] and [[SR-IOV]]. Virtual Function I/O (VFIO) exposes direct device access to user space in a secure memory (IOMMU) protected environment. With VFIO, a VM Guest can directly access hardware devices on the VM Host Server. This technique improves performance, if compared both to Full virtualization and Paravirtualization. However, with VFIO, devices cannot be shared with multiple VM guests. Single Root I/O Virtualization (SR-IOV) combines the performance gains of VFIO and the ability to share a device with several VM Guests (but it requires special hardware that must be capable to appear to two or more VM guests as different devices).<ref>{{cite web|title=Virtualization technology {{!}} Virtualization Guide {{!}} openSUSE Leap 15.3|url=https://doc.opensuse.org/documentation/leap/virtualization/html/book-virtualization/chap-virtualization-introduction.html#sec-vt-io|access-date=30 September 2021|website=doc.opensuse.org}}</ref>
* Security mechanisms for [[Discretionary access control|discretionary]] and [[mandatory access control]] (SELinux, AppArmor, POSIX [[Access-control list|ACLs]], and others).<ref name=":3" /><ref name=":4" />
* Several types of layered [[communication protocol]]s (including the [[Internet protocol suite]]).
* [[Asymmetric multiprocessing]] via the [[RPMsg]] subsystem.
Most [[device driver]]s and kernel extensions run in [[kernel space]] ([[Ring (computer security)|ring 0]] in many [[CPU]] [[CPU architecture|architectures]]), with full access to the hardware. Some exceptions run in [[user space]]; notable examples are filesystems based on [[Filesystem in Userspace|FUSE]]/CUSE, and parts of UIO.<ref name="26Lbl">{{cite web | url = https://lwn.net/Articles/308445/ | title = Character devices in user space | date = 25 November 2008 | access-date = 7 May 2015 | author = Jake Edge | publisher = [[LWN.net]] | archive-date = 26 January 2021 | archive-url = https://web.archive.org/web/20210126131908/https://lwn.net/Articles/308445/ | url-status = live}}</ref><ref name="glzLY">{{cite web | url = https://lwn.net/Articles/232575/ | title = UIO: user-space drivers | date = 2 May 2007 | access-date = 7 May 2015 | author = Jonathan Corbet | publisher = [[LWN.net]] | archive-date = 11 November 2020 | archive-url = https://web.archive.org/web/20201111193009/https://lwn.net/Articles/232575/ | url-status = live}}</ref> Furthermore, the [[X Window System]] and [[Wayland (display server protocol)|Wayland]], the windowing system and display server protocols that most people use with Linux, do not run within the kernel. Differently, the actual interfacing with [[Graphics processing unit|GPUs]] of [[graphics card]]s is an in-kernel subsystem called [[Direct Rendering Manager]] (DRM).
Unlike standard monolithic kernels, device drivers are easily configured as [[module (Linux)|modules]], and loaded or unloaded while the system is running and can also be pre-empted under certain conditions in order to handle [[hardware interrupt]]s correctly and to better support [[symmetric multiprocessing]].<ref name="lwn-22912" /> By choice, Linux has no stable device driver [[application binary interface]].<ref name="stable-api-nonsense2">{{cite web|title=stable-api-nonsense - Linux kernel source tree|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-api-nonsense.rst|access-date=18 April 2020|website=git.kernel.org|archive-date=5 March 2021|archive-url=https://web.archive.org/web/20210305010734/https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-api-nonsense.rst|url-status=live}}</ref>
Linux typically makes use of [[memory protection]] and [[virtual memory]] and can also handle [[non-uniform memory access]],<ref name="qKe5b">{{cite book |last=Gorman |first=Mel |date=15 February 2004 |title=Understanding the Linux Virtual Memory Manager |url=https://pdos.csail.mit.edu/~sbw/links/gorman_book.pdf |publisher=Prentice Hall |page=26 |isbn=0-13-145348-3 |access-date=27 January 2020 |archive-date=3 May 2019 |archive-url=https://web.archive.org/web/20190503113248/https://pdos.csail.mit.edu/~sbw/links/gorman_book.pdf |url-status=live}}</ref> however the project has absorbed [[μClinux]] which also makes it possible to run Linux on [[microcontroller]]s without virtual memory.<ref name="xWtQ7">{{cite web|url=https://www.ucdot.org/article.pl?sid=02/11/05/0324207|title=uClinux mainline Announcement|access-date=15 January 2008|author=Greg Ungerer|archive-url=https://web.archive.org/web/20071031135123/http://www.ucdot.org/article.pl?sid=02%2F11%2F05%2F0324207|archive-date=31 October 2007|url-status=dead}}</ref>
The hardware is represented in the file hierarchy. User applications interact with device drivers via entries in the {{Mono|[[Devfs|/dev]]}} or {{Mono|[[/sys]]}} directories.<ref name="tldp file">{{cite web |url=https://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/index.html |title=Linux Filesystem Hierarchy: Chapter 1. Linux Filesystem Hierarchy |last=Nguyen |first=Binh |date=30 July 2004 |publisher=The Linux Documentation Project |access-date=28 November 2012 |archive-date=2 December 2020 |archive-url=https://web.archive.org/web/20201202064950/https://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/index.html |url-status=live}}</ref> Process information is mapped into the {{Mono|[[procfs|/proc]]}} directory.<ref name="tldp file" />
{{Linux layers}}
=== Interfaces ===
{{Main|Linux kernel interfaces|:Category:Interfaces of the Linux kernel|l2=Interfaces of the Linux kernel (Category)}}
{{See also|System call|POSIX|Single UNIX Specification}}
[[File:Linux kernel interfaces.svg|thumb|upright=1.3|Four interfaces are distinguished: two internal to the kernel, and two between the kernel and userspace.]]
Linux started as a clone of UNIX, and aims toward [[POSIX]] and [[Single UNIX Specification]] compliance.<ref name="tXF6O">{{cite web|url=https://www.kernel.org/doc/html/latest/admin-guide/README.html|title=Linux kernel release 5.x — The Linux Kernel documentation|website=Kernel.org|access-date=4 January 2020|archive-date=7 March 2020|archive-url=https://web.archive.org/web/20200307065108/https://www.kernel.org/doc/html/latest/admin-guide/README.html|url-status=live}}</ref> The kernel provides system calls and other interfaces that are Linux-specific. In order to be included in the official kernel, the code must comply with a set of licensing rules.<ref name="COPYING_File">{{cite web|title=COPYING|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/COPYING|url-status=live|archive-url=https://web.archive.org/web/20210902152553/https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/COPYING|archive-date=2 September 2021|access-date=2 September 2021|website=git.kernel.org}}</ref><ref name="Linux_Licensing" />
The Linux [[application binary interface]] (ABI) between the kernel and the user space has four degrees of stability (stable, testing, obsolete, removed);<ref name="4Rtud">{{cite web|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/README|title=README\ABI\Documentation - kernel/git/torvalds/linux.git - Linux kernel source tree|website=git.kernel.org|access-date=18 April 2020|archive-date=1 October 2020|archive-url=https://web.archive.org/web/20201001172809/https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/README|url-status=live}}</ref> The [[system call]]s are expected to never change in order to preserve [[Backward compatibility|compatibility]] for [[userspace]] programs that rely on them.<ref name="BNYzD">{{cite web|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/stable/syscalls|title=syscalls\stable\ABI\Documentation - kernel/git/torvalds/linux.git - Linux kernel source tree|website=git.kernel.org|access-date=18 April 2020|archive-date=2 October 2020|archive-url=https://web.archive.org/web/20201002061451/https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/stable/syscalls|url-status=live}}</ref>
[[Loadable kernel module]]s (LKMs), by design, cannot rely on a stable ABI.<ref name="stable-api-nonsense2" /> Therefore, they must always be recompiled whenever a new kernel executable is installed in a system, otherwise they will not be loaded. In-tree drivers that are configured to become an integral part of the kernel executable ([[vmlinux]]) are statically linked by the build process.
There is no guarantee of stability of source-level in-kernel API<ref name="stable-api-nonsense2" /> and, because of this, [[device driver]] code, as well as the code of any other kernel subsystem, must be kept updated with kernel evolution. Any developer who makes an API change is required to fix any code that breaks as the result of their change.<ref name=":9">{{cite web|title=1.Intro.rst - Documentation/process/1.Intro.rst - Linux source code (v5.8) - Bootlin|url=https://elixir.bootlin.com/linux/latest/source/Documentation/process/1.Intro.rst|access-date=8 August 2020|website=elixir.bootlin.com}}</ref>
==== Kernel-to-userspace API ====
The set of the [[Linux kernel API]] that regards the interfaces exposed to user applications is fundamentally composed of UNIX and Linux-specific [[system call]]s.<ref name=":1">{{cite web|title=syscalls|url=http://man7.org/linux/man-pages/man2/syscalls.2.html|website=man7|access-date=28 January 2020|archive-date=15 January 2020|archive-url=https://web.archive.org/web/20200115033131/http://man7.org/linux/man-pages/man2/syscalls.2.html|url-status=live}}</ref> A system call is an entry point into the Linux kernel.<ref name="IeXpN">{{cite web|title=intro(2) - Linux manual page|url=https://man7.org/linux/man-pages/man2/intro.2.html|access-date=16 July 2020|website=man7.org|archive-date=17 July 2020|archive-url=https://web.archive.org/web/20200717161934/https://man7.org/linux/man-pages/man2/intro.2.html|url-status=live}}</ref> For example, among the Linux-specific ones there is the family of the {{Mono|[[clone (Linux system call)|clone(2)]]}} system calls.<ref name="IHsye">{{cite web|url=http://man7.org/linux/man-pages/man2/clone.2.html|title=clone|website=man7.org|access-date=28 January 2020|archive-date=18 January 2020|archive-url=https://web.archive.org/web/20200118015900/http://man7.org/linux/man-pages/man2/clone.2.html|url-status=live}}</ref> Most extensions must be enabled by defining the <code>_GNU_SOURCE</code> [[Macro (computer science)|macro]] in a [[Header files|header file]] or when the user-land code is being compiled.<ref name="si1va">{{cite web|url=http://man7.org/linux/man-pages/man7/feature_test_macros.7.html|title=feature_test_macros|website=man7.org|access-date=28 January 2020|archive-date=19 January 2020|archive-url=https://web.archive.org/web/20200119174511/http://man7.org/linux/man-pages/man7/feature_test_macros.7.html|url-status=live}}</ref>
System calls can only be invoked via assembly instructions that enable the transition from unprivileged user space to privileged kernel space in [[ring 0 (computer security)|ring 0]]. For this reason, the [[C standard library]] (libC) acts as a wrapper to most Linux system calls, by exposing C functions that, if needed,<ref name="c0kGr">{{cite web|url=http://man7.org/linux/man-pages/man7/vdso.7.html|title=vdso(7) - Linux manual page|website=man7.org|access-date=2 February 2020|archive-date=2 February 2020|archive-url=https://web.archive.org/web/20200202123949/http://man7.org/linux/man-pages/man7/vdso.7.html|url-status=live}}</ref> transparently enter the kernel which will execute on behalf of the calling process.<ref name=":1" /> For system calls not exposed by libC, such as the [[Futex|fast userspace mutex]],<ref name=":0">{{cite web|url=http://man7.org/linux/man-pages/man2/futex.2.html|title=futex(2) - Linux manual page|website=man7.org|access-date=2 February 2020|archive-date=31 January 2020|archive-url=https://web.archive.org/web/20200131144454/http://man7.org/linux/man-pages/man2/futex.2.html|url-status=live}}</ref> the library provides a function called {{Mono|syscall(2)}} which can be used to explicitly invoke them.<ref name="Of0EM">{{cite web|url=http://man7.org/linux/man-pages/man2/syscall.2.html|title=syscall(2) - Linux manual page|website=man7.org|access-date=2 February 2020|archive-date=21 January 2020|archive-url=https://web.archive.org/web/20200121174524/http://man7.org/linux/man-pages/man2/syscall.2.html|url-status=live}}</ref>
[[Synthetic file system|Pseudo filesystems]] (e.g., the [[sysfs]] and [[procfs]] filesystems) and [[special file]]s (e.g., <code>/dev/random</code>, <code>/dev/sda</code>, <code>/dev/tty</code>, and many others) constitute another layer of interface to kernel data structures representing hardware or logical (software) devices.<ref name="Xk0xu">{{cite web|url=http://man7.org/linux/man-pages/man5/sysfs.5.html|title=sysfs(5) - Linux manual page|website=man7.org|access-date=6 January 2020|archive-date=18 January 2020|archive-url=https://web.archive.org/web/20200118044323/http://man7.org/linux/man-pages/man5/sysfs.5.html|url-status=live}}</ref><ref name="ZQvvs">{{cite web|url=https://www.kernel.org/doc/html/latest/admin-guide/sysfs-rules.html|title=Rules on how to access information in sysfs — The Linux Kernel documentation|website=Kernel.org|access-date=6 January 2020|archive-date=7 March 2020|archive-url=https://web.archive.org/web/20200307065123/https://www.kernel.org/doc/html/latest/admin-guide/sysfs-rules.html|url-status=live}}</ref>
==== Kernel-to-userspace ABI ====
{{Main|Linux Standard Base}}
Because of the differences existing between the hundreds of various implementations of the Linux OS, executable objects, even though they are compiled, assembled, and linked for running on a specific hardware architecture (that is, they use the [[Instruction set architecture|ISA]] of the target hardware), often cannot run on different Linux distributions. This issue is mainly due to distribution-specific configurations and a set of patches applied to the code of the Linux kernel, differences in system libraries, services (daemons), filesystem hierarchies, and environment variables.
The main standard concerning application and binary compatibility of Linux distributions is the [[Linux Standard Base]] (LSB).<ref name="K8v7f">{{cite web|url=https://refspecs.linuxbase.org/|title=Linux Foundation Referenced Specifications|website=refspecs.linuxbase.org|access-date=3 February 2020}}</ref><ref name="xXTn9">{{cite web|url=https://refspecs.linuxbase.org/lsb.shtml|title=LSB Specifications|website=refspecs.linuxbase.org|access-date=3 February 2020}}</ref> However, the LSB goes beyond what concerns the Linux kernel, because it also defines the desktop specifications, the X libraries and Qt that have little to do with it.<ref name="b18aw">{{cite web|url=https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Desktop-generic/LSB-Desktop-generic/book1.html|title=Linux Standard Base Desktop Specification, Generic Part|website=refspecs.linuxbase.org|access-date=3 February 2020}}</ref> The LSB version 5 is built upon several standards and drafts (POSIX, SUS, X/Open, [[Filesystem Hierarchy Standard|File System Hierarchy]] (FHS), and others).<ref name="OXb0O">{{cite web|url=https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/normativerefs.html|title=Normative References|website=refspecs.linuxfoundation.org|access-date=3 February 2020|archive-date=12 August 2020|archive-url=https://web.archive.org/web/20200812044159/https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/normativerefs.html|url-status=live}}</ref>
The parts of the LSB more relevant to the kernel are the ''General ABI'' (gABI),<ref name="BvU35">{{cite web|url=https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/book1.html|title=Linux Standard Base Core Specification, Generic Part|website=refspecs.linuxfoundation.org|access-date=3 February 2020|archive-date=29 November 2019|archive-url=https://web.archive.org/web/20191129194815/https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/book1.html|url-status=live}}</ref> especially the [[System V Interface Definition|System V ABI]]<ref name="LhnpZ">{{cite web|url=https://www.sco.com/developers/devspecs/gabi41.pdf|title=System V Application Binary Interface - Edition 4.1|website=Sco.com|access-date=3 February 2020|archive-date=13 December 2019|archive-url=https://web.archive.org/web/20191213124815/http://www.sco.com/developers/devspecs/gabi41.pdf|url-status=live}}</ref><ref name="vftgf">{{cite web|url=http://www.sco.com/developers/gabi/2003-12-17/contents.html|title=Xinuos Inc. {{!}} Developers {{!}} Gabi {{!}} 17 December 2003 {{!}} System V Application Binary Interface - DRAFT|website=Sco.com|access-date=3 February 2020|archive-date=3 February 2020|archive-url=https://web.archive.org/web/20200203124116/http://www.sco.com/developers/gabi/2003-12-17/contents.html|url-status=live}}</ref> and the [[Executable and Linkable Format|Executable and Linking Format]] (ELF),<ref name="qXIDV">{{cite web|url=https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/elf-generic.html|title=Executable And Linking Format (ELF)|website=Refspecs.linuxbase.org|access-date=3 February 2020}}</ref><ref name="ypxud">{{cite web|title=elf(5) - Linux manual page|url=https://man7.org/linux/man-pages/man5/elf.5.html|access-date=18 November 2020|website=man7.org|archive-date=30 November 2020|archive-url=https://web.archive.org/web/20201130114725/https://man7.org/linux/man-pages/man5/elf.5.html|url-status=live}}</ref> and the ''Processor Specific ABI'' (psABI), for example the ''Core Specification for X86-64.''<ref name="Ar6xD">{{cite web|url=https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-AMD64/LSB-Core-AMD64/book1.html|title=Linux Standard Base Core Specification for X86-64|website=Refspecs.linuxbase.org|access-date=3 February 2020}}</ref><ref name="eNx2d">{{cite web|url=https://refspecs.linuxbase.org/elf/gabi4+/contents.html|title=System V Application Binary Interface - DRAFT|website=Refspecs.linuxbase.org|access-date=3 February 2020}}</ref>
The standard ABI for how x86_64 user programs invoke system calls is to load the syscall number into the ''rax'' register, and the other parameters into ''rdi'', ''rsi'', ''rdx'', ''r10'', ''r8'', and ''r9'', and finally to put the ''syscall'' assembly instruction in the code.<ref name="VSMQS">{{Cite book|last=Seyfarth|first=Ray|title=Introduction to 64 Bit Intel Assembly Language Programming for Linux|year=2012|isbn=9781478119203|page=170|publisher=CreateSpace Independent Publishing Platform }}</ref><ref name="eIbJy">{{cite web|title=Anatomy of a system call, part 1 [LWN.net]|url=https://lwn.net/Articles/604287/|access-date=16 July 2020|website=lwn.net|archive-date=18 August 2020|archive-url=https://web.archive.org/web/20200818051836/https://lwn.net/Articles/604287/|url-status=live}}</ref><ref name="Fa3aZ">{{cite web|title=Anatomy of a system call, part 2 [LWN.net]|url=https://lwn.net/Articles/604515/|access-date=16 July 2020|website=lwn.net|archive-date=6 August 2020|archive-url=https://web.archive.org/web/20200806081538/https://lwn.net/Articles/604515/|url-status=live}}</ref>
==== In-kernel API ====
[[File:Linux AMD graphics stack.svg|thumb|upright=1.2|At XDC2014, Alex Deucher from AMD announced the unified kernel-mode driver.<ref name="LRSSt">{{cite web |url=http://wiki.x.org/wiki/Events/XDC2014/XDC2014DeucherAMD/ |title=AMD's New Unified Open Source Driver |last=Deucher |first=Alex |date=7 October 2014 |publisher=[[X.Org Foundation]] |access-date=21 January 2015 |archive-date=21 January 2015 |archive-url=https://web.archive.org/web/20150121163629/http://wiki.x.org/wiki/Events/XDC2014/XDC2014DeucherAMD/ |url-status=live}}</ref> The proprietary Linux graphic driver, {{Mono|[[AMD Catalyst|libGL-fglrx-glx]]}}, will share the same [[Direct Rendering Manager|DRM]] infrastructure with [[Mesa 3D]]. As there is no stable in-kernel [[Application binary interface|ABI]], AMD had to constantly adapt the former [[binary blob]] used by Catalyst.]]
There are several internal kernel APIs between kernel subsystems. Some are available only within the kernel subsystems, while a somewhat limited set of in-kernel symbols (i.e., variables, data structures, and functions) is exposed to dynamically loadable modules (e.g., device drivers loaded on demand) whether they're exported with the {{Mono|EXPORT_SYMBOL()}} and {{Mono|EXPORT_SYMBOL_GPL()}} macros<ref name=":6">{{cite web|url=https://www.kernel.org/doc/html/latest/kernel-hacking/hacking.html?highlight=export_symbol#symbols|title=Symbols - Unreliable Guide To Hacking The Linux Kernel — The Linux Kernel documentation|website=Kernel.org|access-date=8 February 2020|archive-date=3 August 2020|archive-url=https://web.archive.org/web/20200803074501/https://www.kernel.org/doc/html/latest/kernel-hacking/hacking.html?highlight=export_symbol#symbols|url-status=live}}</ref><ref name=":7">{{cite web|url=https://lwn.net/Articles/249246/|title=Exported symbols and the internal API [LWN.net]|website=Lwn.net|access-date=15 March 2020|archive-date=31 March 2020|archive-url=https://web.archive.org/web/20200331211446/https://lwn.net/Articles/249246/|url-status=live}}</ref> (the latter reserved to modules released under a GPL-compatible license).<ref name=":8">{{cite web|url=https://lwn.net/Articles/813350/|title=Unexporting kallsyms_lookup_name() [LWN.net]|website=Lwn.net|access-date=15 March 2020|archive-date=1 April 2020|archive-url=https://web.archive.org/web/20200401062303/https://lwn.net/Articles/813350/|url-status=live}}</ref>
Linux provides in-kernel APIs that manipulate data structures (e.g., [[linked list]]s, [[radix tree]]s,<ref name="kHdQ8">{{cite web|title=Trees I: Radix trees [LWN.net]|url=https://lwn.net/Articles/175432/|access-date=13 November 2020|website=lwn.net|archive-date=8 November 2020|archive-url=https://web.archive.org/web/20201108131647/https://lwn.net/Articles/175432/|url-status=live}}</ref> [[Red–black tree|red-black trees]],<ref name="F2Fpg">{{cite web|title=Trees II: red-black trees [LWN.net]|url=https://lwn.net/Articles/184495/|access-date=13 November 2020|website=lwn.net|archive-date=13 November 2020|archive-url=https://web.archive.org/web/20201113130357/https://lwn.net/Articles/184495/|url-status=live}}</ref> [[Queue (abstract data type)|queues]]) or perform common routines (e.g., copy data from and to user space, allocate memory, print lines to the system log, and so on) that have remained stable at least since Linux version 2.6.<ref name="yA682">{{cite web| url=https://www.kernel.org/doc/htmldocs/kernel-hacking/index.html| title=Unreliable Guide To Hacking The Linux Kernel| year=2005| website=Kernel.org| access-date=15 March 2020| edition=1st| archive-date=16 February 2020| archive-url=https://web.archive.org/web/20200216191225/https://www.kernel.org/doc/htmldocs/kernel-hacking/index.html| url-status=live}}</ref><ref name="HWCYl">{{cite web| url=https://www.kernel.org/doc/html/latest/kernel-hacking/hacking.html| title=Unreliable Guide To Hacking The Linux Kernel — The Linux Kernel documentation| website=Kernel.org| access-date=15 March 2020| archive-date=7 March 2020| archive-url=https://web.archive.org/web/20200307065323/https://www.kernel.org/doc/html/latest/kernel-hacking/hacking.html| url-status=live}}</ref><ref name="Hjefj">{{cite web| url=https://www.kernel.org/doc/html/latest/kernel-hacking/locking.html| title=Unreliable Guide To Locking — The Linux Kernel documentation| website=Kernel.org| access-date=15 March 2020| archive-date=7 March 2020| archive-url=https://web.archive.org/web/20200307065319/https://www.kernel.org/doc/html/latest/kernel-hacking/locking.html| url-status=live}}</ref>
In-kernel APIs include libraries of low-level common services used by device drivers:
* [[SCSI]] Interfaces and [[libATA]]{{snd}}respectively, a peer-to-peer packet based communication protocol for storage devices attached to USB, SATA, SAS, Fibre Channel, FireWire, ATAPI device,<ref name="6WQLB">{{cite web|title=SCSI Interfaces Guide — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/driver-api/scsi.html|access-date=11 June 2020|website=Kernel.org|archive-date=2 June 2020|archive-url=https://web.archive.org/web/20200602154450/https://www.kernel.org/doc/html/latest/driver-api/scsi.html|url-status=live}}</ref> and an in-kernel library to support [S]ATA host controllers and devices.<ref name="qlKWp">{{cite web|title=libATA Developer's Guide — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/driver-api/libata.html|access-date=11 June 2020|website=Kernel.org|archive-date=30 May 2020|archive-url=https://web.archive.org/web/20200530101401/https://www.kernel.org/doc/html/latest/driver-api/libata.html|url-status=live}}</ref>
* [[Direct Rendering Manager]] (DRM) and [[Kernel Mode Setting]] (KMS){{snd}}for interfacing with GPUs and supporting the needs of modern 3D-accelerated video hardware,<ref name="Zd5bj">{{cite web|title=DRM Internals — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/gpu/drm-internals.html|access-date=11 June 2020|website=Kernel.org|archive-date=1 June 2020|archive-url=https://web.archive.org/web/20200601202717/https://www.kernel.org/doc/html/latest/gpu/drm-internals.html|url-status=live}}</ref> and for setting screen resolution, color depth and refresh rate<ref name="RkbFE">{{cite web|title=Kernel Mode Setting (KMS) — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#overview|access-date=11 June 2020|website=Kernel.org|archive-date=11 June 2020|archive-url=https://web.archive.org/web/20200611233817/https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#overview|url-status=live}}</ref>
* [[Direct memory access|DMA]] buffers ([[DMA-BUF]]){{snd}}for sharing buffers for hardware direct memory access across multiple device drivers and subsystems<ref name="Ux72p">{{cite web|title=Introduce DMA buffer sharing mechanism [LWN.net]|url=https://lwn.net/Articles/473668/|access-date=11 June 2020|website=lwn.net|archive-date=11 June 2020|archive-url=https://web.archive.org/web/20200611235759/https://lwn.net/Articles/473668/|url-status=live}}</ref><ref name="H845T">{{cite web|date=12 May 2016|title=Sharing CPU and GPU buffers on Linux*|url=https://01.org/blogs/2016/sharing-cpu-and-gpu-buffers-linux|access-date=11 June 2020|website=01.org|archive-date=11 June 2020|archive-url=https://web.archive.org/web/20200611231858/https://01.org/blogs/2016/sharing-cpu-and-gpu-buffers-linux|url-status=live}}</ref><ref name="w1T10">{{cite web|title=Buffer Sharing and Synchronization — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/driver-api/dma-buf.html|access-date=11 June 2020|website=Kernel.org|archive-date=1 June 2020|archive-url=https://web.archive.org/web/20200601205610/https://www.kernel.org/doc/html/latest/driver-api/dma-buf.html|url-status=live}}</ref>
* [[Video4Linux]]{{snd}}for video capture hardware
* [[Advanced Linux Sound Architecture]] (ALSA){{snd}}for sound cards
* [[New API]]{{snd}}for [[network interface controller]]s
* [[mac80211]] and cfg80211{{snd}}for wireless network interface controllers<ref name="za5ZK">{{cite web |url=https://wireless.wiki.kernel.org/en/developers/Documentation/mac80211 |title=About mac80211 |publisher=Linux Kernel Organization, Inc. |access-date=8 June 2014 |archive-date=1 February 2021 |archive-url=https://web.archive.org/web/20210201114135/https://wireless.wiki.kernel.org/en/developers/documentation/mac80211 |url-status=live}}</ref><ref>{{cite web|title=Linux 802.11 Driver Developer's Guide — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/driver-api/80211/index.html|access-date=19 November 2021|website=Kernel.org}}</ref>
==== In-kernel ABI ====
The Linux developers chose not to maintain a stable in-kernel ABI. Modules compiled for a specific version of the kernel cannot be loaded into another version without being recompiled.<ref name="stable-api-nonsense2" />
=== Process management ===
{{See also|Process (computing)|Thread (computing)|Process management (computing)}}
Linux, as other [[Kernel (operating system) | kernels]], has the ability to manage processes including creating, suspending, resuming and terminating. Unlike other operating systems, the Linux kernel implements processes as a group of threads called tasks. If two tasks share the same {{Mono | TGID}}, then they are called in the kernel terminology a task group. Each task is represented by a ''task_struct'' [[data structure]]. When a process is created it is assigned a globally unique identifier called ''PID'' and cannot be shared<ref name="nRDb2">{{cite web|title=clone(2) - Linux manual page|url=https://man7.org/linux/man-pages/man2/clone.2.html|access-date=15 July 2020|website=man7.org|archive-date=15 July 2020|archive-url=https://web.archive.org/web/20200715175357/https://man7.org/linux/man-pages/man2/clone.2.html|url-status=live}}</ref><ref name="nefj4">{{cite web|title=clone3(), fchmodat4(), and fsinfo() [LWN.net]|url=https://lwn.net/Articles/792628/|access-date=15 July 2020|website=lwn.net|archive-date=15 June 2020|archive-url=https://web.archive.org/web/20200615080341/https://lwn.net/Articles/792628/|url-status=live}}</ref>
A new process can be created by calling {{ Mono | clone}}<ref name="JwCDQ">{{cite web|title=[PATCH v3 1/2] fork: add clone3 [LWN.net]|url=https://lwn.net/ml/linux-kernel/20190604160944.4058-1-christian@brauner.io/|access-date=16 July 2020|website=lwn.net|archive-date=16 July 2020|archive-url=https://web.archive.org/web/20200716232314/https://lwn.net/ml/linux-kernel/20190604160944.4058-1-christian@brauner.io/|url-status=live}}</ref> family of system calls or {{Mono | fork}} [[system call]]. Processes can be suspended and resumed by the kernel by sending signals like {{Mono | SIGSTOP}} and {{Mono | SIGCONT}}. A process can terminate it's self by calling {{ Mono | exit}} system call, or terminated by another process by sending signals like {{ Mono | SIGKILL}}, {{Mono | SIGABRT}} or {{Mono | SIGINT}}.
If the executable is dynamically linked to shared libraries, a [[dynamic linker]] is used to find and load the needed objects, prepare the program to run and then run it.<ref name="D1tjk">{{cite web|title=ld-linux.so(8) - Linux manual page|url=https://man7.org/linux/man-pages/man8/ld-linux.so.8.html|access-date=18 November 2020|website=man7.org|archive-date=26 November 2020|archive-url=https://web.archive.org/web/20201126063027/https://man7.org/linux/man-pages/man8/ld-linux.so.8.html|url-status=live}}</ref>
The [[Native POSIX Thread Library]] (NPTL)<ref name="dS4yu">{{cite web|title=nptl(7) - Linux manual page|url=https://man7.org/linux/man-pages/man7/nptl.7.html|access-date=25 July 2020|website=man7.org|archive-date=25 July 2020|archive-url=https://web.archive.org/web/20200725045335/https://man7.org/linux/man-pages/man7/nptl.7.html|url-status=live}}</ref> provides the POSIX standard thread interface (''pthreads'') to userspace. The kernel isn't aware of processes nor threads but it is aware of ''tasks'', thus threads are implemented in userspace. Threads in Linux are implemented as ''tasks'' sharing resources, while if they aren't sharing called to be independent processes.
The kernel provides the {{Mono|futex(7)}} (fast user-space mutex) mechanisms for user-space locking and synchronization.<ref name="dZykS">{{cite web|title=futex(7) - Linux manual page|url=https://man7.org/linux/man-pages/man7/futex.7.html|access-date=25 July 2020|website=man7.org|archive-date=15 July 2020|archive-url=https://web.archive.org/web/20200715175424/https://man7.org/linux/man-pages/man7/futex.7.html|url-status=live}}</ref> The majority of the operations are performed in userspace but it may be necessary to communicate with the kernel using the {{Mono|futex(2)}} system call.<ref name=":0" />
As opposed to userspace threads described above, ''kernel threads'' run in kernel space.<ref name="kOgyp">{{cite web|title=Kernel threads made easy [LWN.net]|url=https://lwn.net/Articles/65178/|access-date=15 August 2020|website=lwn.net|archive-date=31 March 2020|archive-url=https://web.archive.org/web/20200331215714/https://lwn.net/Articles/65178/|url-status=live}}</ref> They are threads created by the kernel itself for specialized tasks; they are privileged like the kernel and aren't bound to any process or application.
=== Scheduling ===
{{Main|Completely Fair Scheduler|Earliest eligible virtual deadline first scheduling}}
{{See also|Scheduling (computing)#Linux}}
The Linux [[process scheduler]] is modular, in the sense that it enables different scheduling classes and policies.<ref name="moshe">{{cite web |last=Bar |first=Moshe |date=1 April 2000 |title=The Linux Scheduler |url=http://www.linuxjournal.com/article/3910 |url-status=live |archive-url=https://web.archive.org/web/20210202131440/https://www.linuxjournal.com/article/3910 |archive-date=2 February 2021 |access-date=14 April 2012 |work=[[Linux Journal]] |publisher=Belltown Media, Inc. |language=en}}</ref><ref>{{Citation|title=BKK19-TR03 - The Linux Kernel Scheduler - Overview| date=23 April 2019 |url=https://www.youtube.com/watch?v=oOiaRHC9ZDg |archive-url=https://ghostarchive.org/varchive/youtube/20211215/oOiaRHC9ZDg |archive-date=15 December 2021 |url-status=live|language=en|access-date=17 May 2021}}{{cbignore}}</ref> Scheduler classes are plugable scheduler algorithms that can be registered with the base scheduler code. Each class schedules different types of processes. The core code of the scheduler iterates over each class in order of priority and chooses the highest priority scheduler that has a schedulable entity of type struct sched_entity ready to run.<ref name="LoveRobert2010" />{{Rp|pages=46–47}} Entities may be threads, group of threads, and even all the processes of a specific user.
Linux provides both [[preemption (computing)|user preemption]] as well as full [[kernel preemption]].<ref name="LoveRobert2010" />{{Rp|pages=62–63}} Preemption reduces [[latency (engineering)|latency]], increases responsiveness,<ref name="VRxA1">{{cite web|title=Lowering Latency in Linux: Introducing a Preemptible Kernel {{!}} Linux Journal|url=https://www.linuxjournal.com/article/5600|access-date=17 August 2020|website=Linuxjournal.com|archive-date=9 August 2020|archive-url=https://web.archive.org/web/20200809182228/https://www.linuxjournal.com/article/5600|url-status=live}}</ref> and makes Linux more suitable for desktop and [[real-time computing|real-time]] applications.
For normal tasks, by default, the kernel uses the [[Completely Fair Scheduler]] (CFS) class{{Update inline|date=May 2025|reason=EEVDF replaced CFS as of Linux 6.6}}, introduced in version 2.6.23.<ref name=":5">{{cite mailing list|title=[patch] Modular Scheduler Core and Completely Fair Scheduler [CFS]|url=https://lwn.net/Articles/230501/|last=Molnár|first=Ingo|author-link=Ingo Molnár|date=13 April 2007|mailing-list=[[LKML]]|access-date=30 March 2020|archive-date=3 November 2020|archive-url=https://web.archive.org/web/20201103034312/https://lwn.net/Articles/230501/|url-status=live}}</ref> The scheduler is defined as a macro in a C header as <code>SCHED_NORMAL</code>. In other POSIX kernels, a similar policy known as <code>SCHED_OTHER</code> allocates CPU timeslices (i.e, it assigns absolute slices of the processor time depending on either predetermined or dynamically computed priority of each process). The Linux CFS does away with absolute timeslices and assigns a fair proportion of CPU time, as a function of parameters like the total number of runnable processes and the time they have already run; this function also takes into account a kind of weight that depends on their relative priorities (nice values).<ref name="LoveRobert2010" />{{Rp|pages=46–50}}
With user preemption, the kernel scheduler can replace the current process with the execution of a [[context switch]] to a different one that therefore acquires the computing resources for running (CPU, memory, and more). It makes it according to the CFS algorithm (in particular, it uses a variable called {{Mono|vruntime}} for sorting entities and then chooses the one that has the smaller vruntime, - i.e., the schedulable entity that has had the least share of CPU time), to the active scheduler policy and to the relative priorities.<ref>{{cite web|title=CFS Scheduler — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/scheduler/sched-design-CFS.html#|access-date=1 May 2021|website=Kernel.org}}</ref> With kernel preemption, the kernel can preempt itself when an interrupt handler returns, when kernel tasks block, and whenever a subsystem explicitly calls the schedule() function.
The kernel also contains two POSIX-compliant<ref name="posix1b">{{cite web|url=http://www.opengroup.org/onlinepubs/009695399|title=IEEE Standard for Information Technology – Portable Operating System Interface, POSIX.1b, Real-time extensions (IEEE Std 1003.1b-1993)|access-date=17 March 2016|archive-date=16 November 2010|archive-url=https://web.archive.org/web/20101116144926/http://www.opengroup.org/onlinepubs/009695399/|url-status=live}}</ref> real-time scheduling classes named <code>[[SCHED_FIFO]]</code> (realtime [[FIFO (computing and electronics)|first-in-first-out]]) and <code>[[SCHED_RR]]</code> (realtime [[round-robin scheduling|round-robin]]), both of which take precedence over the default class.<ref name="moshe" /> An additional scheduling policy known as <code>[[SCHED DEADLINE]]</code>, implementing the [[earliest deadline first scheduling|earliest deadline first algorithm]] (EDF), was added in kernel version 3.14, released on 30 March 2014.<ref name="l4mcR">{{cite web |url=https://www.phoronix.com/scan.php?page=news_item&px=MTU4Mjg |title=The Linux 3.14 Kernel Already Has Many Exciting Features |last=Larabel |first=Michael |author-link=Michael Larabel |date=24 January 2014 |publisher=[[Phoronix]] |access-date=3 February 2014 |archive-date=13 August 2020 |archive-url=https://web.archive.org/web/20200813143115/https://www.phoronix.com/scan.php?page=news_item&px=MTU4Mjg |url-status=live}}</ref><ref name="4bHu1">{{cite web |url=http://kernelnewbies.org/Linux_3.14#head-651929cdcf19cc2e2cfc7feb16b78ef963d195fe |title=Linux kernel 3.14, Section 1.1. Deadline scheduling class for better real-time scheduling |date=30 March 2014 |website=kernelnewbies.org |access-date=2 April 2014 |archive-date=15 January 2021 |archive-url=https://web.archive.org/web/20210115101454/https://kernelnewbies.org/Linux_3.14#head-651929cdcf19cc2e2cfc7feb16b78ef963d195fe |url-status=live}}</ref> <code>SCHED_DEADLINE</code> takes precedence over all the other scheduling classes.
Real-time <code>[[PREEMPT_RT]]</code> patches, included into the mainline Linux since version 2.6, provide a [[real-time operating system#Scheduling|deterministic scheduler]], the removal of preemption and interrupt disabling (where possible), PI Mutexes (i.e., locking primitives that avoid priority inversion),<ref>{{cite web|title=RT-mutex implementation design — The Linux Kernel documentation| url=https://www.kernel.org/doc/html/v5.15/locking/rt-mutex-design.html|access-date=17 December 2021|website=Kernel.org}}</ref><ref>{{cite web|title=RT-mutex subsystem with PI support — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/v5.15/locking/rt-mutex.html|access-date=17 December 2021|website=Kernel.org}}</ref> support for [[High Precision Event Timers]] (HPET), preemptive [[read-copy-update]] (RCU), (forced) IRQ threads, and other minor features.<ref name="omdEo">{{cite web |url=https://lwn.net/Articles/146861/ |title=A realtime preemption overview |last=McKenney |first=Paul |date=10 August 2005 |publisher=[[LWN.net]] |access-date=5 February 2012 |archive-date=10 August 2020 |archive-url=https://web.archive.org/web/20200810165635/https://lwn.net/Articles/146861/ |url-status=live}}</ref><ref name="88zv7">{{cite web |url=https://www.osadl.org/Realtime-Linux.projects-realtime-linux.0.html |title=OSADL Project: Realtime Linux |publisher=[[OSADL]] |access-date=5 February 2012 |archive-date=4 February 2021 |archive-url=https://web.archive.org/web/20210204170950/https://www.osadl.org/Realtime-Linux.projects-realtime-linux.0.html |url-status=live}}</ref><ref name="lfrtsr2">{{ Cite web |last= Rostedt |first= Steven |date= 24 October 2018 |title= Real-Time is coming to Linux. What does that mean for you? |url= https://events19.linuxfoundation.org/wp-content/uploads/2017/12/elc-eu-2018-rt-what-does-it-mean_Steven-Rostedt.pdf |access-date= 10 August 2025 }}</ref>
In 2023, Peter Zijlstra proposed replacing CFS with an [[earliest eligible virtual deadline first scheduling]] (EEVDF) scheduler,<ref>{{Cite web |title=EEVDF Scheduler May Be Ready For Landing With Linux 6.6 |url=https://www.phoronix.com/news/Linux-6.6-EEVDF-Likely |access-date=31 August 2023 |website=[[Phoronix]] |language=en}}</ref><ref>{{Cite web|url=https://lwn.net/ml/linux-kernel/20230306132521.968182689@infradead.org/|title=[PATCH 00/10] sched: EEVDF using latency-nice [LWN.net]|website=[[LWN.net]]}}</ref> to prevent the need for CFS "latency nice" patches.<ref>{{Cite web |title=An EEVDF CPU scheduler for Linux [LWN.net] |url=https://lwn.net/Articles/925371/ |access-date=31 August 2023 |website=[[LWN.net]]}}</ref> The EEVDF scheduler replaced CFS in version 6.6 of the Linux kernel.<ref name="auto1"/>
=== Synchronization ===
The kernel has different causes of concurrency (e.g., interrupts, bottom halves, preemption of kernel and users tasks, symmetrical multiprocessing).<ref name="LoveRobert2010" />{{Rp|page=167}}
For protecting critical regions (sections of code that must be executed atomically), shared memory locations (like [[global variable]]s and other data structures with global scope), and regions of memory that are asynchronously modifiable by hardware (e.g., having the C [[Volatile (computer programming)|<code>volatile</code>]] [[type qualifier]]), Linux provides a large set of tools. They consist of [[Linearizability|atomic types]] (which can only be manipulated by a set of specific operators), [[spinlock]]s, [[Semaphore (programming)|semaphores]], [[Mutual exclusion|mutexes]],<ref>{{cite web|title=locking — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/v5.15/locking/index.html|access-date=17 December 2021|website=Kernel.org}}</ref><ref name="LoveRobert2010" />{{rp|pages=176–198}}<ref name="0w0IX">{{cite web|title=locking.rst - Documentation/kernel-hacking/locking.rst - Linux source code (v5.11.10) - Bootlin|url=https://elixir.bootlin.com/linux/v5.11.10/source/Documentation/kernel-hacking/locking.rst|access-date=29 March 2021|website=elixir.bootlin.com}}</ref> and [[Non-blocking algorithm|lockless algorithms]] (e.g., [[Read-copy-update|RCUs]]).<ref name="XK3oD">{{cite web|title=What is RCU, Fundamentally? [LWN.net]|url=https://lwn.net/Articles/262464/|access-date=29 March 2021|website=lwn.net}}</ref><ref name="XErGf">{{cite web|title=What is RCU? Part 2: Usage [LWN.net]|url=https://lwn.net/Articles/263130/|access-date=29 March 2021|website=lwn.net}}</ref><ref name="bMkeA">{{cite web|title=RCU part 3: the RCU API [LWN.net]|url=https://lwn.net/Articles/264090/|access-date=29 March 2021|website=lwn.net}}</ref> Most lock-less algorithms are built on top of [[memory barrier]]s for the purpose of enforcing [[memory ordering]] and prevent undesired side effects due to [[Optimizing compiler|compiler optimization]].<ref name="L9seK">{{cite web|title=Linux-Kernel Memory Model|url=http://open-std.org/JTC1/SC22/WG21/docs/papers/2020/p0124r7.html|access-date=29 March 2021|website=open-std.org}}</ref><ref name="SYavd">{{cite web|title=A formal kernel memory-ordering model (part 1) [LWN.net]|url=https://lwn.net/Articles/718628/|access-date=29 March 2021|website=lwn.net}}</ref><ref name="JZLZo">{{cite web|title=A formal kernel memory-ordering model (part 2) [LWN.net]|url=https://lwn.net/Articles/720550/|access-date=29 March 2021|website=lwn.net}}</ref><ref name="bl5AB">{{cite web|last=Stern|first=Alan|title=Explanation of the Linux-Kernel Memory Consistency Model|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/memory-model/Documentation/explanation.txt}}</ref>
<code>[[PREEMPT_RT]]</code> code included in mainline Linux provide ''RT-mutexes'', a special kind of Mutex which do not disable preemption and have support for priority inheritance.<ref>{{cite web|title=kernel/git/torvalds/linux.git - Linux kernel source tree|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e5e726f7bb9f711102edea7e5bd511835640e3b4|access-date=17 December 2021|website=git.kernel.org}}</ref><ref name="locktypes">{{cite web|title=Lock types and their rules — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/v5.15/locking/locktypes.html|access-date=17 December 2021|website=Kernel.org}}</ref> Almost all locks are changed into sleeping locks when using configuration for realtime operation.<ref>{{cite web|url=https://lwn.net/Articles/866112/ |title=Short subjects: Realtime, Futexes, and ntfs3 |website=Lwn.net |date= |access-date=20 February 2022}}</ref><ref name="lfrtsr2" /><ref name="locktypes" /> [[Priority inheritance]] avoids priority inversion by granting a low-priority task which holds a contended lock the priority of a higher-priority waiter until that lock is released.<ref>{{Cite web|url=https://www.kernel.org/doc/html/latest/locking/rt-mutex.html|title=RT-mutex subsystem with PI support — The Linux Kernel documentation|website=Kernel.org|access-date=20 February 2022}}</ref><ref>{{cite web|url=https://www.kernel.org/doc/html/latest/locking/rt-mutex-design.html|title = RT-mutex implementation design — the Linux Kernel documentation}}</ref>
Linux includes a kernel lock validator called ''Lockdep''.<ref>{{cite web |title=Runtime locking correctness validator — The Linux Kernel documentation |url=https://www.kernel.org/doc/html/latest/locking/lockdep-design.html |access-date=17 December 2021 |website=Kernel.org |language=en}}</ref><ref>{{cite web|title=Interrupts, threads, and lockdep [LWN.net]|url=https://lwn.net/Articles/321663/|access-date=17 December 2021|website=lwn.net}}</ref>
=== Interrupts ===
Although the management of [[interrupt]]s could be seen as a single job, it is divided into two. This split in two is due to the different time constraints and to the synchronization needs of the tasks whose the management is composed of. The first part is made up of an asynchronous [[Interrupt handler|interrupt service routine]] (ISR) that in Linux is known as the ''top half'', while the second part is carried out by one of three types of the so-called ''bottom halves'' (''softirq'', ''tasklets,'' and ''work queues'').<ref name="LoveRobert2010" />{{Rp|pages=133–137}}
Linux interrupt service routines can be nested. A new IRQ can trap into a high priority ISR that preempts any other lower priority ISR.
=== Memory ===
{{See also|Memory management|Virtual memory}}
The Linux kernel manages both physical and virtual memory. It divides physical memory into zones,<ref name="auto">{{Cite web|url=https://docs.kernel.org/mm/physical_memory.html|title=Physical Memory — The Linux Kernel documentation|website=docs.kernel.org}}</ref> each of which has a specific purpose.
* ''ZONE_DMA'': this zone is suitable for [[Direct memory access | DMA]].
* ''ZONE_NORMAL'': for normal memory operations.
* ''ZONE_HIGHMEM'': part of physical memory that is only accessible to the kernel using temporary mapping.
Those zones are the most common, but others exist.<ref name="auto"/>
Linux implements [[virtual memory]] with 4 or 5-level [[page table]]s.<ref>{{Cite web |title=Page Tables — The Linux Kernel documentation |url=https://www.kernel.org/doc/html/latest/mm/page_tables.html |access-date=2024-07-21 |website=www.kernel.org}}</ref> The kernel is not [[Memory paging|pageable]] (meaning it is always resident in physical memory and cannot be swapped to the disk) and there is no memory protection (no ''SIGSEGV'' signals, unlike in user space), therefore memory violations lead to instability and system crashes.<ref name="LoveRobert2010" />{{Rp|page=20}} User memory is pageable by default, although paging for specific memory areas can be disabled with the <code>mlock()</code> [[system call]] family.
[[Page frame]] information is maintained in apposite data structures (of type {{Mono|struct page}}) that are populated immediately after boot and kept until shutdown, regardless of whether they are associated with virtual pages. The physical address space is divided into different zones, according to architectural constraints and intended use. NUMA systems with multiple memory banks are also supported.<ref>{{Cite web |title=Physical Memory — The Linux Kernel documentation |url=https://www.kernel.org/doc/html/latest/mm/physical_memory.html |access-date=2024-07-21 |website=www.kernel.org}}</ref>
Small chunks of memory can be dynamically allocated in kernel space via the family of <code>kmalloc()</code> APIs and freed with the appropriate variant of <code>kfree()</code>. <code>vmalloc()</code> and <code>kvfree()</code> are used for large virtually contiguous chunks. <code>alloc_pages()</code> allocates the desired number of entire pages.
[[File:The Linux Storage Stack Diagram.svg|thumb|alt=|upright=1.3|The Linux Storage Stack Diagram<ref name="zA63q">{{cite web|url=https://www.thomas-krenn.com/de/wikiDE/images/7/72/Linux-storage-stack-diagram_v4.10.svg|title=The Linux Storage Stack Diagram|website=Thomas-krenn.com|access-date=19 March 2020|archive-date=3 August 2020|archive-url=https://web.archive.org/web/20200803100605/https://www.thomas-krenn.com/de/wikiDE/images/7/72/Linux-storage-stack-diagram_v4.10.svg|url-status=live}}</ref>]]
The kernel used to include the SLAB, SLUB and SLOB allocators as configurable alternatives.<ref>{{cite web |url=https://lwn.net/Articles/229984/ |title=The SLUB allocator |website=Lwn.net |date=11 April 2007 |access-date=20 February 2022}}</ref><ref name="lfsa">{{cite web|url=https://events.static.linuxfound.org/sites/events/files/slides/slaballocators.pdf|title=Slab allocators in the Linux Kernel: SLAB, SLOB, SLUB|website=Events.static.linuxfound.org|access-date=20 February 2022}}</ref> The SLOB allocator was removed in Linux 6.4<ref>{{Cite web |last=Corbet |first=Jonathan |title=6.4 Merge window, part 1 [LWN.net] |url=https://lwn.net/Articles/930068/ |date=28 April 2023 |access-date=12 May 2023 |website=[[LWN.net]]}}</ref> and the SLAB allocator was removed in Linux 6.8.<ref>{{Cite web |title=The first half of the 6.8 merge window [LWN.net] |url=https://lwn.net/Articles/957188/ |access-date=2024-07-21 |website=lwn.net}}</ref> The sole remaining allocator is SLUB, which aims for simplicity and efficiency,<ref name="lfsa" /> is <code>[[PREEMPT_RT]]</code> compatible<ref>{{cite web |title=Kernel/Git/Torvalds/Linux.git - Linux kernel source tree |url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc09ee80c3b18ae1a897a30a17fe710b2b2f620a |website=Git.kernel.org}}</ref> and was introduced in Linux 2.6.
=== Virtual filesystem ===
{{See also | Virtual file system | Virtual filesystem}}
Since Linux supports numerous filesystems with different features and functionality, it is necessary to implement a generic filesystem that is independent from underlying filesystems. The [[virtual file system]] interfaces with other Linux subsystems, userspace, or [[api | APIs]] and abstracts away the different implementations of underlying filesystems. VFS implements system calls like <code>create</code>, <code>open</code>, <code>read</code>, <code>write</code> and <code>close</code>.
VFS implements a generic [[Superblock (file system)|superblock]]<ref>{{Cite web|url=https://docs.oracle.com/cd/E19683-01/806-4073/fsfilesysappx-3/index.html|title=The Superblock (System Administration Guide: Basic Administration)|website=docs.oracle.com}}</ref> and [[inode|inode block]] that is independent from the one that the underlying filesystem has.
In this subsystem directories and files are represented by a <code>struct file</code> [[data structure]]. When [[userspace]] requests access to a file it is returned a [[file descriptor]] (non negative integer value) but in [[kernel space]] it is a <code>struct file</code> structure. This structure stores all the information the kernel knows about a file or directory.
[[sysfs]] and [[procfs]] are virtual filesystems that expose hardware information and [[userspace]] programs' runtime information. These filesystems aren't present on disk and instead the kernel implements them as a [[Callback (computer programming)|callback]] or routine which gets called when they are accessed by userspace.
=== Supported architectures ===
{{See also|List of Linux-supported computer architectures|Linux-powered device}}
[[File:Series 2 tivo front.jpg|thumb|right|upright=1.1|[[TiVo]] [[digital video recorder|DVR]], a consumer device running Linux]]
While not originally designed to be [[porting|portable]],<ref name="Torvlads25Aug91" /><ref name="opensources">{{cite book |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=January 1999 |title=Open Sources: Voices from the Open Source Revolution |chapter-url=https://archive.org/details/isbn_9781565925823 |publisher=[[O'Reilly Media|O'Reilly]] |chapter=The Linux Edge |isbn=1-56592-582-3 |access-date=13 October 2013}}</ref> Linux is now one of the most widely ported operating system kernels, running on a diverse range of systems from the [[ARM architecture]] to IBM [[z/Architecture]] [[mainframe computer]]s. The first port was performed on the [[Motorola 68000]] platform. The modifications to the kernel were so fundamental that Torvalds viewed the Motorola version as a [[Fork (software)|fork]] and a "Linux-like operating system".<ref name="opensources" /> However, that moved Torvalds to lead a major restructure of the code to facilitate porting to more computing architectures. The first Linux that, in a single source tree, had code for more than i386 alone, supported the [[Digital Equipment Corporation|DEC]] [[Alpha AXP]] 64-bit platform.<ref name="6otKD">{{cite web|url=https://www.linuxjournal.com/article/1178?page=0,1|title=Porting Linux to the DEC Alpha: The Kernel and Shell|access-date=5 October 2019|archive-date=5 September 2019|archive-url=https://web.archive.org/web/20190905215158/https://www.linuxjournal.com/article/1178?page=0,1|url-status=live}}</ref><ref name="Fcl2t">{{cite web|title=Linux on Alpha: A Strategic Choice|url=https://www.linuxjournal.com/article/1150?page=0,0|access-date=5 October 2019|archive-date=4 September 2019|archive-url=https://web.archive.org/web/20190904234429/https://www.linuxjournal.com/article/1150?page=0,0|url-status=live}}</ref><ref name="opensources" />
Linux runs as the main operating system on [[IBM]]'s [[Summit (supercomputer)|Summit]]; {{as of|2019|10|lc=y}}, all of the world's [[TOP500|500 fastest supercomputers]] run some operating system based on the Linux kernel,<ref name="top500stats2"/> a big change from 1998 when the first Linux supercomputer got added to the list.<ref name="HEQsA">{{cite web| url=https://www.top500.org/system/166763| title=Avalon Cluster {{!}} TOP500 Supercomputer Sites| website=Top500.org| access-date=5 October 2019| archive-date=5 October 2019| archive-url=https://web.archive.org/web/20191005210605/https://www.top500.org/system/166763| url-status=live}}</ref>
Linux has also been ported to various handheld devices such as [[Apple Inc.|Apple's]] [[iPhone]] 3G and [[iPod]].<ref name="h7F3D">{{cite web |url=https://www.pcworld.com/article/195789/android_now_running_on_iphone_3g.html |title=Android Now Running On iPhone 3G |last=Wang |first=David |date=6 May 2010 |work=TechHive |publisher=[[International Data Group|IDG]] |access-date=11 July 2010 |archive-date=22 July 2010 |archive-url=https://web.archive.org/web/20100722023655/http://www.pcworld.com/article/195789/android_now_running_on_iphone_3g.html |url-status=live}}</ref>
=== Supported devices ===
In 2007, the LKDDb project has been started to build a comprehensive database of hardware and protocols known by Linux kernels.<ref name="lkddb">{{cite web | url = https://cateee.net/lkddb/ | title = LKDDb | access-date = 26 January 2021 | publisher = LKDDb Project | archive-date = 25 February 2021 | archive-url = https://web.archive.org/web/20210225020934/https://cateee.net/lkddb/ | url-status = live}}</ref> The database is built automatically by static analysis of the kernel sources. Later in 2014, the Linux Hardware project was launched to automatically collect a database of all tested hardware configurations with the help of users of various Linux distributions.<ref name="linuxhw">{{cite web | url = https://linux-hardware.org/ | title = Linux Hardware | access-date = 26 January 2021 | publisher = Linux Hardware Project | archive-date = 26 January 2021 | archive-url = https://web.archive.org/web/20210126054431/https://linux-hardware.org/ | url-status = live}}</ref>
=== Live patching ===
{{update section|date=September 2023|updated=April 2015}}
Rebootless updates can even be applied to the kernel by using [[live patching]] technologies such as [[Ksplice]], [[kpatch]] and [[kGraft]]. Minimalistic foundations for live kernel patching were merged into the Linux kernel mainline in kernel version 4.0, which was released on 12 April 2015. Those foundations, known as ''livepatch'' and based primarily on the kernel's [[ftrace]] functionality, form a common core capable of supporting hot patching by both kGraft and kpatch, by providing an [[application programming interface]] (API) for kernel modules that contain hot patches and an [[application binary interface]] (ABI) for the userspace management utilities. However, the common core included into Linux kernel 4.0 supports only the [[x86]] architecture and does not provide any mechanisms for ensuring [[Function (programming)|function]]-level consistency while the hot patches are applied.
=== Security ===
Kernel bugs present potential security issues. For example, they may allow for [[privilege escalation]] or create [[denial-of-service attack]] vectors. Over the years, numerous bugs affecting system security were found and fixed.<ref name="nBjy6">{{cite book |last1=Mookhey |first1=K. K. |last2=Burghate |first2=Nilesh |date=1 July 2005 |title=Linux: Security, Audit and Control Features |url=https://books.google.com/books?id=-kD0sxQ0EkIC&pg=PA14 |___location=US |publisher=[[ISACA]] |page=14 |isbn=1-893209-78-4 |access-date=31 December 2010 |archive-date=2 June 2013 |archive-url=https://web.archive.org/web/20130602223234/http://books.google.com/books?id=-kD0sxQ0EkIC&pg=PA14 |url-status=live}}</ref> New features are frequently implemented to improve the kernel's security.<ref name="egivN">{{cite book |last=Hatch |first=Brian |date=15 July 2008 |title=Hacking Exposed Linux: Linux Security Secrets and Solutions |url=https://books.google.com/books?id=f5Vz08spzw8C&pg=PA524 |publisher=[[McGraw-Hill Osborne Media]] |page=524 |isbn=978-0-07-226257-5 |access-date=31 December 2010 |archive-date=2 June 2013 |archive-url=https://web.archive.org/web/20130602212901/http://books.google.com/books?id=f5Vz08spzw8C&pg=PA524 |url-status=live}}</ref><ref name="1pEse">{{cite book |last=Jaeger |first=Trent |date=7 October 2008 |title=Operating System Security |url=https://books.google.com/books?id=P4PYPSv8nBMC&pg=PA122 |publisher=Morgan and Claypool Publishers |page=122 |isbn=978-1-59829-212-1 |access-date=31 December 2010 |archive-date=2 June 2013 |archive-url=https://web.archive.org/web/20130602203613/http://books.google.com/books?id=P4PYPSv8nBMC&pg=PA122 |url-status=live}}</ref>
Capabilities(7) have already been introduced in the section about the processes and threads. Android makes use of them and [[systemd]] gives administrators detailed control over the capabilities of processes.<ref name="eVUKg">{{cite web|title=CAP_PERFMON — and new capabilities in general [LWN.net]|url=https://lwn.net/Articles/812719/|access-date=2 August 2020|website=lwn.net|archive-date=4 August 2020|archive-url=https://web.archive.org/web/20200804030704/https://lwn.net/Articles/812719/|url-status=live}}</ref>
Linux offers a wealth of mechanisms to reduce kernel attack surface and improve security which are collectively known as the [[Linux Security Modules]] (LSM).<ref name="Jz6IT">{{cite web|url=https://www.kernel.org/doc/html/latest/admin-guide/LSM/index.html|title=Linux Security Module Usage — The Linux Kernel documentation|website=Kernel.org|access-date=10 January 2020|archive-date=2 May 2020|archive-url=https://web.archive.org/web/20200502142406/https://www.kernel.org/doc/html/latest/admin-guide/LSM/index.html|url-status=live}}</ref> They comprise the [[Security-Enhanced Linux]] (SELinux) module, whose code has been originally developed and then released to the public by the [[National Security Agency|NSA]],<ref name="hPOef">{{cite web|url=https://www.nsa.gov/What-We-Do/Research/SELinux/FAQs/|title=National Security Agency {{!}} Central Security Service > What We Do > Research > SE Linux > SE Linux FAQs|website=Nsa.gov|access-date=10 January 2020|archive-date=18 September 2019|archive-url=https://web.archive.org/web/20190918022139/https://www.nsa.gov/What-We-Do/Research/SELinux/FAQs/|url-status=live}}</ref> and [[AppArmor]]<ref name=":4">{{cite web|url=https://www.kernel.org/doc/html/latest/admin-guide/LSM/apparmor.html|title=AppArmor — The Linux Kernel documentation|website=Kernel.org|access-date=10 January 2020|archive-date=8 May 2020|archive-url=https://web.archive.org/web/20200508080035/https://www.kernel.org/doc/html/latest/admin-guide/LSM/apparmor.html|url-status=live}}</ref> among others. SELinux is now actively developed and maintained on [[GitHub]].<ref name=":3">{{cite web|url=https://github.com/SELinuxProject|title=SELinux Project|website=GitHub|language=en|access-date=10 January 2020|archive-date=12 December 2019|archive-url=https://web.archive.org/web/20191212214729/https://github.com/SELinuxProject|url-status=live}}</ref> SELinux and AppArmor provide support to access control security policies, including [[mandatory access control]] (MAC), though they profoundly differ in complexity and scope.
Another security feature is the Seccomp BPF (SECure COMPuting with Berkeley Packet Filters) which works by filtering parameters and reducing the set of system calls available to user-land applications.<ref name="LXteS">{{cite web|url=https://www.kernel.org/doc/html/latest/userspace-api/seccomp_filter.html|title=Seccomp BPF (SECure COMPuting with filters) — The Linux Kernel documentation|website=Kernel.org|access-date=10 January 2020|archive-date=7 March 2020|archive-url=https://web.archive.org/web/20200307065527/https://www.kernel.org/doc/html/latest/userspace-api/seccomp_filter.html|url-status=live}}</ref>
Critics have accused kernel developers of covering up security flaws, or at least not announcing them; in 2008, Torvalds responded to this with the following:<ref name="YS7OI">{{cite web|url=http://kerneltrap.org/Linux/Security_Bugs_and_Full_Disclosure |title=Security Bugs and Full Disclosure |last=Andrews |first=Jeremy |date=16 July 2008 |publisher=[[KernelTrap]] |access-date=31 December 2010 |archive-url=https://web.archive.org/web/20080719130436/http://kerneltrap.org/Linux/Security_Bugs_and_Full_Disclosure |archive-date=19 July 2008 |url-status=dead}}</ref><ref name="Ps5dB">{{cite mailing list |url=http://seclists.org/fulldisclosure/2008/Jul/276 |title=Linux's unofficial security-through-coverup policy |last=Spengler |first=Brad |date=16 July 2008 |mailing-list=Full Disclosure |access-date=31 December 2010 |archive-date=7 August 2020 |archive-url=https://web.archive.org/web/20200807161645/https://seclists.org/fulldisclosure/2008/Jul/276 |url-status=live}}</ref>
{{blockquote|I personally consider security bugs to be just "normal bugs". I don't cover them up, but I also don't have any reason what-so-ever to think it's a good idea to track them and announce them as something special...one reason I refuse to bother with the whole security circus is that I think it glorifies—and thus encourages—the wrong behavior. It makes "heroes" out of security people, as if the people who don't just fix normal bugs aren't as important. In fact, all the boring normal bugs are ''way'' more important, just because there's[sic] a lot more of them. I don't think some spectacular security hole should be glorified or cared about as being any more "special" than a random spectacular crash due to bad locking.}}
Linux distributions typically release security updates to fix vulnerabilities in the Linux kernel. Many offer [[long-term support]] releases that receive security updates for a certain Linux kernel version for an extended period of time.
== Legal ==
=== Licensing terms ===
Initially, Torvalds released Linux under a license which forbade any commercial use.<ref name="hiroo">{{cite web|url=http://hotwired.goo.ne.jp/matrix/9709/5_linus.html |title=The Pragmatist of Free Software |last=Yamagata |first=Hiroo |date=3 August 1997 |publisher=[[HotWired]] |access-date=21 February 2007 |archive-url=https://web.archive.org/web/20070210224351/http://hotwired.goo.ne.jp/matrix/9709/5_linus.html |archive-date=10 February 2007 |url-status=dead}}</ref> This was changed in version 0.12 by a switch to the [[GNU General Public License]] version 2 (GPLv2).<ref name="Relnotes-0.12" /> This license allows distribution and sale of possibly modified and unmodified versions of Linux but requires that all those copies be released under the same license and be accompanied by - or that, on request, free access is given to - the complete corresponding source code.<ref name="ts0p8">{{cite web|url=https://www.gnu.org/licenses/old-licenses/gpl-2.0.html|title=GPL-v2|website=gnu.org|access-date=28 January 2020|archive-date=25 December 2019|archive-url=https://web.archive.org/web/20191225033729/https://www.gnu.org/licenses/old-licenses/gpl-2.0.html|url-status=live}}</ref> Torvalds has described licensing Linux under the GPLv2 as the "best thing I ever did".<ref name="hiroo" />
The Linux kernel is licensed explicitly under [[GNU General Public License]] version 2 only (GPL-2.0-only) with an explicit syscall exception (Linux-syscall-note),<ref name="COPYING_File" /><ref name="kernel.org GPL-2.0" /><ref name="kernel.org Linux-syscall-note" /> without offering the licensee the option to choose any later version, which is a common GPL extension. Contributed code must be available under [[GPL compatibility|GPL-compatible license]].<ref name="Linux_Licensing" /><ref name=":9" />
There was considerable debate about how easily the license could be changed to use later GPL versions (including version 3), and whether this change is even desirable.<ref name="BahZO">{{cite web |url=https://lwn.net/Articles/169797/ |title=GPLv3 and the kernel |last=Corbet |first=Jonathan |date=31 January 2006 |publisher=[[LWN.net]] |access-date=21 February 2007 |archive-date=10 August 2020 |archive-url=https://web.archive.org/web/20200810165701/https://lwn.net/Articles/169797/ |url-status=live}}</ref> Torvalds himself specifically indicated upon the release of version 2.4.0 that his own code is released only under version 2.<ref name="9g8Ma">{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/0009.1/0096.html |title=Linux-2.4.0-test8 |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=8 September 2000 |mailing-list=[[LKML]] |access-date=21 February 2007 |archive-date=15 May 2020 |archive-url=https://web.archive.org/web/20200515235654/http://lkml.iu.edu/hypermail/linux/kernel/0009.1/0096.html |url-status=live}}</ref> However, the terms of the GPL state that if no version is specified, then any version may be used,<ref name="v5UoJ">{{cite web|url=https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html#section9|title=gnu.org|website=Gnu.org|language=en|access-date=18 October 2017|archive-date=2 February 2021|archive-url=https://web.archive.org/web/20210202151435/https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html#section9|url-status=live}}</ref> and [[Alan Cox (computer programmer)|Alan Cox]] pointed out that very few other Linux contributors had specified a particular version of the GPL.<ref name="au8PE">{{cite mailing list |url=https://lwn.net/Articles/169831/ |title=Re: GPL V3 and Linux |last=Cox |first=Alan |author-link=Alan Cox (computer programmer) |date=20 January 2006 |mailing-list=[[LKML]] |access-date=21 February 2007 |archive-date=26 January 2021 |archive-url=https://web.archive.org/web/20210126131909/https://lwn.net/Articles/169831/ |url-status=live}}</ref>
In September 2006, a survey of 29 key kernel programmers indicated that 28 preferred GPLv2 to the then-current GPLv3 draft. Torvalds commented, "I think a number of outsiders... believed that I personally was just the odd man out because I've been so publicly not a huge fan of the GPLv3."<ref name="seFzU">{{cite web |url=http://news.com/Top+Linux+programmers+pan+GPL+3/2100-7344_3-6119372.html |archive-url=https://archive.today/20130914090740/http://news.com/Top+Linux+programmers+pan+GPL+3/2100-7344_3-6119372.html |url-status=dead |archive-date=14 September 2013 |title=Top Linux programmers pan GPL 3 |date=25 September 2006 |last=Shankland |first=Stephen |work=[[News.com]] |publisher=[[CNET]] |access-date=21 February 2007 }}</ref> This group of high-profile kernel developers, including Torvalds, [[Greg Kroah-Hartman]] and [[Andrew Morton (computer programmer)|Andrew Morton]], commented on mass media about their objections to the GPLv3.<ref name="kerneldevelopers2006" /> They referred to clauses regarding [[Digital rights management|DRM]]/[[tivoization]], patents, "additional restrictions" and warned a [[Balkanization|Balkanisation]] of the "Open Source Universe" by the GPLv3.<ref name="kerneldevelopers2006">{{cite web |url=https://lwn.net/Articles/200422/ |title=Kernel developers' position on GPLv3: The Dangers and Problems with GPLv3 |author1=James E.J. Bottomley |author2=Mauro Carvalho Chehab |author3=Thomas Gleixner |author4=Christoph Hellwig |author5=Dave Jones |author6=Greg Kroah-Hartman |author7=Tony Luck |author8=Andrew Morton |author9=Trond Myklebust |author10=David Woodhouse |date=15 September 2006 |publisher=[[LWN.net]] |access-date=11 March 2015 |archive-date=18 January 2021 |archive-url=https://web.archive.org/web/20210118015213/https://lwn.net/Articles/200422/ |url-status=live}}</ref><ref name="GmA72">{{cite web |url=http://www.linuxjournal.com/node/1000100 |title=A fight against evil or a fight for attention? |date=27 September 2006 |first=Nicholas |last=Petreley |publisher=linuxjournal.com |access-date=11 March 2015 |archive-date=2 March 2018 |archive-url=https://web.archive.org/web/20180302144635/http://www.linuxjournal.com/node/1000100 |url-status=live}}</ref> Torvalds, who decided not to adopt the GPLv3 for the Linux kernel, reiterated his criticism even years later.<ref name="4uolG">{{cite web |url=https://www.youtube.com/watch?v=PaKIZ7gJlRU |title=Linus Torvalds says GPL v3 violates everything that GPLv2 stood for |date=2014 |publisher=[[Debconf]] 2014 |access-date=21 March 2018 |archive-date=8 May 2018 |archive-url=https://web.archive.org/web/20180508034417/https://www.youtube.com/watch?v=PaKIZ7gJlRU |url-status=live}}</ref>
=== Loadable kernel modules ===
It is debated whether some [[loadable kernel module]]s (LKMs) are to be considered [[derivative work]]s under copyright law, and thereby whether or not they fall under the terms of the GPL.
In accordance with the license rules, LKMs using only a public subset of the kernel interfaces<ref name=":6" /><ref name=":7" /> are non-derived works, thus Linux gives system administrators the mechanisms to load out-of-tree binary objects into the kernel address space.<ref name="Linux_Licensing" />
There are some out-of-tree loadable modules that make legitimate use of the ''dma_buf'' kernel feature.<ref name="lkXX9">{{cite web |url=http://elinux.org/images/a/a8/DMA_Buffer_Sharing-_An_Introduction.pdf |title=DMA Buffer Sharing Framework: An Introduction |last1=Clark |first1=Rob |last2=Semwal |first2=Sumit |date=1 November 2012 |publisher=Embedded Linux Conference |access-date=2 August 2014 |archive-date=8 August 2014 |archive-url=https://web.archive.org/web/20140808051804/http://elinux.org/images/a/a8/DMA_Buffer_Sharing-_An_Introduction.pdf |url-status=live}}</ref> GPL compliant code can certainly use it. However, a different possible use case would be [[Nvidia Optimus]] that pairs a fast GPU with an Intel integrated GPU, where the Nvidia GPU writes into the [[Intel]] framebuffer when it is active. But, Nvidia cannot use this infrastructure because it necessitates bypassing a rule that can only be used by LKMs that are also GPL.<ref name=":8" /> [[Alan Cox (computer programmer)|Alan Cox]] replied on [[Linux kernel mailing list|LKML]], rejecting a request from one of Nvidia's engineers to remove this technical enforcement from the API.<ref name="1aNop">{{cite mailing list |url=http://lists.freedesktop.org/archives/dri-devel/2012-October/028846.html |title=[PATCH] dma-buf: Use EXPORT_SYMBOL |last=Cox |first=Alan |author-link=Alan Cox (computer programmer) |date=10 October 2012 |mailing-list=[[Direct Rendering Infrastructure]] |access-date=3 September 2013 |archive-date=22 January 2013 |archive-url=https://web.archive.org/web/20130122222858/http://lists.freedesktop.org/archives/dri-devel/2012-October/028846.html |url-status=live}}</ref> Torvalds clearly stated on the LKML that "[I] claim that binary-only kernel modules ARE derivative "by default"'".<ref name="3OFDI">{{cite mailing list |url=https://lkml.org/lkml/2003/12/10/123 |title=RE: Linux GPL and binary module exception clause? |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=10 December 2003 |mailing-list=[[LKML]] |access-date=31 December 2010 |archive-date=15 June 2011 |archive-url=https://web.archive.org/web/20110615102501/http://lkml.org/lkml/2003/12/10/123 |url-status=live}}</ref>
On the other hand, Torvalds has also said that "[one] gray area in particular is something like a driver that was originally written for another operating system (i.e., clearly not a derived work of Linux in origin). THAT is a gray area, and _that_ is the area where I personally believe that some modules may be considered to not be derived works simply because they weren't designed for Linux and don't depend on any special Linux behaviour".<ref name="H8s4M">{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/0312.0/0670.html |title=Re: Linux GPL and binary module exception clause? |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=3 December 2003 |mailing-list=[[LKML]] |access-date=12 November 2010 |archive-date=28 April 2020 |archive-url=https://web.archive.org/web/20200428052533/http://lkml.iu.edu/hypermail/linux/kernel/0312.0/0670.html |url-status=live}}</ref> [[proprietary software|Proprietary]] graphics drivers, in particular, are heavily discussed.
Whenever proprietary modules are loaded into Linux, the kernel marks itself as being "tainted",<ref name="BvXbe">{{cite web|url=https://www.kernel.org/doc/html/latest/admin-guide/tainted-kernels.html|title=Tainted kernels — The Linux Kernel documentation|website=Kernel.org|access-date=13 January 2020|archive-date=7 March 2020|archive-url=https://web.archive.org/web/20200307065211/https://www.kernel.org/doc/html/latest/admin-guide/tainted-kernels.html|url-status=live}}</ref> and therefore bug reports from tainted kernels will often be ignored by developers.
=== Firmware binary blobs ===
The official kernel, that is, Torvalds's git branch at the kernel.org repository, contains [[binary blob]]s released under the terms of the GNU GPLv2 license.<ref name="COPYING_File" /><ref name="Linux_Licensing" /> Linux can also load binary blobs, proprietary firmware, drivers, or other executable modules from the filesystem, and link them into kernel space.<ref name="rjGNf">{{cite web|url=https://www.kernel.org/doc/html/latest/driver-api/firmware/index.html|title=Linux Firmware API — The Linux Kernel documentation|website=Kernel.org|access-date=13 January 2020|archive-date=13 January 2020|archive-url=https://web.archive.org/web/20200113174720/https://www.kernel.org/doc/html/latest/driver-api/firmware/index.html|url-status=live}}</ref>
When necessary (e.g., for accessing boot devices or for speed), firmware can be built-in to the kernel, meaning building the firmware into [[vmlinux]]; however, this is not always a viable option for technical or legal issues (e.g., it is not permitted to do this with firmware that is not GPL compatible, although this is quite common nonetheless).<ref name="AEsBH">{{cite web|title=Built-in firmware — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/v4.16/driver-api/firmware/built-in-fw.html|access-date=10 June 2020|website=Kernel.org|archive-date=10 June 2020|archive-url=https://web.archive.org/web/20200610041327/https://www.kernel.org/doc/html/v4.16/driver-api/firmware/built-in-fw.html|url-status=live}}</ref>
=== Trademark ===
Linux is a registered [[trademark]] of Linus Torvalds in the United States, the European Union, and some other countries.<ref name="Vaz3B">{{cite web|url=http://tmsearch.uspto.gov/bin/showfield?f=doc&state=4808:r0ouik.2.17|title=Linux TM registration in the US|website=uspto.gov|access-date=6 September 2019|archive-date=24 February 2021|archive-url=https://web.archive.org/web/20210224164104/http://tmsearch.uspto.gov/bin/showfield?f=doc&state=4808:r0ouik.2.17|url-status=live}}</ref><ref name="ID7gn">{{cite web|url=https://euipo.europa.eu/eSearch/#details/trademarks/000851246|title=Linux TM registration in the EU|website=euipo.europa.eu|access-date=28 November 2020|archive-date=9 June 2016|archive-url=https://web.archive.org/web/20160609153529/https://euipo.europa.eu/eSearch/#details/trademarks/000851246|url-status=live}}</ref> A legal battle over the trademark began in 1996, when William Della Croce, a lawyer who was never involved in the development of Linux, started requesting licensing fees for the use of the word ''Linux''. After it was proven that the word was in common use long before Della Croce's claimed first use, the trademark was awarded to Torvalds.<ref name="dtKCp">{{cite web|url=http://www.linuxjournal.com/article/2425/|title=Linux Trademark Dispute|last=Hughes|first=Phil|date=1 August 1997|work=[[Linux Journal]]|publisher=Belltown Media, Inc.|access-date=8 December 2010|archive-date=30 April 2010|archive-url=https://web.archive.org/web/20100430060209/http://www.linuxjournal.com/article/2425|url-status=live}}</ref><ref name="ZWQ58">{{cite web|url=http://www.linuxjournal.com/article/2098|title=Action Taken on Linux Trademark|last=Hughes|first=Phil|date=1 March 1997|work=[[Linux Journal]]|publisher=Belltown Media, Inc.|access-date=8 December 2010|archive-date=3 March 2010|archive-url=https://web.archive.org/web/20100303180921/http://www.linuxjournal.com/article/2098|url-status=live}}</ref><ref name="05hM3">{{cite web|url=http://www.gisselberglawfirm.com/downloads/linux.pdf|title=The Trademark History of Linux, the Operating System|last=Gisselberg|first=Tonya|date=2010|publisher=Gisselberg Law Firm, Inc.|access-date=8 December 2010|archive-url=https://web.archive.org/web/20110711095344/http://www.gisselberglawfirm.com/downloads/linux.pdf |archive-date=11 July 2011 |url-status=dead}}</ref>
=== Removal of Russian maintainers ===
In October 2024, during the [[Russian invasion of Ukraine]], kernel developer [[Greg Kroah-Hartman]] removed some kernel developers whose email addresses suggested a connection to Russia from their roles as maintainers.<ref>{{ cite mailing list |last= Kroah-Hartman |first= Greg |date= |title=[PATCH] MAINTAINERS: Remove some entries due to various compliance requirements. |url=https://lore.kernel.org/all/2024101835-tiptop-blip-09ed@gregkh/ |mailing-list= [[Linux kernel mailing list]] |access-date= 11 August 2025 |author-link=Greg_Kroah-Hartman |language=en }}</ref><ref>{{cite web |last1=Purdy |first1=Kevin |title=Removal of Russian coders spurs debate about Linux kernel's politics |url=https://arstechnica.com/information-technology/2024/10/russian-coders-removed-from-linux-maintainers-list-due-to-sanction-concerns/ |website=Ars Technica |access-date=18 November 2024 |date=24 October 2024}}</ref> [[Linus Torvalds]] responded that he did not support Russian aggression and would not revert the patch, insinuating that opponents of the patch were [[Russian web brigades|Russian trolls]].<ref>{{ cite mailing list |last= Torvalds |first= Linus |date= 23 October 2024 |title=Re: [PATCH] Revert "MAINTAINERS: Remove some entries due to various compliance requirements." |url= https://lore.kernel.org/all/CAHk-=whNGNVnYHHSXUAsWds_MoZ-iEgRMQMxZZ0z-jY4uHT+Gg@mail.gmail.com/ |mailing-list= [[Linux kernel mailing list]] |access-date= 11 August 2025 |author-link=Linus_Torvalds |language=en }}</ref> James Bottomley, a kernel developer, issued an apology for the handling of the situation and clarified that the action was a consequence of [[International sanctions during the Russian invasion of Ukraine|U.S. sanctions against Russia]].<ref>{{ cite mailing list |last= Bottomley |first= James |date= 24 October 2024 |title=Re: linux: Goodbye from a Linux community volunteer |url=https://lkml.org/lkml/2024/10/24/1118 |mailing-list= [[Linux kernel mailing list]] |access-date= 11 August 2025 |language=en }}</ref>
== See also ==
{{Portal|Linux|Free and open-source software}}
* {{Annotated link|Linux}}
* {{Annotated link|Linux kernel version history}}
* {{Annotated link|Comparison of operating systems}}
* {{Annotated link|Comparison of operating system kernels}}
* {{Annotated link|Microkernel}}
* {{Annotated link|Minix 3}}
* {{Annotated link|macOS}}
* {{Annotated link|Microsoft Windows}}
== Notes ==
{{notelist}}
== References ==
{{reflist}}
== Further reading ==
{{Refbegin|40em}}
<!-- The following are to be merged into the article. Please use <ref> tags as appropriate and then remove from this list. If the link doesn't contain anything referenced from the article, just remove it. -->
* {{cite book|last1=Torvalds|first1=Linus|last2=Diamond|first2=David|year=2001|title=Just for Fun: The Story of an Accidental Revolutionary|publisher=[[HarperBusiness]]|isbn=978-0066620732|title-link=Just for Fun (book)}}
* {{cite book|last=Bezroukov|first=Nikolai|chapter-url=http://www.softpanorama.org/People/Torvalds/index.shtml|title=Portraits of Open Source Pioneers|chapter=Ch 4: A benevolent dictator|publisher=Softpanorama|type=e-book|access-date=3 October 2005|archive-date=13 October 2005|archive-url=https://web.archive.org/web/20051013082354/http://www.softpanorama.org/People/Torvalds/index.shtml|url-status=live}}
* {{cite web|url=https://lwn.net/Articles/53780/|title=LinkSys and binary modules|publisher=LWN.net Weekly Edition|date=16 October 2003|access-date=21 July 2016|archive-date=1 August 2016|archive-url=https://web.archive.org/web/20160801080742/http://lwn.net/Articles/53780/|url-status=live}}
* {{cite web|url=http://www.nd.edu/~ljordan/linux/tuxhistory.html|title=Everyone's Favorite Linux Mascot|access-date=16 June 2005|archive-date=16 August 2005|archive-url=https://web.archive.org/web/20050816235544/http://www.nd.edu/~ljordan/linux/tuxhistory.html|url-status=live}}
* {{cite web|url=http://kniggit.net/wwol26.html|archive-url=https://web.archive.org/web/20030716054145/http://www.kniggit.net/wwol26.html|url-status=dead|archive-date=16 July 2003|title=The Wonderful World of Linux 2.6|last=Pranevich|first=Joseph|date=December 2003}}
* {{cite web|url=http://wiki.kernelnewbies.org/LinuxChanges|title=LinuxChanges|access-date=31 October 2005|archive-date=31 October 2005|archive-url=https://web.archive.org/web/20051031211753/http://wiki.kernelnewbies.org/LinuxChanges|url-status=live}}
* {{cite web|url=https://engineeringproject.net/seminars/linux.htm|title=Seminar Paper on Linux Kernel 2.6|url-status=dead|archive-url=https://web.archive.org/web/20070202002917/http://www.engineeringproject.net/seminars/linux.htm|archive-date=2 February 2007}}
* {{cite web|url=https://lwn.net/Kernel/LDD3/|title=Linux Device Drivers|edition=3rd|access-date=21 July 2016|archive-date=27 July 2016|archive-url=https://web.archive.org/web/20160727085953/http://lwn.net/Kernel/LDD3/|url-status=live}}
* {{cite web|url=https://www.oreilly.com/catalog/understandlk/|title=Understanding the Linux Kernel|edition=3rd|type=Book|access-date=22 December 2005|archive-date=17 December 2005|archive-url=https://web.archive.org/web/20051217094234/http://www.oreilly.com/catalog/understandlk/|url-status=live}}
* {{cite book |last=Rosen |first=Rami |title=Linux Kernel Networking |publisher=Apress |publication-place=Berkeley, CA |date=2014 |isbn=978-1-4302-6196-4 |doi=10.1007/978-1-4302-6197-1 |doi-access=free |url=https://link.springer.com/content/pdf/bfm%3A978-1-4302-6197-1%2F1.pdf |access-date=10 August 2025}}
* {{cite web|url=https://kerneltrap.org/node/1735|title=Linux: The GPL And Binary Modules|url-status=dead|archive-url=https://web.archive.org/web/20050723031159/http://kerneltrap.org/node/1735|archive-date=23 July 2005}}
* {{cite web|url=https://www.ibm.com/developerworks/linux/library/l-linux-kernel/|title=Anatomy of the Linux kernel| website=[[IBM]] |access-date=9 June 2007|archive-date=27 June 2007|archive-url=https://web.archive.org/web/20070627093507/http://www.ibm.com/developerworks/linux/library/l-linux-kernel/|url-status=live}}
* {{Cite book|last1=Tanenbaum|first1=Andrew|title=Modern Operating Systems|last2=Bos|first2=Herbert|publisher=Pearson|year=2015|isbn=9781292061429|___location=United States of America|page=722|oclc=892574803}}
{{Refend}}
== External links ==
{{Commons}}
{{Wikibooks}}
* {{Official website}}
** [//kernel.org/doc/ Linux kernel documentation index]
** [//kernel.org/doc/man-pages/ Linux kernel man pages]
** [https://bugzilla.kernel.org/ Kernel bugzilla], and [https://bugzilla.kernel.org/show_bug.cgi?id=15790 regressions] for each recent kernel version
* [https://kernelnewbies.org/ Kernel Newbies], a source of various kernel-related information
* [https://lwn.net/Kernel/ Kernel coverage at LWN.net], an authoritative source of kernel-related information
* [https://elixir.bootlin.com/linux/latest/source Bootlin's Elixir Cross Referencer], a Linux kernel source code cross-reference
* {{YouTube|L2SED6sewRw|Greg Kroah Hartman on the Linux kernel}}
* [https://www.geeksforgeeks.org/virtual-file-system Virtual filesystem], linux generic filesystem implementation
{{Linux kernel}}
{{Linux}}
{{Mobile operating systems}}
{{Routing software}}
{{Linux people}}
{{DEFAULTSORT:Linux Kernel}}
[[Category:Linux kernel| ]]
[[Category:Finnish inventions]]
[[Category:Free and open-source software]]
[[Category:Free software programmed in C]]
[[Category:Free system software]]
[[Category:Linus Torvalds]]
[[Category:Monolithic kernels]]
[[Category:Operating systems]]
[[Category:Software using the GNU General Public License]]
[[Category:Unix variants]]
|