Documentation/process/submitting-patches.rst.
The kernel development process happens entirely over email, on public mailing lists, using plain-text patches. There are no pull requests or web-based code review tools in the mainline workflow.
Obtain a current source tree
Start from the mainline repository or from the subsystem maintainer’s tree:MAINTAINERS file for the T: entry for your subsystem to find the right tree.
Describe your changes
Every patch needs a clear, well-written commit message. The message must stand on its own — do not expect reviewers to look up previous versions or linked URLs.Describe the problem
Explain what is wrong and why it matters. Crashes and lockups are obvious, but subtler bugs need context. Describe user-visible impact, including excerpts from dmesg, performance regressions, lockup scenarios, or call traces.
Describe your solution
Once the problem is established, explain what you are doing about it in technical detail. Write in imperative mood: “make xyzzy do frotz” — not “[This patch] makes xyzzy do frotz”.
Quantify trade-offs
If you claim performance improvements, include numbers. Describe non-obvious costs. Optimizations trade CPU, memory, or readability.
Commit message format
Fixes: tag format:
Separate your changes
Each logical change must be in its own patch. Do not mix bug fixes, performance improvements, and refactoring in a single commit.One logical change per patch
If your changes include both a bug fix and a performance enhancement for a single driver, split them into separate patches. If you update an API and add a driver using it, those are two patches.
Single change across many files
A single logical change that touches many files belongs in a single patch. For example, a rename across the tree is one patch.
Kernel must build after each patch
Each patch in a series must leave the kernel in a buildable, bootable state. Developers use
git bisect and will blame you if a mid-series patch breaks the build.Limit series size
Post no more than ~15 patches at a time. Wait for review and integration before sending more.
Style-check your changes
Check for style violations before submitting:ERROR— very likely to be wrongWARNING— requires careful reviewCHECK— requires thought
Find the right recipients
Using the correct maintainers and mailing lists is essential.get_maintainer.pl automates this:
MAINTAINERS and the git log to identify:
- File maintainers (
M:entries) - Reviewers (
R:entries) - Mailing lists (
L:entries) - Subsystem trees (
T:entries)
[email protected] instead of public lists.
For fixes to released kernels, add to the sign-off area (not as an email recipient):
The Developer’s Certificate of Origin
Every patch must include aSigned-off-by: line. This certifies your agreement with the Developer’s Certificate of Origin (DCO 1.1):
By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution is maintained indefinitely.
Other tags
| Tag | Meaning |
|---|---|
Reviewed-by: | Reviewer carried out a technical review and finds it acceptable |
Acked-by: | Maintainer/stakeholder accepts the patch without thorough review |
Tested-by: | Person has successfully tested the patch in some environment |
Reported-by: | Credits the person who found and reported the bug |
Suggested-by: | Credits the person who suggested the approach |
Co-developed-by: | Multiple co-authors; must be followed immediately by a Signed-off-by: |
Fixes: | Identifies the commit that introduced the bug |
Closes: | Links to a bug report; some trackers auto-close on merge |
The git send-email workflow
Patches must be submitted as plain-text inline in email — no MIME attachments, no compression.Edit the cover letter
Open
outgoing/0000-cover-letter.patch. Replace the *** SUBJECT HERE *** and *** BLURB HERE *** placeholders with:- A summary subject line
- An overview of the series, the problem being solved, and any context reviewers need
- Links to previous versions (from lore.kernel.org)
Patch subject format
RESEND only when reposting a patch unchanged. Use v2, v3, etc. when you have made changes. The summary phrase must be 70–75 characters maximum and appear in the permanent git log.
Responding to review comments
Ignoring reviewers is the fastest path to having your work ignored in return.Reply to all comments
Use interleaved (inline) replies, not top-posting. Quote the specific part you are addressing. Thank reviewers for their time — review is exhausting work.
Document your decisions
Comments that don’t lead to code changes should result in a comment or changelog entry so the next reviewer understands the rationale.
Add a patch changelog
Put the changelog between
--- and the diffstat. It is stripped when the patch is applied and does not pollute the git log.CC commenters on v2
Add everyone who commented on the previous version to the CC list of your revised submission.
Version changelog format
Submission checklist
Before sending, verify:Code review
Code review
- Every
#includeis for a header you directly use scripts/checkpatch.pl --strictpasses or violations are justified- All memory barriers have comments explaining their purpose
- No new
BUG()orBUG_ON()calls
Kconfig
Kconfig
- New
CONFIGoptions default to off - All new Kconfig options have help text
- Tested with relevant
CONFIG_options enabled and disabled
Documentation
Documentation
- Global kernel APIs have kernel-doc comments
- New
/procentries are documented underDocumentation/ - New module parameters have
MODULE_PARM_DESC() - New ABI is documented in
Documentation/ABI/
Build testing
Build testing
- Builds with
CONFIG_=y,=m, and=n - Passes
allnoconfigandallmodconfig - No GCC warnings with
make KCFLAGS=-W - Tested on multiple architectures if touching arch-sensitive code
Runtime testing
Runtime testing
- Tested with
CONFIG_PREEMPT,CONFIG_DEBUG_PREEMPT,CONFIG_SLUB_DEBUG,CONFIG_DEBUG_PAGEALLOC, and lockdep all enabled simultaneously - Tested with and without
CONFIG_SMP - Tested against linux-next
Patience and persistence
Expect a wait of 2–3 weeks before receiving comments. During merge windows, wait longer. Do not ping after less than one week. If you receive no response after a few weeks, you may resubmit withRESEND in the subject. After substantial time with no response, consider reaching out to the maintainer directly or to their backup (often Andrew Morton, [email protected]).