summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-19 07:07:36 -0400
committerJonathan Corbet <corbet@lwn.net>2016-09-20 20:30:43 -0400
commitf7c9fe4b1cd144f7afc1712bb25141c55c406e1b (patch)
treead56ecfa99ef9abe7dd84744cf7dc3770bf1d087
parent1414f0488803d8963b5868b1512515c997b54571 (diff)
doc: development-process: convert it to ReST markup
This document is on good shape for ReST: all it was needed was to fix the section markups, add a toctree, convert the tables and add a few code/quote blocks. While not strictly required, I opted to use lowercase for the titles, just like the other books that were converted to Sphinx. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--Documentation/development-process/1.Intro68
-rw-r--r--Documentation/development-process/2.Process41
-rw-r--r--Documentation/development-process/3.Early-stage22
-rw-r--r--Documentation/development-process/4.Coding46
-rw-r--r--Documentation/development-process/5.Posting26
-rw-r--r--Documentation/development-process/6.Followthrough14
-rw-r--r--Documentation/development-process/7.AdvancedTopics13
-rw-r--r--Documentation/development-process/8.Conclusion8
-rw-r--r--Documentation/development-process/development-process.rst27
9 files changed, 179 insertions, 86 deletions
diff --git a/Documentation/development-process/1.Intro b/Documentation/development-process/1.Intro
index 9b614480aa84..22642b3fe903 100644
--- a/Documentation/development-process/1.Intro
+++ b/Documentation/development-process/1.Intro
@@ -1,16 +1,8 @@
11: A GUIDE TO THE KERNEL DEVELOPMENT PROCESS 1Introdution
2===========
2 3
3The purpose of this document is to help developers (and their managers) 4Executive summary
4work with the development community with a minimum of frustration. It is 5-----------------
5an attempt to document how this community works in a way which is
6accessible to those who are not intimately familiar with Linux kernel
7development (or, indeed, free software development in general). While
8there is some technical material here, this is very much a process-oriented
9discussion which does not require a deep knowledge of kernel programming to
10understand.
11
12
131.1: EXECUTIVE SUMMARY
14 6
15The rest of this section covers the scope of the kernel development process 7The rest of this section covers the scope of the kernel development process
16and the kinds of frustrations that developers and their employers can 8and the kinds of frustrations that developers and their employers can
@@ -20,41 +12,41 @@ availability to users, community support in many forms, and the ability to
20influence the direction of kernel development. Code contributed to the 12influence the direction of kernel development. Code contributed to the
21Linux kernel must be made available under a GPL-compatible license. 13Linux kernel must be made available under a GPL-compatible license.
22 14
23Section 2 introduces the development process, the kernel release cycle, and 15:ref:`development_process` introduces the development process, the kernel
24the mechanics of the merge window. The various phases in the patch 16release cycle, and the mechanics of the merge window. The various phases in
25development, review, and merging cycle are covered. There is some 17the patch development, review, and merging cycle are covered. There is some
26discussion of tools and mailing lists. Developers wanting to get started 18discussion of tools and mailing lists. Developers wanting to get started
27with kernel development are encouraged to track down and fix bugs as an 19with kernel development are encouraged to track down and fix bugs as an
28initial exercise. 20initial exercise.
29 21
30Section 3 covers early-stage project planning, with an emphasis on 22:ref:`development_early_stage` covers early-stage project planning, with an
31involving the development community as soon as possible. 23emphasis on involving the development community as soon as possible.
32 24
33Section 4 is about the coding process; several pitfalls which have been 25:ref:`development_coding` is about the coding process; several pitfalls which
34encountered by other developers are discussed. Some requirements for 26have been encountered by other developers are discussed. Some requirements for
35patches are covered, and there is an introduction to some of the tools 27patches are covered, and there is an introduction to some of the tools
36which can help to ensure that kernel patches are correct. 28which can help to ensure that kernel patches are correct.
37 29
38Section 5 talks about the process of posting patches for review. To be 30:ref:`development_posting` talks about the process of posting patches for
39taken seriously by the development community, patches must be properly 31review. To be taken seriously by the development community, patches must be
40formatted and described, and they must be sent to the right place. 32properly formatted and described, and they must be sent to the right place.
41Following the advice in this section should help to ensure the best 33Following the advice in this section should help to ensure the best
42possible reception for your work. 34possible reception for your work.
43 35
44Section 6 covers what happens after posting patches; the job is far from 36:ref:`development_followthrough` covers what happens after posting patches; the
45done at that point. Working with reviewers is a crucial part of the 37job is far from done at that point. Working with reviewers is a crucial part
46development process; this section offers a number of tips on how to avoid 38of the development process; this section offers a number of tips on how to
47problems at this important stage. Developers are cautioned against 39avoid problems at this important stage. Developers are cautioned against
48assuming that the job is done when a patch is merged into the mainline. 40assuming that the job is done when a patch is merged into the mainline.
49 41
50Section 7 introduces a couple of "advanced" topics: managing patches with 42:ref:`development_advancedtopics` introduces a couple of "advanced" topics:
51git and reviewing patches posted by others. 43managing patches with git and reviewing patches posted by others.
52
53Section 8 concludes the document with pointers to sources for more
54information on kernel development.
55 44
45:ref:`development_conclusion` concludes the document with pointers to sources
46for more information on kernel development.
56 47
571.2: WHAT THIS DOCUMENT IS ABOUT 48What this document is about
49---------------------------
58 50
59The Linux kernel, at over 8 million lines of code and well over 1000 51The Linux kernel, at over 8 million lines of code and well over 1000
60contributors to each release, is one of the largest and most active free 52contributors to each release, is one of the largest and most active free
@@ -108,8 +100,8 @@ community is always in need of developers who will help to make the kernel
108better; the following text should help you - or those who work for you - 100better; the following text should help you - or those who work for you -
109join our community. 101join our community.
110 102
111 103Credits
1121.3: CREDITS 104-------
113 105
114This document was written by Jonathan Corbet, corbet@lwn.net. It has been 106This document was written by Jonathan Corbet, corbet@lwn.net. It has been
115improved by comments from Johannes Berg, James Berry, Alex Chiang, Roland 107improved by comments from Johannes Berg, James Berry, Alex Chiang, Roland
@@ -120,8 +112,8 @@ Jochen Voß.
120This work was supported by the Linux Foundation; thanks especially to 112This work was supported by the Linux Foundation; thanks especially to
121Amanda McPherson, who saw the value of this effort and made it all happen. 113Amanda McPherson, who saw the value of this effort and made it all happen.
122 114
123 115The importance of getting code into the mainline
1241.4: THE IMPORTANCE OF GETTING CODE INTO THE MAINLINE 116------------------------------------------------
125 117
126Some companies and developers occasionally wonder why they should bother 118Some companies and developers occasionally wonder why they should bother
127learning how to work with the kernel community and get their code into the 119learning how to work with the kernel community and get their code into the
@@ -233,8 +225,8 @@ commercial life, after which a new version must be released. At that
233point, vendors whose code is in the mainline and well maintained will be 225point, vendors whose code is in the mainline and well maintained will be
234much better positioned to get the new product ready for market quickly. 226much better positioned to get the new product ready for market quickly.
235 227
236 228Licensing
2371.5: LICENSING 229---------
238 230
239Code is contributed to the Linux kernel under a number of licenses, but all 231Code is contributed to the Linux kernel under a number of licenses, but all
240code must be compatible with version 2 of the GNU General Public License 232code must be compatible with version 2 of the GNU General Public License
diff --git a/Documentation/development-process/2.Process b/Documentation/development-process/2.Process
index c24e156a6118..ce5561bb3f8e 100644
--- a/Documentation/development-process/2.Process
+++ b/Documentation/development-process/2.Process
@@ -1,4 +1,7 @@
12: HOW THE DEVELOPMENT PROCESS WORKS 1.. _development_process:
2
3How the development process works
4=================================
2 5
3Linux kernel development in the early 1990's was a pretty loose affair, 6Linux kernel development in the early 1990's was a pretty loose affair,
4with relatively small numbers of users and developers involved. With a 7with relatively small numbers of users and developers involved. With a
@@ -7,19 +10,21 @@ course of one year, the kernel has since had to evolve a number of
7processes to keep development happening smoothly. A solid understanding of 10processes to keep development happening smoothly. A solid understanding of
8how the process works is required in order to be an effective part of it. 11how the process works is required in order to be an effective part of it.
9 12
10 13The big picture
112.1: THE BIG PICTURE 14---------------
12 15
13The kernel developers use a loosely time-based release process, with a new 16The kernel developers use a loosely time-based release process, with a new
14major kernel release happening every two or three months. The recent 17major kernel release happening every two or three months. The recent
15release history looks like this: 18release history looks like this:
16 19
20 ====== =================
17 2.6.38 March 14, 2011 21 2.6.38 March 14, 2011
18 2.6.37 January 4, 2011 22 2.6.37 January 4, 2011
19 2.6.36 October 20, 2010 23 2.6.36 October 20, 2010
20 2.6.35 August 1, 2010 24 2.6.35 August 1, 2010
21 2.6.34 May 15, 2010 25 2.6.34 May 15, 2010
22 2.6.33 February 24, 2010 26 2.6.33 February 24, 2010
27 ====== =================
23 28
24Every 2.6.x release is a major kernel release with new features, internal 29Every 2.6.x release is a major kernel release with new features, internal
25API changes, and more. A typical 2.6 release can contain nearly 10,000 30API changes, and more. A typical 2.6 release can contain nearly 10,000
@@ -68,6 +73,7 @@ At that point the whole process starts over again.
68As an example, here is how the 2.6.38 development cycle went (all dates in 73As an example, here is how the 2.6.38 development cycle went (all dates in
692011): 742011):
70 75
76 ============== ===============================
71 January 4 2.6.37 stable release 77 January 4 2.6.37 stable release
72 January 18 2.6.38-rc1, merge window closes 78 January 18 2.6.38-rc1, merge window closes
73 January 21 2.6.38-rc2 79 January 21 2.6.38-rc2
@@ -78,6 +84,7 @@ As an example, here is how the 2.6.38 development cycle went (all dates in
78 March 1 2.6.38-rc7 84 March 1 2.6.38-rc7
79 March 7 2.6.38-rc8 85 March 7 2.6.38-rc8
80 March 14 2.6.38 stable release 86 March 14 2.6.38 stable release
87 ============== ===============================
81 88
82How do the developers decide when to close the development cycle and create 89How do the developers decide when to close the development cycle and create
83the stable release? The most significant metric used is the list of 90the stable release? The most significant metric used is the list of
@@ -105,11 +112,13 @@ next development kernel. Kernels will typically receive stable updates for
105a little more than one development cycle past their initial release. So, 112a little more than one development cycle past their initial release. So,
106for example, the 2.6.36 kernel's history looked like: 113for example, the 2.6.36 kernel's history looked like:
107 114
115 ============== ===============================
108 October 10 2.6.36 stable release 116 October 10 2.6.36 stable release
109 November 22 2.6.36.1 117 November 22 2.6.36.1
110 December 9 2.6.36.2 118 December 9 2.6.36.2
111 January 7 2.6.36.3 119 January 7 2.6.36.3
112 February 17 2.6.36.4 120 February 17 2.6.36.4
121 ============== ===============================
113 122
1142.6.36.4 was the final stable update for the 2.6.36 release. 1232.6.36.4 was the final stable update for the 2.6.36 release.
115 124
@@ -117,9 +126,11 @@ Some kernels are designated "long term" kernels; they will receive support
117for a longer period. As of this writing, the current long term kernels 126for a longer period. As of this writing, the current long term kernels
118and their maintainers are: 127and their maintainers are:
119 128
129 ====== ====================== ===========================
120 2.6.27 Willy Tarreau (Deep-frozen stable kernel) 130 2.6.27 Willy Tarreau (Deep-frozen stable kernel)
121 2.6.32 Greg Kroah-Hartman 131 2.6.32 Greg Kroah-Hartman
122 2.6.35 Andi Kleen (Embedded flag kernel) 132 2.6.35 Andi Kleen (Embedded flag kernel)
133 ====== ====================== ===========================
123 134
124The selection of a kernel for long-term support is purely a matter of a 135The selection of a kernel for long-term support is purely a matter of a
125maintainer having the need and the time to maintain that release. There 136maintainer having the need and the time to maintain that release. There
@@ -127,7 +138,8 @@ are no known plans for long-term support for any specific upcoming
127release. 138release.
128 139
129 140
1302.2: THE LIFECYCLE OF A PATCH 141The lifecycle of a patch
142------------------------
131 143
132Patches do not go directly from the developer's keyboard into the mainline 144Patches do not go directly from the developer's keyboard into the mainline
133kernel. There is, instead, a somewhat involved (if somewhat informal) 145kernel. There is, instead, a somewhat involved (if somewhat informal)
@@ -195,8 +207,8 @@ is to try to cut the process down to a single "merging into the mainline"
195step. This approach invariably leads to frustration for everybody 207step. This approach invariably leads to frustration for everybody
196involved. 208involved.
197 209
198 210How patches get into the Kernel
1992.3: HOW PATCHES GET INTO THE KERNEL 211-------------------------------
200 212
201There is exactly one person who can merge patches into the mainline kernel 213There is exactly one person who can merge patches into the mainline kernel
202repository: Linus Torvalds. But, of the over 9,500 patches which went 214repository: Linus Torvalds. But, of the over 9,500 patches which went
@@ -242,7 +254,8 @@ finding the right maintainer. Sending patches directly to Linus is not
242normally the right way to go. 254normally the right way to go.
243 255
244 256
2452.4: NEXT TREES 257Next trees
258----------
246 259
247The chain of subsystem trees guides the flow of patches into the kernel, 260The chain of subsystem trees guides the flow of patches into the kernel,
248but it also raises an interesting question: what if somebody wants to look 261but it also raises an interesting question: what if somebody wants to look
@@ -294,7 +307,8 @@ all patches merged during a given merge window should really have found
294their way into linux-next some time before the merge window opens. 307their way into linux-next some time before the merge window opens.
295 308
296 309
2972.4.1: STAGING TREES 310Staging trees
311-------------
298 312
299The kernel source tree contains the drivers/staging/ directory, where 313The kernel source tree contains the drivers/staging/ directory, where
300many sub-directories for drivers or filesystems that are on their way to 314many sub-directories for drivers or filesystems that are on their way to
@@ -322,7 +336,8 @@ staging drivers. So staging is, at best, a stop on the way toward becoming
322a proper mainline driver. 336a proper mainline driver.
323 337
324 338
3252.5: TOOLS 339Tools
340-----
326 341
327As can be seen from the above text, the kernel development process depends 342As can be seen from the above text, the kernel development process depends
328heavily on the ability to herd collections of patches in various 343heavily on the ability to herd collections of patches in various
@@ -368,7 +383,8 @@ upstream. For the management of certain kinds of trees (-mm, for example),
368quilt is the best tool for the job. 383quilt is the best tool for the job.
369 384
370 385
3712.6: MAILING LISTS 386Mailing lists
387-------------
372 388
373A great deal of Linux kernel development work is done by way of mailing 389A great deal of Linux kernel development work is done by way of mailing
374lists. It is hard to be a fully-functioning member of the community 390lists. It is hard to be a fully-functioning member of the community
@@ -436,7 +452,8 @@ filesystem, etc. subsystems. The best place to look for mailing lists is
436in the MAINTAINERS file packaged with the kernel source. 452in the MAINTAINERS file packaged with the kernel source.
437 453
438 454
4392.7: GETTING STARTED WITH KERNEL DEVELOPMENT 455Getting started with Kernel development
456---------------------------------------
440 457
441Questions about how to get started with the kernel development process are 458Questions about how to get started with the kernel development process are
442common - from both individuals and companies. Equally common are missteps 459common - from both individuals and companies. Equally common are missteps
@@ -463,6 +480,8 @@ they wish for by these means.
463 480
464Andrew Morton gives this advice for aspiring kernel developers 481Andrew Morton gives this advice for aspiring kernel developers
465 482
483::
484
466 The #1 project for all kernel beginners should surely be "make sure 485 The #1 project for all kernel beginners should surely be "make sure
467 that the kernel runs perfectly at all times on all machines which 486 that the kernel runs perfectly at all times on all machines which
468 you can lay your hands on". Usually the way to do this is to work 487 you can lay your hands on". Usually the way to do this is to work
diff --git a/Documentation/development-process/3.Early-stage b/Documentation/development-process/3.Early-stage
index f87ba7b3fbac..af2c0af931d6 100644
--- a/Documentation/development-process/3.Early-stage
+++ b/Documentation/development-process/3.Early-stage
@@ -1,4 +1,7 @@
13: EARLY-STAGE PLANNING 1.. _development_early_stage:
2
3Early-stage planning
4====================
2 5
3When contemplating a Linux kernel development project, it can be tempting 6When contemplating a Linux kernel development project, it can be tempting
4to jump right in and start coding. As with any significant project, 7to jump right in and start coding. As with any significant project,
@@ -7,7 +10,8 @@ line of code is written. Some time spent in early planning and
7communication can save far more time later on. 10communication can save far more time later on.
8 11
9 12
103.1: SPECIFYING THE PROBLEM 13Specifying the problem
14----------------------
11 15
12Like any engineering project, a successful kernel enhancement starts with a 16Like any engineering project, a successful kernel enhancement starts with a
13clear description of the problem to be solved. In some cases, this step is 17clear description of the problem to be solved. In some cases, this step is
@@ -64,7 +68,8 @@ answers to a short set of questions:
64Only then does it make sense to start considering possible solutions. 68Only then does it make sense to start considering possible solutions.
65 69
66 70
673.2: EARLY DISCUSSION 71Early discussion
72----------------
68 73
69When planning a kernel development project, it makes great sense to hold 74When planning a kernel development project, it makes great sense to hold
70discussions with the community before launching into implementation. Early 75discussions with the community before launching into implementation. Early
@@ -117,7 +122,8 @@ In each of these cases, a great deal of pain and extra work could have been
117avoided with some early discussion with the kernel developers. 122avoided with some early discussion with the kernel developers.
118 123
119 124
1203.3: WHO DO YOU TALK TO? 125Who do you talk to?
126-------------------
121 127
122When developers decide to take their plans public, the next question will 128When developers decide to take their plans public, the next question will
123be: where do we start? The answer is to find the right mailing list(s) and 129be: where do we start? The answer is to find the right mailing list(s) and
@@ -141,6 +147,8 @@ development project.
141The task of finding the right maintainer is sometimes challenging enough 147The task of finding the right maintainer is sometimes challenging enough
142that the kernel developers have added a script to ease the process: 148that the kernel developers have added a script to ease the process:
143 149
150::
151
144 .../scripts/get_maintainer.pl 152 .../scripts/get_maintainer.pl
145 153
146This script will return the current maintainer(s) for a given file or 154This script will return the current maintainer(s) for a given file or
@@ -155,7 +163,8 @@ If all else fails, talking to Andrew Morton can be an effective way to
155track down a maintainer for a specific piece of code. 163track down a maintainer for a specific piece of code.
156 164
157 165
1583.4: WHEN TO POST? 166When to post?
167-------------
159 168
160If possible, posting your plans during the early stages can only be 169If possible, posting your plans during the early stages can only be
161helpful. Describe the problem being solved and any plans that have been 170helpful. Describe the problem being solved and any plans that have been
@@ -179,7 +188,8 @@ idea. The best thing to do in this situation is to proceed, keeping the
179community informed as you go. 188community informed as you go.
180 189
181 190
1823.5: GETTING OFFICIAL BUY-IN 191Getting official buy-in
192-----------------------
183 193
184If your work is being done in a corporate environment - as most Linux 194If your work is being done in a corporate environment - as most Linux
185kernel work is - you must, obviously, have permission from suitably 195kernel work is - you must, obviously, have permission from suitably
diff --git a/Documentation/development-process/4.Coding b/Documentation/development-process/4.Coding
index 9a3ee77cefb1..9d5cef996f7f 100644
--- a/Documentation/development-process/4.Coding
+++ b/Documentation/development-process/4.Coding
@@ -1,4 +1,7 @@
14: GETTING THE CODE RIGHT 1.. _development_coding:
2
3Getting the code right
4======================
2 5
3While there is much to be said for a solid and community-oriented design 6While there is much to be said for a solid and community-oriented design
4process, the proof of any kernel development project is in the resulting 7process, the proof of any kernel development project is in the resulting
@@ -12,9 +15,11 @@ will shift toward doing things right and the tools which can help in that
12quest. 15quest.
13 16
14 17
154.1: PITFALLS 18Pitfalls
19---------
16 20
17* Coding style 21Coding style
22************
18 23
19The kernel has long had a standard coding style, described in 24The kernel has long had a standard coding style, described in
20Documentation/CodingStyle. For much of that time, the policies described 25Documentation/CodingStyle. For much of that time, the policies described
@@ -54,7 +59,8 @@ style (a line which becomes far less readable if split to fit within the
5480-column limit, for example), just do it. 5980-column limit, for example), just do it.
55 60
56 61
57* Abstraction layers 62Abstraction layers
63******************
58 64
59Computer Science professors teach students to make extensive use of 65Computer Science professors teach students to make extensive use of
60abstraction layers in the name of flexibility and information hiding. 66abstraction layers in the name of flexibility and information hiding.
@@ -87,7 +93,8 @@ implement that functionality at a higher level. There is no value in
87replicating the same code throughout the kernel. 93replicating the same code throughout the kernel.
88 94
89 95
90* #ifdef and preprocessor use in general 96#ifdef and preprocessor use in general
97**************************************
91 98
92The C preprocessor seems to present a powerful temptation to some C 99The C preprocessor seems to present a powerful temptation to some C
93programmers, who see it as a way to efficiently encode a great deal of 100programmers, who see it as a way to efficiently encode a great deal of
@@ -113,7 +120,8 @@ easier to read, do not evaluate their arguments multiple times, and allow
113the compiler to perform type checking on the arguments and return value. 120the compiler to perform type checking on the arguments and return value.
114 121
115 122
116* Inline functions 123Inline functions
124****************
117 125
118Inline functions present a hazard of their own, though. Programmers can 126Inline functions present a hazard of their own, though. Programmers can
119become enamored of the perceived efficiency inherent in avoiding a function 127become enamored of the perceived efficiency inherent in avoiding a function
@@ -137,7 +145,8 @@ placement of "inline" keywords may not just be excessive; it could also be
137irrelevant. 145irrelevant.
138 146
139 147
140* Locking 148Locking
149*******
141 150
142In May, 2006, the "Devicescape" networking stack was, with great 151In May, 2006, the "Devicescape" networking stack was, with great
143fanfare, released under the GPL and made available for inclusion in the 152fanfare, released under the GPL and made available for inclusion in the
@@ -151,7 +160,7 @@ This code showed a number of signs of having been developed behind
151corporate doors. But one large problem in particular was that it was not 160corporate doors. But one large problem in particular was that it was not
152designed to work on multiprocessor systems. Before this networking stack 161designed to work on multiprocessor systems. Before this networking stack
153(now called mac80211) could be merged, a locking scheme needed to be 162(now called mac80211) could be merged, a locking scheme needed to be
154retrofitted onto it. 163retrofitted onto it.
155 164
156Once upon a time, Linux kernel code could be developed without thinking 165Once upon a time, Linux kernel code could be developed without thinking
157about the concurrency issues presented by multiprocessor systems. Now, 166about the concurrency issues presented by multiprocessor systems. Now,
@@ -169,7 +178,8 @@ enough to pick the right tool for the job. Code which shows a lack of
169attention to concurrency will have a difficult path into the mainline. 178attention to concurrency will have a difficult path into the mainline.
170 179
171 180
172* Regressions 181Regressions
182***********
173 183
174One final hazard worth mentioning is this: it can be tempting to make a 184One final hazard worth mentioning is this: it can be tempting to make a
175change (which may bring big improvements) which causes something to break 185change (which may bring big improvements) which causes something to break
@@ -185,6 +195,8 @@ change if it brings new functionality to ten systems for each one it
185breaks? The best answer to this question was expressed by Linus in July, 195breaks? The best answer to this question was expressed by Linus in July,
1862007: 1962007:
187 197
198::
199
188 So we don't fix bugs by introducing new problems. That way lies 200 So we don't fix bugs by introducing new problems. That way lies
189 madness, and nobody ever knows if you actually make any real 201 madness, and nobody ever knows if you actually make any real
190 progress at all. Is it two steps forwards, one step back, or one 202 progress at all. Is it two steps forwards, one step back, or one
@@ -201,8 +213,8 @@ reason, a great deal of thought, clear documentation, and wide review for
201user-space interfaces is always required. 213user-space interfaces is always required.
202 214
203 215
204 216Code checking tools
2054.2: CODE CHECKING TOOLS 217-------------------
206 218
207For now, at least, the writing of error-free code remains an ideal that few 219For now, at least, the writing of error-free code remains an ideal that few
208of us can reach. What we can hope to do, though, is to catch and fix as 220of us can reach. What we can hope to do, though, is to catch and fix as
@@ -250,7 +262,7 @@ testing purposes. In particular, you should turn on:
250There are quite a few other debugging options, some of which will be 262There are quite a few other debugging options, some of which will be
251discussed below. Some of them have a significant performance impact and 263discussed below. Some of them have a significant performance impact and
252should not be used all of the time. But some time spent learning the 264should not be used all of the time. But some time spent learning the
253available options will likely be paid back many times over in short order. 265available options will likely be paid back many times over in short order.
254 266
255One of the heavier debugging tools is the locking checker, or "lockdep." 267One of the heavier debugging tools is the locking checker, or "lockdep."
256This tool will track the acquisition and release of every lock (spinlock or 268This tool will track the acquisition and release of every lock (spinlock or
@@ -263,7 +275,7 @@ occasion, deadlock. This kind of problem can be painful (for both
263developers and users) in a deployed system; lockdep allows them to be found 275developers and users) in a deployed system; lockdep allows them to be found
264in an automated manner ahead of time. Code with any sort of non-trivial 276in an automated manner ahead of time. Code with any sort of non-trivial
265locking should be run with lockdep enabled before being submitted for 277locking should be run with lockdep enabled before being submitted for
266inclusion. 278inclusion.
267 279
268As a diligent kernel programmer, you will, beyond doubt, check the return 280As a diligent kernel programmer, you will, beyond doubt, check the return
269status of any operation (such as a memory allocation) which can fail. The 281status of any operation (such as a memory allocation) which can fail. The
@@ -300,7 +312,7 @@ Documentation/coccinelle.txt for more information.
300Other kinds of portability errors are best found by compiling your code for 312Other kinds of portability errors are best found by compiling your code for
301other architectures. If you do not happen to have an S/390 system or a 313other architectures. If you do not happen to have an S/390 system or a
302Blackfin development board handy, you can still perform the compilation 314Blackfin development board handy, you can still perform the compilation
303step. A large set of cross compilers for x86 systems can be found at 315step. A large set of cross compilers for x86 systems can be found at
304 316
305 http://www.kernel.org/pub/tools/crosstool/ 317 http://www.kernel.org/pub/tools/crosstool/
306 318
@@ -308,7 +320,8 @@ Some time spent installing and using these compilers will help avoid
308embarrassment later. 320embarrassment later.
309 321
310 322
3114.3: DOCUMENTATION 323Documentation
324-------------
312 325
313Documentation has often been more the exception than the rule with kernel 326Documentation has often been more the exception than the rule with kernel
314development. Even so, adequate documentation will help to ease the merging 327development. Even so, adequate documentation will help to ease the merging
@@ -364,7 +377,8 @@ out. Anything which might tempt a code janitor to make an incorrect
364"cleanup" needs a comment saying why it is done the way it is. And so on. 377"cleanup" needs a comment saying why it is done the way it is. And so on.
365 378
366 379
3674.4: INTERNAL API CHANGES 380Internal API changes
381--------------------
368 382
369The binary interface provided by the kernel to user space cannot be broken 383The binary interface provided by the kernel to user space cannot be broken
370except under the most severe circumstances. The kernel's internal 384except under the most severe circumstances. The kernel's internal
diff --git a/Documentation/development-process/5.Posting b/Documentation/development-process/5.Posting
index 8a48c9b62864..b511ddf7e82a 100644
--- a/Documentation/development-process/5.Posting
+++ b/Documentation/development-process/5.Posting
@@ -1,4 +1,7 @@
15: POSTING PATCHES 1.. _development_posting:
2
3Posting patches
4===============
2 5
3Sooner or later, the time comes when your work is ready to be presented to 6Sooner or later, the time comes when your work is ready to be presented to
4the community for review and, eventually, inclusion into the mainline 7the community for review and, eventually, inclusion into the mainline
@@ -11,7 +14,8 @@ SubmittingDrivers, and SubmitChecklist in the kernel documentation
11directory. 14directory.
12 15
13 16
145.1: WHEN TO POST 17When to post
18------------
15 19
16There is a constant temptation to avoid posting patches before they are 20There is a constant temptation to avoid posting patches before they are
17completely "ready." For simple patches, that is not a problem. If the 21completely "ready." For simple patches, that is not a problem. If the
@@ -27,7 +31,8 @@ patches which are known to be half-baked, but those who do will come in
27with the idea that they can help you drive the work in the right direction. 31with the idea that they can help you drive the work in the right direction.
28 32
29 33
305.2: BEFORE CREATING PATCHES 34Before creating patches
35-----------------------
31 36
32There are a number of things which should be done before you consider 37There are a number of things which should be done before you consider
33sending patches to the development community. These include: 38sending patches to the development community. These include:
@@ -52,7 +57,8 @@ As a general rule, putting in some extra thought before posting code almost
52always pays back the effort in short order. 57always pays back the effort in short order.
53 58
54 59
555.3: PATCH PREPARATION 60Patch preparation
61-----------------
56 62
57The preparation of patches for posting can be a surprising amount of work, 63The preparation of patches for posting can be a surprising amount of work,
58but, once again, attempting to save time here is not generally advisable 64but, once again, attempting to save time here is not generally advisable
@@ -122,7 +128,8 @@ which takes quite a bit of time and thought after the "real work" has been
122done. When done properly, though, it is time well spent. 128done. When done properly, though, it is time well spent.
123 129
124 130
1255.4: PATCH FORMATTING AND CHANGELOGS 131Patch formatting and changelogs
132-------------------------------
126 133
127So now you have a perfect series of patches for posting, but the work is 134So now you have a perfect series of patches for posting, but the work is
128not done quite yet. Each patch needs to be formatted into a message which 135not done quite yet. Each patch needs to be formatted into a message which
@@ -140,6 +147,8 @@ that end, each patch will be composed of the following:
140 subsystem name first, followed by the purpose of the patch. For 147 subsystem name first, followed by the purpose of the patch. For
141 example: 148 example:
142 149
150 ::
151
143 gpio: fix build on CONFIG_GPIO_SYSFS=n 152 gpio: fix build on CONFIG_GPIO_SYSFS=n
144 153
145 - A blank line followed by a detailed description of the contents of the 154 - A blank line followed by a detailed description of the contents of the
@@ -192,6 +201,8 @@ been associated with the development of this patch. They are described in
192detail in the SubmittingPatches document; what follows here is a brief 201detail in the SubmittingPatches document; what follows here is a brief
193summary. Each of these lines has the format: 202summary. Each of these lines has the format:
194 203
204::
205
195 tag: Full Name <email address> optional-other-stuff 206 tag: Full Name <email address> optional-other-stuff
196 207
197The tags in common use are: 208The tags in common use are:
@@ -225,7 +236,8 @@ Be careful in the addition of tags to your patches: only Cc: is appropriate
225for addition without the explicit permission of the person named. 236for addition without the explicit permission of the person named.
226 237
227 238
2285.5: SENDING THE PATCH 239Sending the patch
240-----------------
229 241
230Before you mail your patches, there are a couple of other things you should 242Before you mail your patches, there are a couple of other things you should
231take care of: 243take care of:
@@ -287,6 +299,8 @@ obvious maintainer, Andrew Morton is often the patch target of last resort.
287Patches need good subject lines. The canonical format for a patch line is 299Patches need good subject lines. The canonical format for a patch line is
288something like: 300something like:
289 301
302::
303
290 [PATCH nn/mm] subsys: one-line description of the patch 304 [PATCH nn/mm] subsys: one-line description of the patch
291 305
292where "nn" is the ordinal number of the patch, "mm" is the total number of 306where "nn" is the ordinal number of the patch, "mm" is the total number of
diff --git a/Documentation/development-process/6.Followthrough b/Documentation/development-process/6.Followthrough
index 41d324a9420d..a173cd5f93d2 100644
--- a/Documentation/development-process/6.Followthrough
+++ b/Documentation/development-process/6.Followthrough
@@ -1,4 +1,7 @@
16: FOLLOWTHROUGH 1.. _development_followthrough:
2
3Followthrough
4=============
2 5
3At this point, you have followed the guidelines given so far and, with the 6At this point, you have followed the guidelines given so far and, with the
4addition of your own engineering skills, have posted a perfect series of 7addition of your own engineering skills, have posted a perfect series of
@@ -16,7 +19,8 @@ standards. A failure to participate in this process is quite likely to
16prevent the inclusion of your patches into the mainline. 19prevent the inclusion of your patches into the mainline.
17 20
18 21
196.1: WORKING WITH REVIEWERS 22Working with reviewers
23----------------------
20 24
21A patch of any significance will result in a number of comments from other 25A patch of any significance will result in a number of comments from other
22developers as they review the code. Working with reviewers can be, for 26developers as they review the code. Working with reviewers can be, for
@@ -97,7 +101,8 @@ though, and not before all other alternatives have been explored. And bear
97in mind, of course, that he may not agree with you either. 101in mind, of course, that he may not agree with you either.
98 102
99 103
1006.2: WHAT HAPPENS NEXT 104What happens next
105-----------------
101 106
102If a patch is considered to be a good thing to add to the kernel, and once 107If a patch is considered to be a good thing to add to the kernel, and once
103most of the review issues have been resolved, the next step is usually 108most of the review issues have been resolved, the next step is usually
@@ -177,7 +182,8 @@ it with the assumption that you will not be around to maintain it
177afterward. 182afterward.
178 183
179 184
1806.3: OTHER THINGS THAT CAN HAPPEN 185Other things that can happen
186-----------------------------
181 187
182One day, you may open your mail client and see that somebody has mailed you 188One day, you may open your mail client and see that somebody has mailed you
183a patch to your code. That is one of the advantages of having your code 189a patch to your code. That is one of the advantages of having your code
diff --git a/Documentation/development-process/7.AdvancedTopics b/Documentation/development-process/7.AdvancedTopics
index 26dc3fa196e4..81d61c5d62dd 100644
--- a/Documentation/development-process/7.AdvancedTopics
+++ b/Documentation/development-process/7.AdvancedTopics
@@ -1,11 +1,15 @@
17: ADVANCED TOPICS 1.. _development_advancedtopics:
2
3Advanced topics
4===============
2 5
3At this point, hopefully, you have a handle on how the development process 6At this point, hopefully, you have a handle on how the development process
4works. There is still more to learn, however! This section will cover a 7works. There is still more to learn, however! This section will cover a
5number of topics which can be helpful for developers wanting to become a 8number of topics which can be helpful for developers wanting to become a
6regular part of the Linux kernel development process. 9regular part of the Linux kernel development process.
7 10
87.1: MANAGING PATCHES WITH GIT 11Managing patches with git
12-------------------------
9 13
10The use of distributed version control for the kernel began in early 2002, 14The use of distributed version control for the kernel began in early 2002,
11when Linus first started playing with the proprietary BitKeeper 15when Linus first started playing with the proprietary BitKeeper
@@ -114,6 +118,8 @@ radar. Kernel developers tend to get unhappy when they see that kind of
114thing happening; putting up a git tree with unreviewed or off-topic patches 118thing happening; putting up a git tree with unreviewed or off-topic patches
115can affect your ability to get trees pulled in the future. Quoting Linus: 119can affect your ability to get trees pulled in the future. Quoting Linus:
116 120
121::
122
117 You can send me patches, but for me to pull a git patch from you, I 123 You can send me patches, but for me to pull a git patch from you, I
118 need to know that you know what you're doing, and I need to be able 124 need to know that you know what you're doing, and I need to be able
119 to trust things *without* then having to go and check every 125 to trust things *without* then having to go and check every
@@ -141,7 +147,8 @@ format the request as other developers expect, and will also check to be
141sure that you have remembered to push those changes to the public server. 147sure that you have remembered to push those changes to the public server.
142 148
143 149
1447.2: REVIEWING PATCHES 150Reviewing patches
151-----------------
145 152
146Some readers will certainly object to putting this section with "advanced 153Some readers will certainly object to putting this section with "advanced
147topics" on the grounds that even beginning kernel developers should be 154topics" on the grounds that even beginning kernel developers should be
diff --git a/Documentation/development-process/8.Conclusion b/Documentation/development-process/8.Conclusion
index caef69022e9c..23ec7cbc2d2b 100644
--- a/Documentation/development-process/8.Conclusion
+++ b/Documentation/development-process/8.Conclusion
@@ -1,4 +1,7 @@
18: FOR MORE INFORMATION 1.. _development_conclusion:
2
3For more information
4====================
2 5
3There are numerous sources of information on Linux kernel development and 6There are numerous sources of information on Linux kernel development and
4related topics. First among those will always be the Documentation 7related topics. First among those will always be the Documentation
@@ -47,7 +50,8 @@ Documentation for git can be found at:
47 http://www.kernel.org/pub/software/scm/git/docs/user-manual.html 50 http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
48 51
49 52
509: CONCLUSION 53Conclusion
54==========
51 55
52Congratulations to anybody who has made it through this long-winded 56Congratulations to anybody who has made it through this long-winded
53document. Hopefully it has provided a helpful understanding of how the 57document. Hopefully it has provided a helpful understanding of how the
diff --git a/Documentation/development-process/development-process.rst b/Documentation/development-process/development-process.rst
new file mode 100644
index 000000000000..d431a1098875
--- /dev/null
+++ b/Documentation/development-process/development-process.rst
@@ -0,0 +1,27 @@
1A guide to the Kernel Development Process
2=========================================
3
4Contents:
5
6.. toctree::
7 :numbered:
8 :maxdepth: 2
9
10 1.Intro
11 2.Process
12 3.Early-stage
13 4.Coding
14 5.Posting
15 6.Followthrough
16 7.AdvancedTopics
17 8.Conclusion
18
19The purpose of this document is to help developers (and their managers)
20work with the development community with a minimum of frustration. It is
21an attempt to document how this community works in a way which is
22accessible to those who are not intimately familiar with Linux kernel
23development (or, indeed, free software development in general). While
24there is some technical material here, this is very much a process-oriented
25discussion which does not require a deep knowledge of kernel programming to
26understand.
27