torvalds/linux
How to contribute
The Linux kernel does not accept GitHub pull requests. The torvalds/linux repository on GitHub is a mirror; the canonical tree is on git.kernel.org, and the canonical patch flow is email to mailing lists. This page describes the model. The authoritative source is Documentation/process/.
If you have read GitHub-style "fork, push, PR" guides for other projects, almost none of that applies here. Read this page first.
Mental model
graph LR
DEV[Developer] -->|"git format-patch"| PATCH[Patch series]
PATCH -->|"git send-email"| LIST[Subsystem list + maintainer]
LIST -->|review, Reviewed-by, Tested-by| MAINT[Maintainer]
MAINT -->|applies to subsystem tree| SUBTREE[linux-foo.git]
SUBTREE -->|"pull request to Linus during merge window"| TORVALDS[Linus' tree]
TORVALDS -->|tagged releases| STABLE[Stable trees]There are hundreds of subsystem trees. Each subsystem tree feeds into Linus's tree during the two-week merge window that opens immediately after each release. After the merge window, 6–8 weekly -rc releases stabilize the tree. Then a new release is tagged and the cycle repeats.
The minimum viable workflow
- Find the subsystem. Run
scripts/get_maintainer.plagainst the file you are touching:
It returns the maintainer(s) and the relevant mailing list. Cc all of them../scripts/get_maintainer.pl path/to/file.c - Read the in-tree docs.
Documentation/process/submitting-patches.rstis the canonical reference.Documentation/process/coding-style.rstis required reading. - Make focused, well-described changes. One change per patch. The commit message describes why. The first line is a short summary prefixed by subsystem (e.g.
mm/slub: fix accounting on cgroup migration). - Run
scripts/checkpatch.plon each patch. Fix every error and most warnings. This is a hard gate in many subsystems. - Add
Signed-off-by:on every patch. This is your assertion of the Developer Certificate of Origin (Documentation/process/submitting-patches.rst§ DCO). - Send by email with
git send-email. Inline patch (no attachments). Plain text only. No HTML. - Iterate. Reviewers reply with comments. Revise the series, post a v2/v3 with a changelog at the bottom of the cover letter.
- The maintainer applies it to their tree when they are satisfied. You do not merge it yourself.
Sub-pages
- Development workflow — branches,
git format-patch,git send-email, cover letters, versions. - Testing —
kselftest, KUnit,lockdep, KASAN, syzkaller. - Debugging — printk, ftrace, kgdb,
dmesg, common errors. - Patterns and conventions — coding style, error handling, locking conventions.
- Tooling — checkpatch, sparse, smatch, coccinelle, get_maintainer, dt-validate.
What "merging" means here
Every contribution goes through some maintainer's tree first. Even Linus's tree itself is the merging of maintainer trees during the merge window. There is no equivalent of a single "main" branch that everyone pushes to.
If your patch sits in a subsystem tree (often called linux-<area>.git, e.g. linux-mm, linux-fs, linux-block, net-next), it will appear in the next merge window. Until that point, it lives in linux-next (an aggregator tree that is rebuilt nightly from many subsystem trees). linux-next is what catches cross-subsystem build breakages.
Code of Conduct
The kernel has an enforced Code of Conduct (Documentation/process/code-of-conduct.rst). The community has visibly improved its review tone over the last several years; abusive review is no longer tolerated.
License
All contributions are GPL-2.0-only by default. Some files may also be available under additional licenses (e.g. dual MIT/GPL); check the SPDX-License-Identifier line on the file you are touching.
When you are stuck
- The mailing list archive is the documentation.
lore.kernel.orgindexes every list and is searchable. #kernelnewbiesonirc.oftc.netis a low-pressure place to ask procedural questions.MAINTAINERStells you not just who, but which list. Read the section header for the subsystem you are touching.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.