A development process document
Jonathan Corbet
maintainerRFC PATCH 1/1 A development process document
For a little while now I've been working on an introductory document for developers and their employers; it's supposed to be a gentle introduction to the kernel development process. Here it is in its rather long-winded entirety. I'm interested in comments and ways to make it better - especially in places where I've said something especially stupid or missed an important point. I'm sure there must be plenty of both...
Thanks,
jon
---
This is an extended document intended to help interested developers, their managers, and their employers work with the kernel development process.
This work was supported by the Linux Foundation.
--- Documentation/00-INDEX | 3 + Documentation/development-process/1.Intro | 216 ++++++++++ Documentation/development-process/2.Process | 450 ++++++++++++++++++++ Documentation/development-process/3.Early-stage | 190 ++++++++ Documentation/development-process/4.Coding | 375 ++++++++++++++++ Documentation/development-process/5.Posting | 262 ++++++++++++ Documentation/development-process/6.Followthrough | 192 +++++++++ Documentation/development-process/7.AdvancedTopics | 176 ++++++++ Documentation/development-process/8.Conclusion | 73 ++++ 9 files changed, 1937 insertions(+), 0 deletions(-) create mode 100644 Documentation/development-process/1.Intro create mode 100644 Documentation/development-process/2.Process create mode 100644 Documentation/development-process/3.Early-stage create mode 100644 Documentation/development-process/4.Coding create mode 100644 Documentation/development-process/5.Posting create mode 100644 Documentation/development-process/6.Followthrough create mode 100644 Documentation/development-process/7.AdvancedTopics create mode 100644 Documentation/development-process/8.Conclusion
Documentation/00-INDEX +3 -0
@@ -21,6 +21,9 @@ Changes - list of changes that break older software packages. CodingStyle - how the boss likes the C code in the kernel to look. +development-process/ + - An extended tutorial on how to work with the kernel development + process. DMA-API.txt - DMA API, pci_ API & extensions for non-consistent memory machines. DMA-ISA-LPC.txt
Documentation/development-process/1.Intro new file +216 -0
216 lines not on this page · raw message
Documentation/development-process/2.Process new file +450 -0
450 lines not on this page · raw message
Documentation/development-process/3.Early-stage new file +190 -0
190 lines not on this page · raw message
Documentation/development-process/4.Coding new file +375 -0
375 lines not on this page · raw message
Documentation/development-process/5.Posting new file +262 -0
262 lines not on this page · raw message
Documentation/development-process/6.Followthrough new file +192 -0
192 lines not on this page · raw message
Documentation/development-process/7.AdvancedTopics new file +176 -0
176 lines not on this page · raw message
Documentation/development-process/8.Conclusion new file +73 -0
73 lines not on this page · raw message
Signature · 1 line
1.5.6.4
Quoted 7 lines · On Tue, 29 Jul 2008 14:30:15 -0600 Jonathan Corbet <[email protected]> wrote:
For a little while now I've been working on an introductory document for developers and their employers; it's supposed to be a gentle introduction to the kernel development process. Here it is in its rather long-winded entirety. I'm interested in comments and ways to make it better - especially in places where I've said something especially stupid or missed an important point. I'm sure there must be plenty of both...
Is good. Thanks for doing this. (pokes Greg)
I wonder a bit whether a ./Documentation update is the best way to present this. Rather than, say, http://www.kernel.org/read-this.html.
The latter may be easier for you to update, and we won't have the problem of people reading two-year-old versions of the document.
We can do both, I guess. No strong opinions here.
Review
Quoted 5 lines
...
(quoted diff) +2
-0+The Linux kernel, at over 6 million lines of code and 2000 active +contributors,
I suspect the "2000 active developers" is a bit hypey. Is a 0.5 patch/annum developer "active"?
Quoted 52 lines
...
+1.2: THE IMPORTANCE OF GETTING CODE INTO THE MAINLINE
Documentation/development-process/1.Intro new file +48
-0+ +Some companies and developers occasionally wonder why they should bother +learning how to work with the kernel community and get their code into the +mainline kernel (the "mainline" being the kernel maintained by Linus +Torvalds and used as a base by Linux distributors). In the short term, +contributing code can look like an avoidable expense; it seems easier to +just keep the code separate and support users directly. The truth of the +matter is that keeping code separate ("out of tree") is a false economy. + +As a way of illustrating the costs of out-of-tree code, here are a few +relevant aspects of the kernel development process; most of these will be +discussed in greater detail later in this document. Consider: + +- Code which has been merged into the mainline kernel is available to all + Linux users. It will automatically be present on all distributions which + enable it. There is no need for driver disks, downloads, or the hassles + of supporting multiple versions of multiple distributions; it all just + works, for the developer and for the user. Incorporation into the + mainline solves a large number of distribution and support problems. + +- While kernel developers strive to maintain a stable interface to user + space, the internal kernel API is in constant flux. The lack of a stable + internal interface is a deliberate design decision; it allows fundamental + improvements to be made at any time and results in higher-quality code. + But one result of that policy is that any out-of-tree code requires + constant upkeep if it is to work with new kernels. Maintaining + out-of-tree code requires significant amounts of work just to keep that + code working. + + Code which is in the mainline, instead, does not require this work as the + result of a simple rule requiring developers to fix any code which breaks + as the result of an API change. So code which has been merged into the + mainline has significantly lower maintenance costs. + +- Beyond that, code which is in the kernel will often be improved by other + developers. Surprising results can come from empowering your user + community and customers to improve your product. + +- Kernel code is subjected to review, both before and after merging into + the mainline. No matter how strong the original developer's skills are, + this review process invariably finds ways in which the code can be + improved. Often review finds severe bugs and security problems. This is + especially true for code which has been developed in an closed + environment; such code benefits strongly from review by outside + developers. Out-of-tree code is lower-quality code. + +- Participation in the development process is your way to influence the + direction of kernel development. Users who complain from the sidelines
Documentation/development-process/1.Intro line 133
Quoted 10 lines
Documentation/development-process/1.Intro new file +10
-0+ are heard, but active developers have a stronger voice - and the ability + to implement changes which make the kernel work better for their needs. + +- Contribution of code is the fundamental action which makes the whole + process work. By contributing your code you can add new functionality to + the kernel and provide capabilities and examples which are of use to + other kernel developers. If you have developed code for Linux (or are + thinking about doing so), you clearly have an interest in the continued + success of this platform; contributing code is one of the best ways to + help ensure that success.
Also: if the code is kept out-of-tree then there is a risk that someone else's similar feature will be merged in mainline. So you end up owning (and maintaining) a similar-but-different feature to something which is already available. Either that, or you need to migrate your developers and/or users over to the new implementation, with all that this entails.
otoh, if you merge your feature, it's the other guy who gets to cry over the above paragraph.
Quoted 20 lines
...
Documentation/development-process/2.Process new file +17
-0+There are a few hints which can help with linux-kernel survival: + +- Have the list delivered to a separate folder, rather than your main + mailbox. One must be able to ignore the stream for sustained periods of + time. + +- Do not try to follow every conversation - nobody else does. It is + important to filter on both the topic of interest (though note that + long-running conversations can drift away from the original subject + without changing the email subject line) and the people who are + participating. + +- Do not feed the trolls. If somebody is trying to stir up an angry + response, ignore them. + +- When responding to linux-kernel email (or that on other lists) preserve + the Cc: header for all involved. In the absence of a strong reason (such
Documentation/development-process/2.Process line 400
Quoted 10 lines
Documentation/development-process/2.Process new file +10
-0+ as an explicit request), you should never remove recipients. Always make + sure that the person you are responding to is in the Cc: list. + +- Search the list archives (and the net as a whole) before asking + questions. Some developers can get impatient with people who clearly + have not done their homework. + +- Ask on the correct mailing list. Linux-kernel may be the general meeting + point, but it is not the best place to find developers from all + subsystems.
- don't top-post :( It creates a rather poor impression.
Quoted 33 lines
Documentation/development-process/2.Process new file +33
-0+The last point - finding the correct mailing list - is a common place for +beginning developers to go wrong. Somebody who asks a networking-related +question on linux-kernel will almost certainly receive a polite suggestion +to ask on the netdev list instead, as that is the list frequented by most +networking developers. Other lists exist for the SCSI, video4linux, IDE, +filesystem, etc. subsystems. The best place to look for mailing lists is +in the MAINTAINERS file packaged with the kernel source. + + +2.7: GETTING STARTED WITH KERNEL DEVELOPMENT + +Questions about how to get started with the kernel development process are +common - from both individuals and companies. Equally common are missteps +which make the beginning of the relationship harder than it has to be. + +Companies often look to hire well-known developers to get a development +group started. This can, in fact, be an effective technique. But it also +tends to be expensive and does not do much to grow the pool of experienced +kernel developers. It is possible to bring in-house developers up to speed +on Linux kernel development, given the investment of a bit of time. Taking +this time can endow an employer with a group of developers who understand +the kernel and the company both, and who can help to train others as well. +Over the medium term, this is often the more profitable approach. + +Individual developers are often, understandably, at a loss for a place to +start. Beginning with a large project can be intimidating; one often wants +to test the waters with something smaller first. This is the point where +some developers jump into the creation of patches fixing spelling errors or +minor coding style issues. Unfortunately, such patches create a level of +noise which is distracting for the development community as a whole, so, +increasingly, they are looked down upon. New developers wishing to +introduce themselves to the community will not get the sort of reception +they wish for by these means.
Documentation/development-process/2.Process line 444
Quoted 10 lines
Documentation/development-process/2.Process new file +10
-0+ +Andrew Morton gives this advice for aspiring kernel developers + + The #1 project for all kernel beginners should surely be "make sure + that the kernel runs perfectly at all times on all machines which + you can lay your hands on". Usually the way to do this is to work + with others on getting things fixed up (this can require + persistence!) but that's fine - it's a part of kernel development. + +(http://lwn.net/Articles/283982/).
wise chap.
Quoted 13 lines
...
+3.3: WHO DO YOU TALK TO?
Documentation/development-process/3.Early-stage new file +9
-0+ +When developers decide to take their plans public, the next question will +be: where do we start? The answer is to find the right mailing list(s) and +the right maintainer. For mailing lists, the best approach is to look in +the MAINTAINERS file for a relevant place to post. If there is a suitable +subsystem list, posting there is often preferable to posting on +linux-kernel; you are more likely to reach developers with expertise in the +relevant subsystem and the environment may be more supportive. +
Documentation/development-process/3.Early-stage line 137
Quoted 10 lines
Documentation/development-process/3.Early-stage new file +10
-0+Finding maintainers can be a bit harder. Again, the MAINTAINERS file is +the place to start. That file tends to not always be up to date, though, +and not all subsystems are represented there. The person listed in the +MAINTAINERS file may, in fact, not be the person who is actually acting in +that role currently. So, when there is doubt about who to contact, a +useful trick is to use git (and "git log" in particular) to see who is +currently active within the subsystem of interest. Look at who is writing +patches, and who, if anybody, is attaching Signed-off-by lines to those +patches. Those are the people who be best placed to help with a new +development project.
I guess it's worth mentioning that if you can't find the right person, or if the right person won't talk to you, try akpm@...
Quoted 11 lines
...
Documentation/development-process/4.Coding new file +8
-0+Other kinds of errors can be found with the "sparse" static analysis tool. +With sparse, the programmer can be warned about confusion between +user-space and kernel-space addresses, mixture of big-endian and +small-endian quantities, the passing of integer values where a set of bit +flags is expected, and so on. Sparse must be installed separately (it can +be found at http://www.kernel.org/pub/software/devel/sparse/ if your +distributor does not package it); it can then be run on the code using the +C=1 flag to make.
Documentation/development-process/4.Coding line 294
Quoted 10 lines
Documentation/development-process/4.Coding new file +10
-0+ +Other kinds of portability errors are best found by compiling your code for +other architectures. If you do not happen to have an S/390 system or a +Blackfin development board handy, you can still perform the compilation +step. A full set of cross compilers for x86 systems can be found at + + http://www.kernel.org/pub/tools/crosstool/ + +Some time spent installing and using these compilers will help avoid +embarrassment later.
It might be worth mentioning Documentation/SubmitChecklist. Although I sometimes think we should translate it into Swahili and see how long it takes for someone to notice.
Quoted 2 lines
+
+4.3: DOCUMENTATION
I think changelogging deserves its own section. It's so important for smooth progress, and is often done so poorly.
Quoted 4 lines
...
+5: POSTING PATCHES
Documentation/development-process/5.Posting line 11
Quoted 10 lines
Documentation/development-process/5.Posting new file +10
-0+ +Sooner or later, the time comes when your work is ready to be presented to +the community for review and, eventually, inclusion into the mainline +kernel. Unsurprisingly, the kernel development community has evolved a set +of conventions and procedures which are used in the posting of patches; +following them will make life much easier for everybody involved. This +document will attempt to cover these expectations in reasonable detail; +more information can also be found in the files SubmittingPatches, +SubmittingDrivers, and SubmitChecklist in the kernel documentation +directory.
ooh, there it is.
Quoted 16 lines
...
Documentation/development-process/6.Followthrough new file +13
-0+What all of this comes down to is that, when reviewers send you comments, +you need to pay attention to the technical observations that they are +making. Do not let their form of expression or your own pride keep that +from happening. When you get review comments on a patch, take the time to +understand what the reviewer is trying to say. If possible, fix the things +that the reviewer is asking you to fix. And respond back to the reviewer: +thank them, and describe how you will answer their questions. + +Note that you do not have to agree with every change suggested by +reviewers. If you believe that the reviewer has misunderstood your code, +explain what is really going on. If you have a technical objection to a +suggested change, describe it and justify your solution to the problem. If +your explanations make sense, the reviewer will accept them. Should your
Documentation/development-process/6.Followthrough line 72
Quoted 10 lines
Documentation/development-process/6.Followthrough new file +10
-0+explanation not prove persuasive, though, especially if others start to +agree with the reviewer, take some time to think things over again. It can +be easy to become blinded by your own solution to a problem to the point +that you don't realize that something is fundamentally wrong or, perhaps, +you're not even solving the right problem. + +One fatal mistake is to ignore review comments in the hope that they will +go away. They will not go away. If you repost code without having +responded to the comments you got the time before, you're likely to find +that your patches go nowhere.
Yeah.
One quite dispiriting thing for a reviewer is to spend an hour reading and commenting, and then to get a complete new version of the patchset a week later with no accounting of the earlier review comments. Plus for the reviewer, that was hundreds of patches ago, so your patch has been forgotten about.
I think there are two ways of addressing this
a) reply to the reviewer's reply, dispositively addressing each of the points individually, then send a new patch or
b) send an incremental patch, with all the changed things bullet-pointed in the changelog.
or both.
But the key point here is to not present the guy with a whole new patch which he has to re-review from scratch, wondering what he's missed from last time.
Quoted 8 lines
...
Documentation/development-process/6.Followthrough new file +5
-0+What may also happen at this point, depending on the nature of your patch, +is that conflicts with work being done by others turn up. In the worst +case, heavy patch conflicts can result in some work being put on the back +burner so that the remaining patches can be worked into shape and merged. +Other times, conflict resolution will involve working with the other
Documentation/development-process/6.Followthrough line 123
Quoted 10 lines
Documentation/development-process/6.Followthrough new file +10
-0+developers and, possibly, moving some patches between trees to ensure that +everything applies cleanly. This work can be a pain, but count your +blessings: before the advent of the linux-next tree, these conflicts often +only turned up during the merge window and had to be addressed in a hurry. +Now they can be resolved at leisure, before the merge window opens. + +Some day, if all goes well, you'll log on and see that your patch has been +merged into the mainline kernel. Congratulations! Once the celebration is +complete, though, it is worth remembering an important little fact: the job +still is not done. Merging into the mainline brings its own challenges.
Don't forget to add yourself to ./MAINTAINERS. And create a bugzilla account.
Jonathan Corbet
maintainerQuoted 5 lines · On Wed, 30 Jul 2008 00:15:08 -0700 Andrew Morton <[email protected]>…
I wonder a bit whether a ./Documentation update is the best way to present this. Rather than, say,
http://www.kernel.org/read-this.html. The latter may be easier for you to update, and we won't have the problem of people reading two-year-old versions of the document.
I think LF wants to put it up somewhere; kernel.org is certainly a possibility too. OTOH if it's in the kernel source, others could update it too. I've always really liked the way stuff in Documentation/ stays current...
Quoted 5 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+The Linux kernel, at over 6 million lines of code and 2000 active +contributors,I suspect the "2000 active developers" is a bit hypey. Is a 0.5 patch/annum developer "active"?
I was going with 1.0/year as a working number. The period v2.6.22..v2.6.26 (July 8, 2007 to July 13, 2008) had 2294 distinct contributors. About 1000 of those were a single patch. If we say that >= 2.0 is active, then the number goes to 1200. I could just say "over 1000" and be happy with that, I guess.
Quoted 2 lines
Also: if the code is kept out-of-tree then there is a risk that someone else's similar feature will be merged in mainline.
Good point, I'll add that. Everything else you pointed out is good too, consider it all added. After LWN comes out, anyway. Thanks for taking the time to read through it all.
jon
Documentation/development-process/2.Process line 58
Quoted 6 lines · Jonathan Corbet
Documentation/development-process/2.Process new file +6
-0+Over the next six to ten weeks, only patches which fix problems should be +submitted to the mainline. On occasion a more significant change will be +allowed, but such occasions are rare; developers who try to merge new +features outside of the merge window tend to get an unfriendly reception. +As a general rule, if you miss the merge window for a given feature, the +best thing to do is to wait for the next development cycle.
On the other hand, the drivers for completely new hardware (that has been totally unsupported by the kernel previously, so there is no possibility for introducing regressions) are still allowed even after -rc1, right?
This might be worth explicit note here.
Thanks,
Signature · 2 lines
Jiri Kosina SUSE Labs
At Wed, 30 Jul 2008 13:09:13 +0200 (CEST),
Quoted 14 lines · Jiri Kosina
Documentation/development-process/2.Process line 58
Quoted 6 lines · Jonathan Corbet
Documentation/development-process/2.Process new file +6
-0+Over the next six to ten weeks, only patches which fix problems should be +submitted to the mainline. On occasion a more significant change will be +allowed, but such occasions are rare; developers who try to merge new +features outside of the merge window tend to get an unfriendly reception. +As a general rule, if you miss the merge window for a given feature, the +best thing to do is to wait for the next development cycle.On the other hand, the drivers for completely new hardware (that has been totally unsupported by the kernel previously, so there is no possibility for introducing regressions) are still allowed even after -rc1, right?
Quoted 1 line
This might be worth explicit note here.
I see this argument often in different places.
IMO, the new driver should follow the rule, too, *in general*. RC is an RC, not a beta. Of course, there can be exceptions, though...
just my $0.02.
Takashi
Jonathan Corbet
maintainerQuoted 4 lines · On Wed, 30 Jul 2008 13:09:13 +0200 (CEST) Jiri Kosina <[email protected]> wrote:
On the other hand, the drivers for completely new hardware (that has been totally unsupported by the kernel previously, so there is no possibility for introducing regressions) are still allowed even after -rc1, right?
Clearly it's been known to happen (can you say GRU?). But I don't know that has ever really been adopted as an "official" policy. My preference would be to lay down the merge window rules as a fairly firm thing rather than suggest to people that there might be ways to slip around them sometimes. But, certainly, I'm not tied to that if we want to send a different message.
Thanks,
jon
Quoted 11 lines
Quoted 4 lines
On the other hand, the drivers for completely new hardware (that has been totally unsupported by the kernel previously, so there is no possibility for introducing regressions) are still allowed even after -rc1, right?
Clearly it's been known to happen (can you say GRU?). But I don't know that has ever really been adopted as an "official" policy. My preference would be to lay down the merge window rules as a fairly firm thing rather than suggest to people that there might be ways to slip around them sometimes. But, certainly, I'm not tied to that if we want to send a different message.
I think Linus has said pretty explicitly that he is willing to merge new low-level hardware drivers at pretty much any stage, as long as they are obviously self-contained and can't break anything. As an example of this, the UVC webcam driver was one of the very last things merged just before the final 2.6.26 release, very late in the release cycle.
Obviously there is some judgement involved in what qualifies as new hardware drivers, but Linus also often comes out in favor of thinking about things rather than trying to apply mechanical rules anyway.
Quoted 1 line · Roland Dreier
I think Linus has said pretty explicitly that he is willing to merge new low-level hardware drivers at pretty much any stage, as long as they are obviously self-contained and can't break anything.
Well, I think I understand a little bit this fear of merging new driver that "obviously can't break anything" in arbitrary stage od development. See below.
Quoted 1 line
As an example of this, the UVC webcam driver was one of the very last things merged just before the final 2.6.26 release, very late in the release cycle.
If you have a hardware that hasn't been supported by the previous kernel versions at all, then everything is fine, just no driver is bound to the device, and the device doesn't work. If then -rc9 comes with a shiny new driver for this hardware, it gets autoloaded. If it is buggy, your system crashes. This is regression, right?
Nevertheless, I still think that merging new drivers as fast as possible is a good thing (tm).
Thanks,
Signature · 2 lines
Jiri Kosina SUSE Labs
* Jonathan Corbet <[email protected]>:
Quoted 6 lines
For a little while now I've been working on an introductory document for developers and their employers; it's supposed to be a gentle introduction to the kernel development process. Here it is in its rather long-winded entirety. I'm interested in comments and ways to make it better - especially in places where I've said something especially stupid or missed an important point. I'm sure there must be plenty of both...
Overall, a great document, as expected from you. I've replied with "content" comments below.
I've a few ideas on "style" comments as well, on ways to maybe tighten up the text a bit (too much Strunk & White in my past, I suppose) without changing your style and tone too much.
But it occurs to me that sending "style" comments to the editor of LWN is something akin to, well, some combination of Prometheus, Icarus, ravenous vultures, rabid penguins, and telling Linus that his choice of $EDITOR sucks, which is to say, "unwise".
On the other hand, if you are interested, let me know, and I can make another pass at this with stylistic suggestions.
cheers,
/ac
Quoted 1 line
+2.1: THE BIG PICTURE
[...]
Quoted 1 line
+Once a stable release is made, its ongoing maintenance is passed of to the
^^ "off"
Quoted 1 line
+2.6: MAILING LISTS
[...]
Documentation/development-process/2.Process line 392
Quoted 4 lines
+- When responding to linux-kernel email (or that on other lists) preserve
Documentation/development-process/2.Process new file +3
-0+ the Cc: header for all involved. In the absence of a strong reason (such + as an explicit request), you should never remove recipients. Always make + sure that the person you are responding to is in the Cc: list.
How about, "Do not ask to be Cc'd on the reply 'because you are not a list subscriber'."? The previous convention ensures that you _will_ be cc'ed on any responses.
Documentation/development-process/2.Process line 444
Quoted 9 lines
Documentation/development-process/2.Process new file +9
-0+Andrew Morton gives this advice for aspiring kernel developers + + The #1 project for all kernel beginners should surely be "make sure + that the kernel runs perfectly at all times on all machines which + you can lay your hands on". Usually the way to do this is to work + with others on getting things fixed up (this can require + persistence!) but that's fine - it's a part of kernel development. + +(http://lwn.net/Articles/283982/).
You've got url reference for some quotes but not all. Would it be possible to track them all down? Sorry for asking for all the extra work, but I think the references are useful, especially if the motivated reader actually visits said reference and gets all sides of the story.
Quoted 1 line
+3.2: EARLY DISCUSSION
[...]
Quoted 2 lines
+ - The Reiser4 filesystem included a number of capabilities which, in the
+ core developers' opinion, should have been implemented in the virtual
^^^^^^^^^^^^^^^^
This is slightly ambiguous. Should probably that clarify the existing kernel core developers disagreed with the Reiser4 developers.
Quoted 1 line
+3.3: WHO DO YOU TALK TO?
[...]
Documentation/development-process/3.Early-stage line 137
Quoted 10 lines
Documentation/development-process/3.Early-stage new file +10
-0+Finding maintainers can be a bit harder. Again, the MAINTAINERS file is +the place to start. That file tends to not always be up to date, though, +and not all subsystems are represented there. The person listed in the +MAINTAINERS file may, in fact, not be the person who is actually acting in +that role currently. So, when there is doubt about who to contact, a +useful trick is to use git (and "git log" in particular) to see who is +currently active within the subsystem of interest. Look at who is writing +patches, and who, if anybody, is attaching Signed-off-by lines to those +patches. Those are the people who be best placed to help with a new +development project.
Well, this *almost* describes the trick, but for our imagined newbie audience without any familiarity with git, is probably still confusing. ;)
How about adding an example...
[...] is attaching Signed-off-by lines to those patches. For example, 'git log drivers/pci' will show the history of the PCI subsystem. The recurring Signed-off-by line on each patch should give a clue as to the current PCI maintainer.
Quoted 1 line
+4.1: PITFALLS
[...]
Documentation/development-process/4.Coding line 49
Quoted 9 lines
Documentation/development-process/4.Coding new file +9
-0+The other trap is to assume that code which is already in the kernel is +urgently in need of coding style fixes. Developers may start to generate +reformatting patches as a way of gaining familiarity with the process, or +as a way of getting their name into the kernel changelogs - or both. But +pure coding style fixes are seen as noise by the development community; +they tend to get a chilly reception. So this type of patch is best +avoided. It is natural to fix the style of a piece of code while working +on it for other reasons, but coding style changes should not be made for +their own sake.
If you're going to mention the naturally occurring code cleanups, it might make sense to note that the cleanups should be separated out in a separate patch, to make reviewing the changed logic of the new code easier.
Documentation/development-process/4.Coding line 54
Quoted 5 lines
Documentation/development-process/4.Coding new file +5
-0+ +The coding style document also should not be read as an absolute law which +can never be transgressed. If there is a good reason to go against the +style (a line which becomes far less readable if split to fit within the +80-column limit, for example), just do it.
How about a better example, such as user-visible printk strings should not be broken at the 80-column limit, which improves greppability.
Quoted 10 lines
Documentation/development-process/4.Coding new file +10
-0+Abstraction layers + +Computer Science professors teach students to make extensive use of +abstraction layers in the name of flexibility and information hiding. +Certainly the kernel makes extensive use of abstraction; no project +involving several million lines of code could do otherwise and survive. +But experience has shown that excessive or premature abstraction can be +just as harmful as premature optimization. Abstraction should be used to +the level required and no further. +
Documentation/development-process/4.Coding line 76
Quoted 10 lines
Documentation/development-process/4.Coding new file +10
-0+At a simple level, consider a function which has an argument which is +always passed as zero by all callers. One could retain that argument just +in case somebody eventually needs to use the extra flexibility that it +provides. By that time, though, chances are good that the code which +implements this extra argument has been broken in some subtle way which was +never noticed - because it has never been used. Or, when the need for +extra flexibility arises, it does not do so in a way which matches the +programmer's early expectation. Kernel developers will routinely submit +patches to remove unused arguments; they should, in general, not be added +in the first place.
Hm, I thought this section was going to talk about foo_t and the like, as described in CodingStyle. Agreed, extraneous function args are bad, but they don't seem like a "premature abstraction" problem to me.
Just a thought.
Quoted 1 line
+4.2: CODE CHECKING TOOLS
[...]
Documentation/development-process/4.Coding line 284
Quoted 8 lines
Documentation/development-process/4.Coding new file +8
-0+Other kinds of errors can be found with the "sparse" static analysis tool. +With sparse, the programmer can be warned about confusion between +user-space and kernel-space addresses, mixture of big-endian and +small-endian quantities, the passing of integer values where a set of bit +flags is expected, and so on. Sparse must be installed separately (it can +be found at http://www.kernel.org/pub/software/devel/sparse/ if your +distributor does not package it); it can then be run on the code using the +C=1 flag to make.
That might read better as, "run on the code passing the C=1 flag to make."
Documentation/development-process/4.Coding line 291
Quoted 7 lines
Documentation/development-process/4.Coding new file +7
-0+ +Other kinds of portability errors are best found by compiling your code for +other architectures. If you do not happen to have an S/390 system or a +Blackfin development board handy, you can still perform the compilation +step. A full set of cross compilers for x86 systems can be found at + + http://www.kernel.org/pub/tools/crosstool/
Hm, "full set" is debatable. I don't see pa-risc, for example. ;)
Quoted 1 line
+4.3: DOCUMENTATION
[...]
Documentation/development-process/4.Coding line 324
Quoted 7 lines
Documentation/development-process/4.Coding new file +7
-0+Internal API information for many subsystems is documented by way of +specially-formatted comments; these comments can be extracted and formatted +in a number of ways by the "kernel-doc" script. If you are working within +a subsystem which has kerneldoc comments, you should maintain them and add +them, as appropriate, for externally-available functions. Even in areas +which have not been so documented, there is no harm in adding kerneldoc +comments for the future. The format of these comments, along with some
It might be noted that adding kerneldoc for undocumented functions *is* a great way for newbies to participate and ramp up in a quite-welcome way, as opposed to whitespace/coding style patches.
Quoted 1 line
+5.3: PATCH PREPARATION
[...]
Documentation/development-process/5.Posting line 63
Quoted 3 lines
Documentation/development-process/5.Posting new file +3
-0+Patches must be prepared against a specific version of the kernel. As a +general rule, a patch should be based on the current mainline as found in +Linus's git tree. It may become necessary to make versions against -mm,
^^^^^^^
Hm, is this the new recommended style? Grammar school taught me that it should be "Linus'" but I've noticed a gradually changing but inconsistently applied new school style.
Just curious.
Quoted 1 line
+5.5: SENDING THE PATCH
[...]
Documentation/development-process/5.Posting line 256
Quoted 2 lines
Documentation/development-process/5.Posting new file +2
-0+If you have a significant series of patches, it is customary to send an +introductory description as part zero. In general, the second and
This directly conflicts with akpm's advice:
http://www.zipworld.com.au/~akpm/linux/patches/stuff/tpp.txt
Section 6(b).
Who wins? :)
Quoted 2 lines · On Thu, 31 Jul 2008 00:23:05 -0600 Alex Chiang <[email protected]> wrote:
Overall, a great document, as expected from you. I've replied with "content" comments below.
I've applied most of them, thanks.
Quoted 4 lines
But it occurs to me that sending "style" comments to the editor of LWN is something akin to, well, some combination of Prometheus, Icarus, ravenous vultures, rabid penguins, and telling Linus that his choice of $EDITOR sucks, which is to say, "unwise".
Naw, English always needs debugging too.
Quoted 5 lines
You've got url reference for some quotes but not all. Would it be possible to track them all down? Sorry for asking for all the extra work, but I think the references are useful, especially if the motivated reader actually visits said reference and gets all sides of the story.
I'll see what I can do. Some of the older ones are kind of hard to find.
Quoted 8 lines
Quoted 4 lines
+Patches must be prepared against a specific version of the kernel. As a +general rule, a patch should be based on the current mainline as found in +Linus's git tree. It may become necessary to make versions against -mm,
^^^^^^^
Hm, is this the new recommended style? Grammar school taught me that it should be "Linus'" but I've noticed a gradually changing but inconsistently applied new school style.
I actually researched that a while back. The rule, as far as I can tell (and to the extent that English has real rules) is that the trailing "s" is elided only when making a possessive of a plural noun. "Linus", being very much a unique, singular entity, needs to be "Linus's" in the possessive form.
Quoted 9 lines
Quoted 3 lines
+If you have a significant series of patches, it is customary to send an +introductory description as part zero. In general, the second and
This directly conflicts with akpm's advice:
http://www.zipworld.com.au/~akpm/linux/patches/stuff/tpp.txt
Section 6(b).
Interesting; Andrew didn't mention that in his review. I think the intro postings can be very useful in understanding a patch series as a whole. Maybe I'll put in something about how anything which should be in the changelogs needs to go with the actual patches.
Thanks,
jon
Quoted 44 lines · Jonathan Corbet
Quoted 2 lines · On Thu, 31 Jul 2008 00:23:05 -0600 Alex Chiang <[email protected]> wrote:
Overall, a great document, as expected from you. I've replied with "content" comments below.
I've applied most of them, thanks.
Quoted 4 lines
But it occurs to me that sending "style" comments to the editor of LWN is something akin to, well, some combination of Prometheus, Icarus, ravenous vultures, rabid penguins, and telling Linus that his choice of $EDITOR sucks, which is to say, "unwise".
Naw, English always needs debugging too.
Quoted 5 lines
You've got url reference for some quotes but not all. Would it be possible to track them all down? Sorry for asking for all the extra work, but I think the references are useful, especially if the motivated reader actually visits said reference and gets all sides of the story.
I'll see what I can do. Some of the older ones are kind of hard to find.
Quoted 8 lines
Quoted 4 lines
+Patches must be prepared against a specific version of the kernel. As a +general rule, a patch should be based on the current mainline as found in +Linus's git tree. It may become necessary to make versions against -mm,
^^^^^^^
Hm, is this the new recommended style? Grammar school taught me that it should be "Linus'" but I've noticed a gradually changing but inconsistently applied new school style.I actually researched that a while back. The rule, as far as I can tell (and to the extent that English has real rules) is that the trailing "s" is elided only when making a possessive of a plural noun. "Linus", being very much a unique, singular entity, needs to be "Linus's" in the possessive form.
Quoted 6 lines
Quoted 3 lines
+If you have a significant series of patches, it is customary to send an +introductory description as part zero. In general, the second and
This directly conflicts with akpm's advice:
Quoted 8 lines
Quoted 3 lines
http://www.zipworld.com.au/~akpm/linux/patches/stuff/tpp.txt
Section 6(b).
Interesting; Andrew didn't mention that in his review. I think the intro postings can be very useful in understanding a patch series as a whole. Maybe I'll put in something about how anything which should be in the changelogs needs to go with the actual patches.
If you include a [0/N], it's a cover letter, not a changelog portion. It can be a useful way of providing context to reviewers as to the intended total effect. Each of the patches should make sense standalone, but it's not always clear from the individual patches what the total benefit is, and a 0/N that explains can be worthwhile (and you'd want to make that announcement to the mailing list, but not get it into the history).
For example, if you have a series of patches that remove use of an old API from various places, each of those patches cleans up some piece of code, and these changelogs would say so, but it wouldn't be accurate (especially if 5/N gets dropped or reverted later) to say anywhere that you've removed all in-kernel use of the API; it's useful to include a cover letter that says so.
The same sort of text can be included in individual patches, after the tags and before the patch text, by putting a line '---' ahead of it; git, by default, puts a per-patch diffstat there, but you can add other stuff that will be helpful to reviewers but not future developers, like "this should fix Andrew's laptop".
-Daniel
*This .sig left intentionally blank*
Quoted 55 lines · Daniel Barkalow
Quoted 44 lines · Jonathan Corbet
Quoted 2 lines · On Thu, 31 Jul 2008 00:23:05 -0600 Alex Chiang <[email protected]> wrote:
Overall, a great document, as expected from you. I've replied with "content" comments below.
I've applied most of them, thanks.
Quoted 4 lines
But it occurs to me that sending "style" comments to the editor of LWN is something akin to, well, some combination of Prometheus, Icarus, ravenous vultures, rabid penguins, and telling Linus that his choice of $EDITOR sucks, which is to say, "unwise".
Naw, English always needs debugging too.
Quoted 5 lines
You've got url reference for some quotes but not all. Would it be possible to track them all down? Sorry for asking for all the extra work, but I think the references are useful, especially if the motivated reader actually visits said reference and gets all sides of the story.
I'll see what I can do. Some of the older ones are kind of hard to find.
Quoted 8 lines
Quoted 4 lines
+Patches must be prepared against a specific version of the kernel. As a +general rule, a patch should be based on the current mainline as found in +Linus's git tree. It may become necessary to make versions against -mm,
^^^^^^^
Hm, is this the new recommended style? Grammar school taught me that it should be "Linus'" but I've noticed a gradually changing but inconsistently applied new school style.I actually researched that a while back. The rule, as far as I can tell (and to the extent that English has real rules) is that the trailing "s" is elided only when making a possessive of a plural noun. "Linus", being very much a unique, singular entity, needs to be "Linus's" in the possessive form.
Quoted 6 lines
Quoted 3 lines
+If you have a significant series of patches, it is customary to send an +introductory description as part zero. In general, the second and
This directly conflicts with akpm's advice:
Quoted 8 lines
Quoted 3 lines
http://www.zipworld.com.au/~akpm/linux/patches/stuff/tpp.txt
Section 6(b).
Interesting; Andrew didn't mention that in his review. I think the intro postings can be very useful in understanding a patch series as a whole. Maybe I'll put in something about how anything which should be in the changelogs needs to go with the actual patches.
Quoted 6 lines
If you include a [0/N], it's a cover letter, not a changelog portion. It can be a useful way of providing context to reviewers as to the intended total effect. Each of the patches should make sense standalone, but it's not always clear from the individual patches what the total benefit is, and a 0/N that explains can be worthwhile (and you'd want to make that announcement to the mailing list, but not get it into the history).
but.. but Andrew often has to take part(s) of #0/N and add them to the changelog(s) to make the changelog(s) meaningful. I.e., someone skimped on what should have been in the changelog(s).
Quoted 7 lines
For example, if you have a series of patches that remove use of an old API from various places, each of those patches cleans up some piece of code, and these changelogs would say so, but it wouldn't be accurate (especially if 5/N gets dropped or reverted later) to say anywhere that you've removed all in-kernel use of the API; it's useful to include a cover letter that says so.
Quoted 5 lines
The same sort of text can be included in individual patches, after the tags and before the patch text, by putting a line '---' ahead of it; git, by default, puts a per-patch diffstat there, but you can add other stuff that will be helpful to reviewers but not future developers, like "this should fix Andrew's laptop".
Yes, that's a good place for such comments.
Signature · 1 line
~Randy
Quoted 26 lines · Randy.Dunlap
Quoted 18 lines · Daniel Barkalow
Quoted 8 lines · Jonathan Corbet
Quoted 6 lines · On Thu, 31 Jul 2008 00:23:05 -0600 Alex Chiang <[email protected]> wrote:
Quoted 3 lines
+If you have a significant series of patches, it is customary to send an +introductory description as part zero. In general, the second and
This directly conflicts with akpm's advice:
Quoted 8 lines
Quoted 3 lines
http://www.zipworld.com.au/~akpm/linux/patches/stuff/tpp.txt
Section 6(b).
Interesting; Andrew didn't mention that in his review. I think the intro postings can be very useful in understanding a patch series as a whole. Maybe I'll put in something about how anything which should be in the changelogs needs to go with the actual patches.
Quoted 6 lines
If you include a [0/N], it's a cover letter, not a changelog portion. It can be a useful way of providing context to reviewers as to the intended total effect. Each of the patches should make sense standalone, but it's not always clear from the individual patches what the total benefit is, and a 0/N that explains can be worthwhile (and you'd want to make that announcement to the mailing list, but not get it into the history).
Quoted 3 lines
but.. but Andrew often has to take part(s) of #0/N and add them to the changelog(s) to make the changelog(s) meaningful. I.e., someone skimped on what should have been in the changelog(s).
That would not be a problem with the cover posting, it would be a problem with the changelogs. The same applies if the respective information is put below the '---' delimiter line in the individual patch postings. So just remember that changelogs need to be sufficiently comprehensive even when read standalone, out of the context of the series.
BTW, I always like to see the -> combined diffstat <- of the whole patch series in 0/N cover postings. For this reason alone, a cover posting is IMO generally recommendable for series of more than three or four patches. Especially if the reason for posting is a request for review rather than transfer to a maintainer.
I think Andrew's advice in tpp is very valid in order to create "the perfect patch", but not really how to post "the perfect review request".
Signature · 3 lines
Stefan Richter -=====-==--- =--- ----= http://arcgraph.de/sr/
Quoted 10 lines · Stefan Richter
Quoted 3 lines · Randy.Dunlap
but.. but Andrew often has to take part(s) of #0/N and add them to the changelog(s) to make the changelog(s) meaningful. I.e., someone skimped on what should have been in the changelog(s).
That would not be a problem with the cover posting, it would be a problem with the changelogs. The same applies if the respective information is put below the '---' delimiter line in the individual patch postings.
Or, for that matter, left out entirely. Or in the first actual patch of the series, since people will often be looking through the log filtered in some way, or bisect or blame will take them to the middle of the series.
Quoted 2 lines
So just remember that changelogs need to be sufficiently comprehensive even when read standalone, out of the context of the series.
I think this would be a good statement to include in the section about changelogs.
-Daniel
*This .sig left intentionally blank*
Hi Jon,
Some more minor issues (disclaimer: I am not a native speaker of English).
2008/7/29 Jonathan Corbet <[email protected]>:
Documentation/development-process/1.Intro
Quoted 6 lines
Documentation/development-process/1.Intro new file +6
-0+One of the most compelling features of Linux is that it is accessible to +these developers; anybody with the requisite skills can improve Linux and +influence the direction of its development. Proprietary products cannot +offer this kind of openness, which is a characteristic of the free software +process. But, if anything, the kernel is open even than most other free +software projects. ...
This last sentence looks strange to me. Maybe a "more" is missing somehow? [ I sent this one before, but forgot the proper Cc:s. Sorry about that. ]
Review
Quoted 2 lines
(quoted diff) +2
-0+Years of experience with the kernel development community has taught a +clear lesson: ...
"have taught"?
Quoted 1 line
+5.5: SENDING THE PATCH
Maybe somewhere in this section say something about avoiding HTML email and attachments?
Documentation/development-process/5.Posting line 174
Quoted 5 lines
+ - Signed-off-by: this is a developer's certification that he or she has
Documentation/development-process/5.Posting new file +4
-0+ the right to submit the patch for inclusion into the kernel. It is an + agreement to the Developer's Certificate of Origin, the full text of + which can be found in SubmittingPatches. Code without a proper signoff + cannot be merged into the mainline.
Earlier you prefixed file names with "Documentation/". Maybe do the same here (and in the following paragraphs) for consistency?
Quoted 2 lines
+ - If you are responding to a bug report or a feature request, copy those
+ people as well.
Maybe "the reporters" or similar instead of "those people"?
Documentation/development-process/6.Followthrough line 23
Quoted 5 lines
+6.1: WORKING WITH REVIEWERS
Documentation/development-process/6.Followthrough new file +4
-0+ +A patch of any significance will result in a number of comments from other +developers as they review the code. Working with reviewers can be, for +many developers, the most indimidating part of the kernel development
"intimidating"
Documentation/development-process/7.AdvancedTopics
Quoted 8 lines
Documentation/development-process/7.AdvancedTopics new file +8
-0+Excessive use of this capability can lead to other problems, though, beyond +a simple obsession for the creation of the perfect project history. +Rewriting history will rewrite the changes contained in that history, +turning a tested (hopefully) kernel tree into an untested one. But, beyond +that, developers cannot easily collaborate if they do not have a shared +view of the project history; if you rewrite history which other developers +have pulled into their repositories, you will make life much more difficult +for those developers going forward. ...
Is the "going forward" meant to be there?
I hope this helps,
Jochen
Signature · 1 line
http://seehuhn.de/
Jonathan Corbet
maintainerQuoted 1 line · On Thu, 31 Jul 2008 13:22:17 +0100 "Jochen Voß" <[email protected]>…
I hope this helps,
Your suggestions help a lot, thanks. I can't believe I forgot to say anything about not sending patches as attachments...
Thanks,
jon
Hi Jon,
A few minor things I found:
Documentation/development-process/1.Intro line 17
Quoted 4 lines · Jonathan Corbet
Documentation/development-process/1.Intro new file +4
-0+in existence. Since its humble beginning in 1991, this kernel has evolved +into a best-of-breed operating system component which runs on pocket-sized +digital music players, desktop PCs, the largest supercomputers in +existence, and all types of system in between. It is a robust, efficient,
systems
Documentation/development-process/1.Intro line 154
Quoted 4 lines
+- Binary modules greatly increase the difficulty of debugging kernel
Documentation/development-process/1.Intro new file +3
-0+ problems, to the point that most kernel developers will not even try. So + the distribution of binary-only modules will make support harder for + those who use them.
The last sentence reads a little funny to me, maybe something like:
By distributing binary-only modules, you make it harder for you and your users to get support.
Documentation/development-process/1.Intro line 208
Quoted 4 lines
Documentation/development-process/1.Intro new file +4
-0+kernel under the GPL. Code which has not been licensed as free software by +its owner, or which risks creating copyright-related problems for the +kernel (such as code which derives from improper reverse-engineering +efforts) cannot be contributed.
To me, this sort of implies that all reverse-engineering is improper, which is not what you meant to say, I don't think.
Documentation/development-process/2.Process line 33
Quoted 3 lines
Documentation/development-process/2.Process new file +3
-0+A relatively straightforward discipline is followed with regard to the +merging of patches for each release. At the beginning of each development +cycle, the "merge window" is said to be open. At this time, code which is
"At this time" sounds like you are saying "now", "At that time" perhaps? (maybe too picky)
Documentation/development-process/2.Process line 148
Quoted 4 lines
+ - Early review. Patches are posted to the relevant mailing list, and
Documentation/development-process/2.Process new file +3
-0+ developers on that list reply with any comments they may have. This + process should turn up any major problems with a patch, if all goes + well.
The comma after "patch" seems confusing.
Documentation/development-process/2.Process line 212
Quoted 7 lines
Documentation/development-process/2.Process new file +7
-0+When the merge window opens, top-level maintainers will ask Linus to "pull" +the patches they have selected for merging from their repositories. If +Linus agrees, the stream of patches will flow up into his repository, +becoming part of the mainline kernel. The amount of attention that Linus +pays to specific patches received in a pull operation varies. It is clear +that, sometimes, he looks quite closely. But, as a general, Linus trusts +the subsystem maintainers to not send bad patches upstream.
do you mean that Linus is a general? or should that be "general rule"? It could work either way.
Documentation/development-process/2.Process line 372
Quoted 3 lines
Documentation/development-process/2.Process new file +3
-0+degree of politeness. But there is no other place where the kernel +development community comes together as a whole; developers will avoid this +list at the risk of missing important information.
the last clause sounds like developers *will* avoid the list, maybe:
developers who avoid this list risk missing important information
Documentation/development-process/3.Early-stage line 137
Quoted 2 lines
Documentation/development-process/3.Early-stage new file +2
-0+patches. Those are the people who be best placed to help with a new +development project.
"who be best placed"? who will be best placed ...
Quoted 1 line
+One of the heavier debugging tools is the locking checker, or "lockdep."
should lockdep have a period?
Documentation/development-process/6.Followthrough line 136
Quoted 2 lines
Documentation/development-process/6.Followthrough new file +2
-0+how many people will build your code into their kernels. And, of course, +where there's testers, there's bug reports.
where there are testers, there are bug reports.
Documentation/development-process/7.AdvancedTopics line 72
Quoted 3 lines
Documentation/development-process/7.AdvancedTopics new file +3
-0+development history. An inconvenient patch (one which breaks bisection, +say, or which has some other sort of obvious bug) can be fixed in place or +make to disappear from the history entirely. A patch series can be
be made to disappear
Documentation/development-process/8.Conclusion line 12
Quoted 5 lines
Documentation/development-process/8.Conclusion new file +5
-0+read. Many internal kernel APIs are documented using the kerneldoc +mechanism; "make htmldocs" or "make pdfdocs" can be used to generate those +documents in HTML or PDF format (though the version of TeX shipped by some +distributions run into internal limits and fails to process the documents +properly).
"run into internal limits"? but, "runs into internal limits" doesn't seem quite right either.
hope that helps,
jake
Signature · 1 line
Jake Edge - [email protected] - http://lwn.net