diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-09-19 07:07:36 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2016-09-20 20:30:43 -0400 |
commit | f7c9fe4b1cd144f7afc1712bb25141c55c406e1b (patch) | |
tree | ad56ecfa99ef9abe7dd84744cf7dc3770bf1d087 | |
parent | 1414f0488803d8963b5868b1512515c997b54571 (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.Intro | 68 | ||||
-rw-r--r-- | Documentation/development-process/2.Process | 41 | ||||
-rw-r--r-- | Documentation/development-process/3.Early-stage | 22 | ||||
-rw-r--r-- | Documentation/development-process/4.Coding | 46 | ||||
-rw-r--r-- | Documentation/development-process/5.Posting | 26 | ||||
-rw-r--r-- | Documentation/development-process/6.Followthrough | 14 | ||||
-rw-r--r-- | Documentation/development-process/7.AdvancedTopics | 13 | ||||
-rw-r--r-- | Documentation/development-process/8.Conclusion | 8 | ||||
-rw-r--r-- | Documentation/development-process/development-process.rst | 27 |
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 @@ | |||
1 | 1: A GUIDE TO THE KERNEL DEVELOPMENT PROCESS | 1 | Introdution |
2 | =========== | ||
2 | 3 | ||
3 | The purpose of this document is to help developers (and their managers) | 4 | Executive summary |
4 | work with the development community with a minimum of frustration. It is | 5 | ----------------- |
5 | an attempt to document how this community works in a way which is | ||
6 | accessible to those who are not intimately familiar with Linux kernel | ||
7 | development (or, indeed, free software development in general). While | ||
8 | there is some technical material here, this is very much a process-oriented | ||
9 | discussion which does not require a deep knowledge of kernel programming to | ||
10 | understand. | ||
11 | |||
12 | |||
13 | 1.1: EXECUTIVE SUMMARY | ||
14 | 6 | ||
15 | The rest of this section covers the scope of the kernel development process | 7 | The rest of this section covers the scope of the kernel development process |
16 | and the kinds of frustrations that developers and their employers can | 8 | and 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 | |||
20 | influence the direction of kernel development. Code contributed to the | 12 | influence the direction of kernel development. Code contributed to the |
21 | Linux kernel must be made available under a GPL-compatible license. | 13 | Linux kernel must be made available under a GPL-compatible license. |
22 | 14 | ||
23 | Section 2 introduces the development process, the kernel release cycle, and | 15 | :ref:`development_process` introduces the development process, the kernel |
24 | the mechanics of the merge window. The various phases in the patch | 16 | release cycle, and the mechanics of the merge window. The various phases in |
25 | development, review, and merging cycle are covered. There is some | 17 | the patch development, review, and merging cycle are covered. There is some |
26 | discussion of tools and mailing lists. Developers wanting to get started | 18 | discussion of tools and mailing lists. Developers wanting to get started |
27 | with kernel development are encouraged to track down and fix bugs as an | 19 | with kernel development are encouraged to track down and fix bugs as an |
28 | initial exercise. | 20 | initial exercise. |
29 | 21 | ||
30 | Section 3 covers early-stage project planning, with an emphasis on | 22 | :ref:`development_early_stage` covers early-stage project planning, with an |
31 | involving the development community as soon as possible. | 23 | emphasis on involving the development community as soon as possible. |
32 | 24 | ||
33 | Section 4 is about the coding process; several pitfalls which have been | 25 | :ref:`development_coding` is about the coding process; several pitfalls which |
34 | encountered by other developers are discussed. Some requirements for | 26 | have been encountered by other developers are discussed. Some requirements for |
35 | patches are covered, and there is an introduction to some of the tools | 27 | patches are covered, and there is an introduction to some of the tools |
36 | which can help to ensure that kernel patches are correct. | 28 | which can help to ensure that kernel patches are correct. |
37 | 29 | ||
38 | Section 5 talks about the process of posting patches for review. To be | 30 | :ref:`development_posting` talks about the process of posting patches for |
39 | taken seriously by the development community, patches must be properly | 31 | review. To be taken seriously by the development community, patches must be |
40 | formatted and described, and they must be sent to the right place. | 32 | properly formatted and described, and they must be sent to the right place. |
41 | Following the advice in this section should help to ensure the best | 33 | Following the advice in this section should help to ensure the best |
42 | possible reception for your work. | 34 | possible reception for your work. |
43 | 35 | ||
44 | Section 6 covers what happens after posting patches; the job is far from | 36 | :ref:`development_followthrough` covers what happens after posting patches; the |
45 | done at that point. Working with reviewers is a crucial part of the | 37 | job is far from done at that point. Working with reviewers is a crucial part |
46 | development process; this section offers a number of tips on how to avoid | 38 | of the development process; this section offers a number of tips on how to |
47 | problems at this important stage. Developers are cautioned against | 39 | avoid problems at this important stage. Developers are cautioned against |
48 | assuming that the job is done when a patch is merged into the mainline. | 40 | assuming that the job is done when a patch is merged into the mainline. |
49 | 41 | ||
50 | Section 7 introduces a couple of "advanced" topics: managing patches with | 42 | :ref:`development_advancedtopics` introduces a couple of "advanced" topics: |
51 | git and reviewing patches posted by others. | 43 | managing patches with git and reviewing patches posted by others. |
52 | |||
53 | Section 8 concludes the document with pointers to sources for more | ||
54 | information on kernel development. | ||
55 | 44 | ||
45 | :ref:`development_conclusion` concludes the document with pointers to sources | ||
46 | for more information on kernel development. | ||
56 | 47 | ||
57 | 1.2: WHAT THIS DOCUMENT IS ABOUT | 48 | What this document is about |
49 | --------------------------- | ||
58 | 50 | ||
59 | The Linux kernel, at over 8 million lines of code and well over 1000 | 51 | The Linux kernel, at over 8 million lines of code and well over 1000 |
60 | contributors to each release, is one of the largest and most active free | 52 | contributors 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 | |||
108 | better; the following text should help you - or those who work for you - | 100 | better; the following text should help you - or those who work for you - |
109 | join our community. | 101 | join our community. |
110 | 102 | ||
111 | 103 | Credits | |
112 | 1.3: CREDITS | 104 | ------- |
113 | 105 | ||
114 | This document was written by Jonathan Corbet, corbet@lwn.net. It has been | 106 | This document was written by Jonathan Corbet, corbet@lwn.net. It has been |
115 | improved by comments from Johannes Berg, James Berry, Alex Chiang, Roland | 107 | improved by comments from Johannes Berg, James Berry, Alex Chiang, Roland |
@@ -120,8 +112,8 @@ Jochen Voß. | |||
120 | This work was supported by the Linux Foundation; thanks especially to | 112 | This work was supported by the Linux Foundation; thanks especially to |
121 | Amanda McPherson, who saw the value of this effort and made it all happen. | 113 | Amanda McPherson, who saw the value of this effort and made it all happen. |
122 | 114 | ||
123 | 115 | The importance of getting code into the mainline | |
124 | 1.4: THE IMPORTANCE OF GETTING CODE INTO THE MAINLINE | 116 | ------------------------------------------------ |
125 | 117 | ||
126 | Some companies and developers occasionally wonder why they should bother | 118 | Some companies and developers occasionally wonder why they should bother |
127 | learning how to work with the kernel community and get their code into the | 119 | learning 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 | |||
233 | point, vendors whose code is in the mainline and well maintained will be | 225 | point, vendors whose code is in the mainline and well maintained will be |
234 | much better positioned to get the new product ready for market quickly. | 226 | much better positioned to get the new product ready for market quickly. |
235 | 227 | ||
236 | 228 | Licensing | |
237 | 1.5: LICENSING | 229 | --------- |
238 | 230 | ||
239 | Code is contributed to the Linux kernel under a number of licenses, but all | 231 | Code is contributed to the Linux kernel under a number of licenses, but all |
240 | code must be compatible with version 2 of the GNU General Public License | 232 | code 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 @@ | |||
1 | 2: HOW THE DEVELOPMENT PROCESS WORKS | 1 | .. _development_process: |
2 | |||
3 | How the development process works | ||
4 | ================================= | ||
2 | 5 | ||
3 | Linux kernel development in the early 1990's was a pretty loose affair, | 6 | Linux kernel development in the early 1990's was a pretty loose affair, |
4 | with relatively small numbers of users and developers involved. With a | 7 | with 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 | |||
7 | processes to keep development happening smoothly. A solid understanding of | 10 | processes to keep development happening smoothly. A solid understanding of |
8 | how the process works is required in order to be an effective part of it. | 11 | how the process works is required in order to be an effective part of it. |
9 | 12 | ||
10 | 13 | The big picture | |
11 | 2.1: THE BIG PICTURE | 14 | --------------- |
12 | 15 | ||
13 | The kernel developers use a loosely time-based release process, with a new | 16 | The kernel developers use a loosely time-based release process, with a new |
14 | major kernel release happening every two or three months. The recent | 17 | major kernel release happening every two or three months. The recent |
15 | release history looks like this: | 18 | release 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 | ||
24 | Every 2.6.x release is a major kernel release with new features, internal | 29 | Every 2.6.x release is a major kernel release with new features, internal |
25 | API changes, and more. A typical 2.6 release can contain nearly 10,000 | 30 | API 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. | |||
68 | As an example, here is how the 2.6.38 development cycle went (all dates in | 73 | As an example, here is how the 2.6.38 development cycle went (all dates in |
69 | 2011): | 74 | 2011): |
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 | ||
82 | How do the developers decide when to close the development cycle and create | 89 | How do the developers decide when to close the development cycle and create |
83 | the stable release? The most significant metric used is the list of | 90 | the 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 | |||
105 | a little more than one development cycle past their initial release. So, | 112 | a little more than one development cycle past their initial release. So, |
106 | for example, the 2.6.36 kernel's history looked like: | 113 | for 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 | ||
114 | 2.6.36.4 was the final stable update for the 2.6.36 release. | 123 | 2.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 | |||
117 | for a longer period. As of this writing, the current long term kernels | 126 | for a longer period. As of this writing, the current long term kernels |
118 | and their maintainers are: | 127 | and 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 | ||
124 | The selection of a kernel for long-term support is purely a matter of a | 135 | The selection of a kernel for long-term support is purely a matter of a |
125 | maintainer having the need and the time to maintain that release. There | 136 | maintainer 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 | |||
127 | release. | 138 | release. |
128 | 139 | ||
129 | 140 | ||
130 | 2.2: THE LIFECYCLE OF A PATCH | 141 | The lifecycle of a patch |
142 | ------------------------ | ||
131 | 143 | ||
132 | Patches do not go directly from the developer's keyboard into the mainline | 144 | Patches do not go directly from the developer's keyboard into the mainline |
133 | kernel. There is, instead, a somewhat involved (if somewhat informal) | 145 | kernel. 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" | |||
195 | step. This approach invariably leads to frustration for everybody | 207 | step. This approach invariably leads to frustration for everybody |
196 | involved. | 208 | involved. |
197 | 209 | ||
198 | 210 | How patches get into the Kernel | |
199 | 2.3: HOW PATCHES GET INTO THE KERNEL | 211 | ------------------------------- |
200 | 212 | ||
201 | There is exactly one person who can merge patches into the mainline kernel | 213 | There is exactly one person who can merge patches into the mainline kernel |
202 | repository: Linus Torvalds. But, of the over 9,500 patches which went | 214 | repository: 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 | |||
242 | normally the right way to go. | 254 | normally the right way to go. |
243 | 255 | ||
244 | 256 | ||
245 | 2.4: NEXT TREES | 257 | Next trees |
258 | ---------- | ||
246 | 259 | ||
247 | The chain of subsystem trees guides the flow of patches into the kernel, | 260 | The chain of subsystem trees guides the flow of patches into the kernel, |
248 | but it also raises an interesting question: what if somebody wants to look | 261 | but 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 | |||
294 | their way into linux-next some time before the merge window opens. | 307 | their way into linux-next some time before the merge window opens. |
295 | 308 | ||
296 | 309 | ||
297 | 2.4.1: STAGING TREES | 310 | Staging trees |
311 | ------------- | ||
298 | 312 | ||
299 | The kernel source tree contains the drivers/staging/ directory, where | 313 | The kernel source tree contains the drivers/staging/ directory, where |
300 | many sub-directories for drivers or filesystems that are on their way to | 314 | many 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 | |||
322 | a proper mainline driver. | 336 | a proper mainline driver. |
323 | 337 | ||
324 | 338 | ||
325 | 2.5: TOOLS | 339 | Tools |
340 | ----- | ||
326 | 341 | ||
327 | As can be seen from the above text, the kernel development process depends | 342 | As can be seen from the above text, the kernel development process depends |
328 | heavily on the ability to herd collections of patches in various | 343 | heavily 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), | |||
368 | quilt is the best tool for the job. | 383 | quilt is the best tool for the job. |
369 | 384 | ||
370 | 385 | ||
371 | 2.6: MAILING LISTS | 386 | Mailing lists |
387 | ------------- | ||
372 | 388 | ||
373 | A great deal of Linux kernel development work is done by way of mailing | 389 | A great deal of Linux kernel development work is done by way of mailing |
374 | lists. It is hard to be a fully-functioning member of the community | 390 | lists. 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 | |||
436 | in the MAINTAINERS file packaged with the kernel source. | 452 | in the MAINTAINERS file packaged with the kernel source. |
437 | 453 | ||
438 | 454 | ||
439 | 2.7: GETTING STARTED WITH KERNEL DEVELOPMENT | 455 | Getting started with Kernel development |
456 | --------------------------------------- | ||
440 | 457 | ||
441 | Questions about how to get started with the kernel development process are | 458 | Questions about how to get started with the kernel development process are |
442 | common - from both individuals and companies. Equally common are missteps | 459 | common - from both individuals and companies. Equally common are missteps |
@@ -463,6 +480,8 @@ they wish for by these means. | |||
463 | 480 | ||
464 | Andrew Morton gives this advice for aspiring kernel developers | 481 | Andrew 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 @@ | |||
1 | 3: EARLY-STAGE PLANNING | 1 | .. _development_early_stage: |
2 | |||
3 | Early-stage planning | ||
4 | ==================== | ||
2 | 5 | ||
3 | When contemplating a Linux kernel development project, it can be tempting | 6 | When contemplating a Linux kernel development project, it can be tempting |
4 | to jump right in and start coding. As with any significant project, | 7 | to 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 | |||
7 | communication can save far more time later on. | 10 | communication can save far more time later on. |
8 | 11 | ||
9 | 12 | ||
10 | 3.1: SPECIFYING THE PROBLEM | 13 | Specifying the problem |
14 | ---------------------- | ||
11 | 15 | ||
12 | Like any engineering project, a successful kernel enhancement starts with a | 16 | Like any engineering project, a successful kernel enhancement starts with a |
13 | clear description of the problem to be solved. In some cases, this step is | 17 | clear description of the problem to be solved. In some cases, this step is |
@@ -64,7 +68,8 @@ answers to a short set of questions: | |||
64 | Only then does it make sense to start considering possible solutions. | 68 | Only then does it make sense to start considering possible solutions. |
65 | 69 | ||
66 | 70 | ||
67 | 3.2: EARLY DISCUSSION | 71 | Early discussion |
72 | ---------------- | ||
68 | 73 | ||
69 | When planning a kernel development project, it makes great sense to hold | 74 | When planning a kernel development project, it makes great sense to hold |
70 | discussions with the community before launching into implementation. Early | 75 | discussions 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 | |||
117 | avoided with some early discussion with the kernel developers. | 122 | avoided with some early discussion with the kernel developers. |
118 | 123 | ||
119 | 124 | ||
120 | 3.3: WHO DO YOU TALK TO? | 125 | Who do you talk to? |
126 | ------------------- | ||
121 | 127 | ||
122 | When developers decide to take their plans public, the next question will | 128 | When developers decide to take their plans public, the next question will |
123 | be: where do we start? The answer is to find the right mailing list(s) and | 129 | be: where do we start? The answer is to find the right mailing list(s) and |
@@ -141,6 +147,8 @@ development project. | |||
141 | The task of finding the right maintainer is sometimes challenging enough | 147 | The task of finding the right maintainer is sometimes challenging enough |
142 | that the kernel developers have added a script to ease the process: | 148 | that 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 | ||
146 | This script will return the current maintainer(s) for a given file or | 154 | This 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 | |||
155 | track down a maintainer for a specific piece of code. | 163 | track down a maintainer for a specific piece of code. |
156 | 164 | ||
157 | 165 | ||
158 | 3.4: WHEN TO POST? | 166 | When to post? |
167 | ------------- | ||
159 | 168 | ||
160 | If possible, posting your plans during the early stages can only be | 169 | If possible, posting your plans during the early stages can only be |
161 | helpful. Describe the problem being solved and any plans that have been | 170 | helpful. 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 | |||
179 | community informed as you go. | 188 | community informed as you go. |
180 | 189 | ||
181 | 190 | ||
182 | 3.5: GETTING OFFICIAL BUY-IN | 191 | Getting official buy-in |
192 | ----------------------- | ||
183 | 193 | ||
184 | If your work is being done in a corporate environment - as most Linux | 194 | If your work is being done in a corporate environment - as most Linux |
185 | kernel work is - you must, obviously, have permission from suitably | 195 | kernel 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 @@ | |||
1 | 4: GETTING THE CODE RIGHT | 1 | .. _development_coding: |
2 | |||
3 | Getting the code right | ||
4 | ====================== | ||
2 | 5 | ||
3 | While there is much to be said for a solid and community-oriented design | 6 | While there is much to be said for a solid and community-oriented design |
4 | process, the proof of any kernel development project is in the resulting | 7 | process, 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 | |||
12 | quest. | 15 | quest. |
13 | 16 | ||
14 | 17 | ||
15 | 4.1: PITFALLS | 18 | Pitfalls |
19 | --------- | ||
16 | 20 | ||
17 | * Coding style | 21 | Coding style |
22 | ************ | ||
18 | 23 | ||
19 | The kernel has long had a standard coding style, described in | 24 | The kernel has long had a standard coding style, described in |
20 | Documentation/CodingStyle. For much of that time, the policies described | 25 | Documentation/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 | |||
54 | 80-column limit, for example), just do it. | 59 | 80-column limit, for example), just do it. |
55 | 60 | ||
56 | 61 | ||
57 | * Abstraction layers | 62 | Abstraction layers |
63 | ****************** | ||
58 | 64 | ||
59 | Computer Science professors teach students to make extensive use of | 65 | Computer Science professors teach students to make extensive use of |
60 | abstraction layers in the name of flexibility and information hiding. | 66 | abstraction 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 | |||
87 | replicating the same code throughout the kernel. | 93 | replicating 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 | ||
92 | The C preprocessor seems to present a powerful temptation to some C | 99 | The C preprocessor seems to present a powerful temptation to some C |
93 | programmers, who see it as a way to efficiently encode a great deal of | 100 | programmers, 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 | |||
113 | the compiler to perform type checking on the arguments and return value. | 120 | the compiler to perform type checking on the arguments and return value. |
114 | 121 | ||
115 | 122 | ||
116 | * Inline functions | 123 | Inline functions |
124 | **************** | ||
117 | 125 | ||
118 | Inline functions present a hazard of their own, though. Programmers can | 126 | Inline functions present a hazard of their own, though. Programmers can |
119 | become enamored of the perceived efficiency inherent in avoiding a function | 127 | become 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 | |||
137 | irrelevant. | 145 | irrelevant. |
138 | 146 | ||
139 | 147 | ||
140 | * Locking | 148 | Locking |
149 | ******* | ||
141 | 150 | ||
142 | In May, 2006, the "Devicescape" networking stack was, with great | 151 | In May, 2006, the "Devicescape" networking stack was, with great |
143 | fanfare, released under the GPL and made available for inclusion in the | 152 | fanfare, 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 | |||
151 | corporate doors. But one large problem in particular was that it was not | 160 | corporate doors. But one large problem in particular was that it was not |
152 | designed to work on multiprocessor systems. Before this networking stack | 161 | designed 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 |
154 | retrofitted onto it. | 163 | retrofitted onto it. |
155 | 164 | ||
156 | Once upon a time, Linux kernel code could be developed without thinking | 165 | Once upon a time, Linux kernel code could be developed without thinking |
157 | about the concurrency issues presented by multiprocessor systems. Now, | 166 | about 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 | |||
169 | attention to concurrency will have a difficult path into the mainline. | 178 | attention to concurrency will have a difficult path into the mainline. |
170 | 179 | ||
171 | 180 | ||
172 | * Regressions | 181 | Regressions |
182 | *********** | ||
173 | 183 | ||
174 | One final hazard worth mentioning is this: it can be tempting to make a | 184 | One final hazard worth mentioning is this: it can be tempting to make a |
175 | change (which may bring big improvements) which causes something to break | 185 | change (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 | |||
185 | breaks? The best answer to this question was expressed by Linus in July, | 195 | breaks? The best answer to this question was expressed by Linus in July, |
186 | 2007: | 196 | 2007: |
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 | |||
201 | user-space interfaces is always required. | 213 | user-space interfaces is always required. |
202 | 214 | ||
203 | 215 | ||
204 | 216 | Code checking tools | |
205 | 4.2: CODE CHECKING TOOLS | 217 | ------------------- |
206 | 218 | ||
207 | For now, at least, the writing of error-free code remains an ideal that few | 219 | For now, at least, the writing of error-free code remains an ideal that few |
208 | of us can reach. What we can hope to do, though, is to catch and fix as | 220 | of 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: | |||
250 | There are quite a few other debugging options, some of which will be | 262 | There are quite a few other debugging options, some of which will be |
251 | discussed below. Some of them have a significant performance impact and | 263 | discussed below. Some of them have a significant performance impact and |
252 | should not be used all of the time. But some time spent learning the | 264 | should not be used all of the time. But some time spent learning the |
253 | available options will likely be paid back many times over in short order. | 265 | available options will likely be paid back many times over in short order. |
254 | 266 | ||
255 | One of the heavier debugging tools is the locking checker, or "lockdep." | 267 | One of the heavier debugging tools is the locking checker, or "lockdep." |
256 | This tool will track the acquisition and release of every lock (spinlock or | 268 | This 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 | |||
263 | developers and users) in a deployed system; lockdep allows them to be found | 275 | developers and users) in a deployed system; lockdep allows them to be found |
264 | in an automated manner ahead of time. Code with any sort of non-trivial | 276 | in an automated manner ahead of time. Code with any sort of non-trivial |
265 | locking should be run with lockdep enabled before being submitted for | 277 | locking should be run with lockdep enabled before being submitted for |
266 | inclusion. | 278 | inclusion. |
267 | 279 | ||
268 | As a diligent kernel programmer, you will, beyond doubt, check the return | 280 | As a diligent kernel programmer, you will, beyond doubt, check the return |
269 | status of any operation (such as a memory allocation) which can fail. The | 281 | status of any operation (such as a memory allocation) which can fail. The |
@@ -300,7 +312,7 @@ Documentation/coccinelle.txt for more information. | |||
300 | Other kinds of portability errors are best found by compiling your code for | 312 | Other kinds of portability errors are best found by compiling your code for |
301 | other architectures. If you do not happen to have an S/390 system or a | 313 | other architectures. If you do not happen to have an S/390 system or a |
302 | Blackfin development board handy, you can still perform the compilation | 314 | Blackfin development board handy, you can still perform the compilation |
303 | step. A large set of cross compilers for x86 systems can be found at | 315 | step. 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 | |||
308 | embarrassment later. | 320 | embarrassment later. |
309 | 321 | ||
310 | 322 | ||
311 | 4.3: DOCUMENTATION | 323 | Documentation |
324 | ------------- | ||
312 | 325 | ||
313 | Documentation has often been more the exception than the rule with kernel | 326 | Documentation has often been more the exception than the rule with kernel |
314 | development. Even so, adequate documentation will help to ease the merging | 327 | development. 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 | ||
367 | 4.4: INTERNAL API CHANGES | 380 | Internal API changes |
381 | -------------------- | ||
368 | 382 | ||
369 | The binary interface provided by the kernel to user space cannot be broken | 383 | The binary interface provided by the kernel to user space cannot be broken |
370 | except under the most severe circumstances. The kernel's internal | 384 | except 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 @@ | |||
1 | 5: POSTING PATCHES | 1 | .. _development_posting: |
2 | |||
3 | Posting patches | ||
4 | =============== | ||
2 | 5 | ||
3 | Sooner or later, the time comes when your work is ready to be presented to | 6 | Sooner or later, the time comes when your work is ready to be presented to |
4 | the community for review and, eventually, inclusion into the mainline | 7 | the community for review and, eventually, inclusion into the mainline |
@@ -11,7 +14,8 @@ SubmittingDrivers, and SubmitChecklist in the kernel documentation | |||
11 | directory. | 14 | directory. |
12 | 15 | ||
13 | 16 | ||
14 | 5.1: WHEN TO POST | 17 | When to post |
18 | ------------ | ||
15 | 19 | ||
16 | There is a constant temptation to avoid posting patches before they are | 20 | There is a constant temptation to avoid posting patches before they are |
17 | completely "ready." For simple patches, that is not a problem. If the | 21 | completely "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 | |||
27 | with the idea that they can help you drive the work in the right direction. | 31 | with the idea that they can help you drive the work in the right direction. |
28 | 32 | ||
29 | 33 | ||
30 | 5.2: BEFORE CREATING PATCHES | 34 | Before creating patches |
35 | ----------------------- | ||
31 | 36 | ||
32 | There are a number of things which should be done before you consider | 37 | There are a number of things which should be done before you consider |
33 | sending patches to the development community. These include: | 38 | sending patches to the development community. These include: |
@@ -52,7 +57,8 @@ As a general rule, putting in some extra thought before posting code almost | |||
52 | always pays back the effort in short order. | 57 | always pays back the effort in short order. |
53 | 58 | ||
54 | 59 | ||
55 | 5.3: PATCH PREPARATION | 60 | Patch preparation |
61 | ----------------- | ||
56 | 62 | ||
57 | The preparation of patches for posting can be a surprising amount of work, | 63 | The preparation of patches for posting can be a surprising amount of work, |
58 | but, once again, attempting to save time here is not generally advisable | 64 | but, 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 | |||
122 | done. When done properly, though, it is time well spent. | 128 | done. When done properly, though, it is time well spent. |
123 | 129 | ||
124 | 130 | ||
125 | 5.4: PATCH FORMATTING AND CHANGELOGS | 131 | Patch formatting and changelogs |
132 | ------------------------------- | ||
126 | 133 | ||
127 | So now you have a perfect series of patches for posting, but the work is | 134 | So now you have a perfect series of patches for posting, but the work is |
128 | not done quite yet. Each patch needs to be formatted into a message which | 135 | not 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 | |||
192 | detail in the SubmittingPatches document; what follows here is a brief | 201 | detail in the SubmittingPatches document; what follows here is a brief |
193 | summary. Each of these lines has the format: | 202 | summary. 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 | ||
197 | The tags in common use are: | 208 | The tags in common use are: |
@@ -225,7 +236,8 @@ Be careful in the addition of tags to your patches: only Cc: is appropriate | |||
225 | for addition without the explicit permission of the person named. | 236 | for addition without the explicit permission of the person named. |
226 | 237 | ||
227 | 238 | ||
228 | 5.5: SENDING THE PATCH | 239 | Sending the patch |
240 | ----------------- | ||
229 | 241 | ||
230 | Before you mail your patches, there are a couple of other things you should | 242 | Before you mail your patches, there are a couple of other things you should |
231 | take care of: | 243 | take care of: |
@@ -287,6 +299,8 @@ obvious maintainer, Andrew Morton is often the patch target of last resort. | |||
287 | Patches need good subject lines. The canonical format for a patch line is | 299 | Patches need good subject lines. The canonical format for a patch line is |
288 | something like: | 300 | something 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 | ||
292 | where "nn" is the ordinal number of the patch, "mm" is the total number of | 306 | where "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 @@ | |||
1 | 6: FOLLOWTHROUGH | 1 | .. _development_followthrough: |
2 | |||
3 | Followthrough | ||
4 | ============= | ||
2 | 5 | ||
3 | At this point, you have followed the guidelines given so far and, with the | 6 | At this point, you have followed the guidelines given so far and, with the |
4 | addition of your own engineering skills, have posted a perfect series of | 7 | addition 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 | |||
16 | prevent the inclusion of your patches into the mainline. | 19 | prevent the inclusion of your patches into the mainline. |
17 | 20 | ||
18 | 21 | ||
19 | 6.1: WORKING WITH REVIEWERS | 22 | Working with reviewers |
23 | ---------------------- | ||
20 | 24 | ||
21 | A patch of any significance will result in a number of comments from other | 25 | A patch of any significance will result in a number of comments from other |
22 | developers as they review the code. Working with reviewers can be, for | 26 | developers 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 | |||
97 | in mind, of course, that he may not agree with you either. | 101 | in mind, of course, that he may not agree with you either. |
98 | 102 | ||
99 | 103 | ||
100 | 6.2: WHAT HAPPENS NEXT | 104 | What happens next |
105 | ----------------- | ||
101 | 106 | ||
102 | If a patch is considered to be a good thing to add to the kernel, and once | 107 | If a patch is considered to be a good thing to add to the kernel, and once |
103 | most of the review issues have been resolved, the next step is usually | 108 | most 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 | |||
177 | afterward. | 182 | afterward. |
178 | 183 | ||
179 | 184 | ||
180 | 6.3: OTHER THINGS THAT CAN HAPPEN | 185 | Other things that can happen |
186 | ----------------------------- | ||
181 | 187 | ||
182 | One day, you may open your mail client and see that somebody has mailed you | 188 | One day, you may open your mail client and see that somebody has mailed you |
183 | a patch to your code. That is one of the advantages of having your code | 189 | a 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 @@ | |||
1 | 7: ADVANCED TOPICS | 1 | .. _development_advancedtopics: |
2 | |||
3 | Advanced topics | ||
4 | =============== | ||
2 | 5 | ||
3 | At this point, hopefully, you have a handle on how the development process | 6 | At this point, hopefully, you have a handle on how the development process |
4 | works. There is still more to learn, however! This section will cover a | 7 | works. There is still more to learn, however! This section will cover a |
5 | number of topics which can be helpful for developers wanting to become a | 8 | number of topics which can be helpful for developers wanting to become a |
6 | regular part of the Linux kernel development process. | 9 | regular part of the Linux kernel development process. |
7 | 10 | ||
8 | 7.1: MANAGING PATCHES WITH GIT | 11 | Managing patches with git |
12 | ------------------------- | ||
9 | 13 | ||
10 | The use of distributed version control for the kernel began in early 2002, | 14 | The use of distributed version control for the kernel began in early 2002, |
11 | when Linus first started playing with the proprietary BitKeeper | 15 | when 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 | |||
114 | thing happening; putting up a git tree with unreviewed or off-topic patches | 118 | thing happening; putting up a git tree with unreviewed or off-topic patches |
115 | can affect your ability to get trees pulled in the future. Quoting Linus: | 119 | can 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 | |||
141 | sure that you have remembered to push those changes to the public server. | 147 | sure that you have remembered to push those changes to the public server. |
142 | 148 | ||
143 | 149 | ||
144 | 7.2: REVIEWING PATCHES | 150 | Reviewing patches |
151 | ----------------- | ||
145 | 152 | ||
146 | Some readers will certainly object to putting this section with "advanced | 153 | Some readers will certainly object to putting this section with "advanced |
147 | topics" on the grounds that even beginning kernel developers should be | 154 | topics" 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 @@ | |||
1 | 8: FOR MORE INFORMATION | 1 | .. _development_conclusion: |
2 | |||
3 | For more information | ||
4 | ==================== | ||
2 | 5 | ||
3 | There are numerous sources of information on Linux kernel development and | 6 | There are numerous sources of information on Linux kernel development and |
4 | related topics. First among those will always be the Documentation | 7 | related 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 | ||
50 | 9: CONCLUSION | 53 | Conclusion |
54 | ========== | ||
51 | 55 | ||
52 | Congratulations to anybody who has made it through this long-winded | 56 | Congratulations to anybody who has made it through this long-winded |
53 | document. Hopefully it has provided a helpful understanding of how the | 57 | document. 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 @@ | |||
1 | A guide to the Kernel Development Process | ||
2 | ========================================= | ||
3 | |||
4 | Contents: | ||
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 | |||
19 | The purpose of this document is to help developers (and their managers) | ||
20 | work with the development community with a minimum of frustration. It is | ||
21 | an attempt to document how this community works in a way which is | ||
22 | accessible to those who are not intimately familiar with Linux kernel | ||
23 | development (or, indeed, free software development in general). While | ||
24 | there is some technical material here, this is very much a process-oriented | ||
25 | discussion which does not require a deep knowledge of kernel programming to | ||
26 | understand. | ||
27 | |||