← Documents Documentation/process/howto.rst GitHub 원문 ↗

Linux 6.18.37 · 개발 절차

Linux kernel 개발 HOWTO

Legal 조건과 문서 탐색부터 mainline·stable·subsystem·linux-next tree, bug report, mailing list와 community 협업까지 전체 개발 흐름을 설명합니다.

Source pathDocumentation/process/howto.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

Kernel developer가 알아야 할 전체 범위

howto.rst:3-58

이 문서는 kernel development에 참여하려는 사람이 따라갈 reference를 한 흐름으로 묶는다. Source를 build하는 방법만이 아니라 license, coding style, patch 작성, tree 구조, bug report와 mailing-list 관계를 함께 이해해야 한다.

Kernel은 빠르게 변하므로 오래된 book이나 외부 article만 따르지 않고 source tree의 Documentation과 MAINTAINERS, current mailing-list discussion을 기준으로 삼는다.

작은 실제 문제에서 시작한다

howto.rst:185-229

Kernel programming은 C syntax만으로 되지 않는다. Memory ownership, concurrency, hardware protocol과 subsystem convention을 source와 history에서 읽어야 한다. 작은 bug fix, warning 제거와 test 개선처럼 영향 범위를 검증할 수 있는 실제 문제로 시작한다.

Coding style만 바꾸는 patch 수를 늘리는 것보다 bug 재현, root cause 분석, test와 review 대응을 끝까지 경험하는 편이 maintainer 신뢰를 만든다.

Mainline, stable와 subsystem tree

howto.rst:230-325

Torvalds mainline은 release cycle의 최종 integration tree다. Merge window에 새 feature가 들어오고 이후 -rc 기간에는 regression과 bug fix 중심으로 안정화한다.

Stable·LTS tree는 released mainline의 검증된 bug fix를 backport한다. 서로 다른 major series가 동시에 지원되며 새 feature 개발 tree가 아니다.

Subsystem maintainer tree는 patch가 처음 integration되는 주 경로다. MAINTAINERS의 T entry와 branch 목적을 확인해 맞는 base에 patch를 만들고 subsystem review를 거쳐 mainline pull request에 포함된다.

linux-next integration test

howto.rst:326-340

linux-next는 다음 merge window 후보인 여러 maintainer tree를 매일 합쳐 cross-subsystem conflict와 build regression을 미리 찾는다. Mainline보다 실험적이며 production kernel이 아니라 integration testing target이다.

Bug report를 재현 가능한 기술 자료로 만든다

howto.rst:341-368

Report에는 exact kernel version과 commit, configuration, hardware, full relevant log, 재현 절차와 last-known-good version을 넣는다. Regression이면 culprit range를 좁히고 가능하면 git bisect한다. Security issue는 public bug report 전에 security procedure를 따른다.

Maintainer는 report를 닫는 관리자 역할에 그치지 않고 필요한 정보 요청, 담당자 연결, fix와 test status 추적을 수행한다. Reporter가 test할 수 있는 patch를 제공하고 결과를 commit message에 반영한다.

Mailing list가 개발 기록이다

howto.rst:369-469

Patch, design discussion과 review는 공개 mailing list에서 진행되고 archive가 장기 기록이 된다. Plain text, interleaved reply와 정확한 threading을 사용한다. 질문 전 archive와 Documentation을 검색하되 확인한 내용과 막힌 지점을 함께 적는다.

Review는 code에 대한 기술 검토다. 의견이 거칠어도 사실과 근거를 분리해 답하고, 이해하지 못한 comment는 추측으로 수정하지 말고 구체적으로 질문한다. 새 revision은 모든 recipient와 reviewer에게 보내고 변경 내역을 남긴다.

기업 구조와 다른 upstream 협업

howto.rst:470-516

Kernel community에서 직급이나 회사 조직도는 technical decision authority를 자동으로 주지 않는다. 설계 근거, code quality, test와 지속적인 review contribution으로 신뢰를 얻는다.

회사 deadline이나 비공개 product requirement만으로 upstream에 merge를 요구할 수 없다. 공개될 수 있는 problem statement로 바꾸고 다른 user와 architecture에도 유지 가능한 interface인지 논의한다.

변경을 나누고 정당화하고 문서화한다

howto.rst:517-625

큰 변경은 bisect 가능한 logical patch로 나누고 각 commit이 build·run 가능하게 한다. Refactoring, API 도입과 user conversion을 review 가능한 순서로 분리한다.

Commit message는 왜 필요한지, user impact, 선택한 설계와 대안, test 결과를 설명한다. 새 public API, Kconfig, boot parameter와 user-visible file은 같은 series에서 해당 Documentation을 갱신한다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. _process_howto:
2
3 HOWTO do Linux kernel development
4 =================================
5
6 This is the be-all, end-all document on this topic. It contains
7 instructions on how to become a Linux kernel developer and how to learn
8 to work with the Linux kernel development community. It tries to not
9 contain anything related to the technical aspects of kernel programming,
10 but will help point you in the right direction for that.
11
12 If anything in this document becomes out of date, please send in patches
13 to the maintainer of this file, who is listed at the bottom of the
14 document.
15
16
17 Introduction
18 ------------
19
20 So, you want to learn how to become a Linux kernel developer? Or you
21 have been told by your manager, "Go write a Linux driver for this
22 device." This document's goal is to teach you everything you need to
23 know to achieve this by describing the process you need to go through,
24 and hints on how to work with the community. It will also try to
25 explain some of the reasons why the community works like it does.
26
27 The kernel is written mostly in C, with some architecture-dependent
28 parts written in assembly. A good understanding of C is required for
29 kernel development. Assembly (any architecture) is not required unless
30 you plan to do low-level development for that architecture. Though they
31 are not a good substitute for a solid C education and/or years of
32 experience, the following books are good for, if anything, reference:
33
34 - "The C Programming Language" by Kernighan and Ritchie [Prentice Hall]
35 - "Practical C Programming" by Steve Oualline [O'Reilly]
36 - "C: A Reference Manual" by Harbison and Steele [Prentice Hall]
37
38 The kernel is written using GNU C and the GNU toolchain. While it
39 adheres to the ISO C11 standard, it uses a number of extensions that are
40 not featured in the standard. The kernel is a freestanding C
41 environment, with no reliance on the standard C library, so some
42 portions of the C standard are not supported. Arbitrary long long
43 divisions and floating point are not allowed. It can sometimes be
44 difficult to understand the assumptions the kernel has on the toolchain
45 and the extensions that it uses, and unfortunately there is no
46 definitive reference for them. Please check the gcc info pages (`info
47 gcc`) for some information on them.
48
49 Please remember that you are trying to learn how to work with the
50 existing development community. It is a diverse group of people, with
51 high standards for coding, style and procedure. These standards have
52 been created over time based on what they have found to work best for
53 such a large and geographically dispersed team. Try to learn as much as
54 possible about these standards ahead of time, as they are well
55 documented; do not expect people to adapt to you or your company's way
56 of doing things.
57
58
59 Legal Issues
60 ------------
61
62 The Linux kernel source code is released under the GPL. Please see the file
63 COPYING in the main directory of the source tree. The Linux kernel licensing
64 rules and how to use `SPDX <https://spdx.org/>`_ identifiers in source code are
65 described in :ref:`Documentation/process/license-rules.rst <kernel_licensing>`.
66 If you have further questions about the license, please contact a lawyer, and do
67 not ask on the Linux kernel mailing list. The people on the mailing lists are
68 not lawyers, and you should not rely on their statements on legal matters.
69
70 For common questions and answers about the GPL, please see:
71
72 https://www.gnu.org/licenses/gpl-faq.html
73
74
75 Documentation
76 -------------
77
78 The Linux kernel source tree has a large range of documents that are
79 invaluable for learning how to interact with the kernel community. When
80 new features are added to the kernel, it is recommended that new
81 documentation files are also added which explain how to use the feature.
82 When a kernel change causes the interface that the kernel exposes to
83 userspace to change, it is recommended that you send the information or
84 a patch to the manual pages explaining the change to the manual pages
85 maintainer at alx@kernel.org, and CC the list linux-api@vger.kernel.org.
86
87 Here is a list of files that are in the kernel source tree that are
88 required reading:
89
90 :ref:`Documentation/admin-guide/README.rst <readme>`
91 This file gives a short background on the Linux kernel and describes
92 what is necessary to do to configure and build the kernel. People
93 who are new to the kernel should start here.
94
95 :ref:`Documentation/process/changes.rst <changes>`
96 This file gives a list of the minimum levels of various software
97 packages that are necessary to build and run the kernel
98 successfully.
99
100 :ref:`Documentation/process/coding-style.rst <codingstyle>`
101 This describes the Linux kernel coding style, and some of the
102 rationale behind it. All new code is expected to follow the
103 guidelines in this document. Most maintainers will only accept
104 patches if these rules are followed, and many people will only
105 review code if it is in the proper style.
106
107 :ref:`Documentation/process/submitting-patches.rst <submittingpatches>`
108 This file describes in explicit detail how to successfully create
109 and send a patch, including (but not limited to):
110
111 - Email contents
112 - Email format
113 - Who to send it to
114
115 Following these rules will not guarantee success (as all patches are
116 subject to scrutiny for content and style), but not following them
117 will almost always prevent it.
118
119 Other excellent descriptions of how to create patches properly are:
120
121 "The Perfect Patch"
122 https://www.ozlabs.org/~akpm/stuff/tpp.txt
123
124 "Linux kernel patch submission format"
125 https://web.archive.org/web/20180829112450/http://linux.yyz.us/patch-format.html
126
127 :ref:`Documentation/process/stable-api-nonsense.rst <stable_api_nonsense>`
128 This file describes the rationale behind the conscious decision to
129 not have a stable API within the kernel, including things like:
130
131 - Subsystem shim-layers (for compatibility?)
132 - Driver portability between Operating Systems.
133 - Mitigating rapid change within the kernel source tree (or
134 preventing rapid change)
135
136 This document is crucial for understanding the Linux development
137 philosophy and is very important for people moving to Linux from
138 development on other Operating Systems.
139
140 :ref:`Documentation/process/security-bugs.rst <securitybugs>`
141 If you feel you have found a security problem in the Linux kernel,
142 please follow the steps in this document to help notify the kernel
143 developers, and help solve the issue.
144
145 :ref:`Documentation/process/management-style.rst <managementstyle>`
146 This document describes how Linux kernel maintainers operate and the
147 shared ethos behind their methodologies. This is important reading
148 for anyone new to kernel development (or anyone simply curious about
149 it), as it resolves a lot of common misconceptions and confusion
150 about the unique behavior of kernel maintainers.
151
152 :ref:`Documentation/process/stable-kernel-rules.rst <stable_kernel_rules>`
153 This file describes the rules on how the stable kernel releases
154 happen, and what to do if you want to get a change into one of these
155 releases.
156
157 :ref:`Documentation/process/kernel-docs.rst <kernel_docs>`
158 A list of external documentation that pertains to kernel
159 development. Please consult this list if you do not find what you
160 are looking for within the in-kernel documentation.
161
162 :ref:`Documentation/process/applying-patches.rst <applying_patches>`
163 A good introduction describing exactly what a patch is and how to
164 apply it to the different development branches of the kernel.
165
166 The kernel also has a large number of documents that can be
167 automatically generated from the source code itself or from
168 ReStructuredText markups (ReST), like this one. This includes a
169 full description of the in-kernel API, and rules on how to handle
170 locking properly.
171
172 All such documents can be generated as PDF or HTML by running::
173
174 make pdfdocs
175 make htmldocs
176
177 respectively from the main kernel source directory.
178
179 The documents that uses ReST markup will be generated at Documentation/output.
180 They can also be generated on LaTeX and ePub formats with::
181
182 make latexdocs
183 make epubdocs
184
185 Becoming A Kernel Developer
186 ---------------------------
187
188 If you do not know anything about Linux kernel development, you should
189 look at the Linux KernelNewbies project:
190
191 https://kernelnewbies.org
192
193 It consists of a helpful mailing list where you can ask almost any type
194 of basic kernel development question (make sure to search the archives
195 first, before asking something that has already been answered in the
196 past.) It also has an IRC channel that you can use to ask questions in
197 real-time, and a lot of helpful documentation that is useful for
198 learning about Linux kernel development.
199
200 The website has basic information about code organization, subsystems,
201 and current projects (both in-tree and out-of-tree). It also describes
202 some basic logistical information, like how to compile a kernel and
203 apply a patch.
204
205 If you do not know where you want to start, but you want to look for
206 some task to start doing to join into the kernel development community,
207 go to the Linux Kernel Janitor's project:
208
209 https://kernelnewbies.org/KernelJanitors
210
211 It is a great place to start. It describes a list of relatively simple
212 problems that need to be cleaned up and fixed within the Linux kernel
213 source tree. Working with the developers in charge of this project, you
214 will learn the basics of getting your patch into the Linux kernel tree,
215 and possibly be pointed in the direction of what to go work on next, if
216 you do not already have an idea.
217
218 Before making any actual modifications to the Linux kernel code, it is
219 imperative to understand how the code in question works. For this
220 purpose, nothing is better than reading through it directly (most tricky
221 bits are commented well), perhaps even with the help of specialized
222 tools. One such tool that is particularly recommended is the Linux
223 Cross-Reference project, which is able to present source code in a
224 self-referential, indexed webpage format. An excellent up-to-date
225 repository of the kernel code may be found at:
226
227 https://elixir.bootlin.com/
228
229
230 The development process
231 -----------------------
232
233 Linux kernel development process currently consists of a few different
234 main kernel "branches" and lots of different subsystem-specific kernel
235 branches. These different branches are:
236
237 - Linus's mainline tree
238 - Various stable trees with multiple major numbers
239 - Subsystem-specific trees
240 - linux-next integration testing tree
241
242 Mainline tree
243 ~~~~~~~~~~~~~
244
245 The mainline tree is maintained by Linus Torvalds, and can be found at
246 https://kernel.org or in the repo. Its development process is as follows:
247
248 - As soon as a new kernel is released a two week window is open,
249 during this period of time maintainers can submit big diffs to
250 Linus, usually the patches that have already been included in the
251 linux-next for a few weeks. The preferred way to submit big changes
252 is using git (the kernel's source management tool, more information
253 can be found at https://git-scm.com/) but plain patches are also just
254 fine.
255 - After two weeks a -rc1 kernel is released and the focus is on making the
256 new kernel as rock solid as possible. Most of the patches at this point
257 should fix a regression. Bugs that have always existed are not
258 regressions, so only push these kinds of fixes if they are important.
259 Please note that a whole new driver (or filesystem) might be accepted
260 after -rc1 because there is no risk of causing regressions with such a
261 change as long as the change is self-contained and does not affect areas
262 outside of the code that is being added. git can be used to send
263 patches to Linus after -rc1 is released, but the patches need to also be
264 sent to a public mailing list for review.
265 - A new -rc is released whenever Linus deems the current git tree to
266 be in a reasonably sane state adequate for testing. The goal is to
267 release a new -rc kernel every week.
268 - Process continues until the kernel is considered "ready", the
269 process should last around 6 weeks.
270
271 It is worth mentioning what Andrew Morton wrote on the linux-kernel
272 mailing list about kernel releases:
273
274 *"Nobody knows when a kernel will be released, because it's
275 released according to perceived bug status, not according to a
276 preconceived timeline."*
277
278 Various stable trees with multiple major numbers
279 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
280
281 Kernels with 3-part versions are -stable kernels. They contain
282 relatively small and critical fixes for security problems or significant
283 regressions discovered in a given major mainline release. Each release
284 in a major stable series increments the third part of the version
285 number, keeping the first two parts the same.
286
287 This is the recommended branch for users who want the most recent stable
288 kernel and are not interested in helping test development/experimental
289 versions.
290
291 Stable trees are maintained by the "stable" team <stable@vger.kernel.org>, and
292 are released as needs dictate. The normal release period is approximately
293 two weeks, but it can be longer if there are no pressing problems. A
294 security-related problem, instead, can cause a release to happen almost
295 instantly.
296
297 The file :ref:`Documentation/process/stable-kernel-rules.rst <stable_kernel_rules>`
298 in the kernel tree documents what kinds of changes are acceptable for
299 the -stable tree, and how the release process works.
300
301 Subsystem-specific trees
302 ~~~~~~~~~~~~~~~~~~~~~~~~
303
304 The maintainers of the various kernel subsystems --- and also many
305 kernel subsystem developers --- expose their current state of
306 development in source repositories. That way, others can see what is
307 happening in the different areas of the kernel. In areas where
308 development is rapid, a developer may be asked to base his submissions
309 onto such a subsystem kernel tree so that conflicts between the
310 submission and other already ongoing work are avoided.
311
312 Most of these repositories are git trees, but there are also other SCMs
313 in use, or patch queues being published as quilt series. Addresses of
314 these subsystem repositories are listed in the MAINTAINERS file. Many
315 of them can be browsed at https://git.kernel.org/.
316
317 Before a proposed patch is committed to such a subsystem tree, it is
318 subject to review which primarily happens on mailing lists (see the
319 respective section below). For several kernel subsystems, this review
320 process is tracked with the tool patchwork. Patchwork offers a web
321 interface which shows patch postings, any comments on a patch or
322 revisions to it, and maintainers can mark patches as under review,
323 accepted, or rejected. Most of these patchwork sites are listed at
324 https://patchwork.kernel.org/.
325
326 linux-next integration testing tree
327 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
328
329 Before updates from subsystem trees are merged into the mainline tree,
330 they need to be integration-tested. For this purpose, a special
331 testing repository exists into which virtually all subsystem trees are
332 pulled on an almost daily basis:
333
334 https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
335
336 This way, the linux-next gives a summary outlook onto what will be
337 expected to go into the mainline kernel at the next merge period.
338 Adventurous testers are very welcome to runtime-test the linux-next.
339
340
341 Bug Reporting
342 -------------
343
344 The file 'Documentation/admin-guide/reporting-issues.rst' in the main kernel
345 source directory describes how to report a possible kernel bug, and details
346 what kind of information is needed by the kernel developers to help track
347 down the problem.
348
349
350 Managing bug reports
351 --------------------
352
353 One of the best ways to put into practice your hacking skills is by fixing
354 bugs reported by other people. Not only will you help to make the kernel
355 more stable, but you'll also learn to fix real-world problems and you will
356 improve your skills, and other developers will be aware of your presence.
357 Fixing bugs is one of the best ways to get merits among other developers,
358 because not many people like wasting time fixing other people's bugs.
359
360 To work on already reported bug reports, find a subsystem you are interested in.
361 Check the MAINTAINERS file where bugs for that subsystem get reported to; often
362 it will be a mailing list, rarely a bugtracker. Search the archives of said
363 place for recent reports and help where you see fit. You may also want to check
364 https://bugzilla.kernel.org for bug reports; only a handful of kernel subsystems
365 use it actively for reporting or tracking, nevertheless bugs for the whole
366 kernel get filed there.
367
368
369 Mailing lists
370 -------------
371
372 As some of the above documents describe, the majority of the core kernel
373 developers participate on the Linux Kernel Mailing list. Details on how
374 to subscribe and unsubscribe from the list can be found at:
375
376 https://subspace.kernel.org/subscribing.html
377
378 There are archives of the mailing list on the web in many different
379 places. Use a search engine to find these archives. For example:
380
381 https://lore.kernel.org/linux-kernel/
382
383 It is highly recommended that you search the archives about the topic
384 you want to bring up, before you post it to the list. A lot of things
385 already discussed in detail are only recorded at the mailing list
386 archives.
387
388 Most of the individual kernel subsystems also have their own separate
389 mailing list where they do their development efforts. See the
390 MAINTAINERS file for a list of what these lists are for the different
391 groups.
392
393 Many of the lists are hosted on kernel.org. Information on them can be
394 found at:
395
396 https://subspace.kernel.org
397
398 Please remember to follow good behavioral habits when using the lists.
399 Though a bit cheesy, the following URL has some simple guidelines for
400 interacting with the list (or any list):
401
402 https://subspace.kernel.org/etiquette.html
403
404 If multiple people respond to your mail, the CC: list of recipients may
405 get pretty large. Don't remove anybody from the CC: list without a good
406 reason, or don't reply only to the list address. Get used to receiving the
407 mail twice, one from the sender and the one from the list, and don't try
408 to tune that by adding fancy mail-headers, people will not like it.
409
410 Remember to keep the context and the attribution of your replies intact,
411 keep the "John Kernelhacker wrote ...:" lines at the top of your reply, and
412 add your statements between the individual quoted sections instead of
413 writing at the top of the mail.
414
415 If you add patches to your mail, make sure they are plain readable text
416 as stated in :ref:`Documentation/process/submitting-patches.rst <submittingpatches>`.
417 Kernel developers don't want to deal with
418 attachments or compressed patches; they may want to comment on
419 individual lines of your patch, which works only that way. Make sure you
420 use a mail program that does not mangle spaces and tab characters. A
421 good first test is to send the mail to yourself and try to apply your
422 own patch by yourself. If that doesn't work, get your mail program fixed
423 or change it until it works.
424
425 Above all, please remember to show respect to other subscribers.
426
427
428 Working with the community
429 --------------------------
430
431 The goal of the kernel community is to provide the best possible kernel
432 there is. When you submit a patch for acceptance, it will be reviewed
433 on its technical merits and those alone. So, what should you be
434 expecting?
435
436 - criticism
437 - comments
438 - requests for change
439 - requests for justification
440 - silence
441
442 Remember, this is part of getting your patch into the kernel. You have
443 to be able to take criticism and comments about your patches, evaluate
444 them at a technical level and either rework your patches or provide
445 clear and concise reasoning as to why those changes should not be made.
446 If there are no responses to your posting, wait a few days and try
447 again, sometimes things get lost in the huge volume.
448
449 What should you not do?
450
451 - expect your patch to be accepted without question
452 - become defensive
453 - ignore comments
454 - resubmit the patch without making any of the requested changes
455
456 In a community that is looking for the best technical solution possible,
457 there will always be differing opinions on how beneficial a patch is.
458 You have to be cooperative, and willing to adapt your idea to fit within
459 the kernel. Or at least be willing to prove your idea is worth it.
460 Remember, being wrong is acceptable as long as you are willing to work
461 toward a solution that is right.
462
463 It is normal that the answers to your first patch might simply be a list
464 of a dozen things you should correct. This does **not** imply that your
465 patch will not be accepted, and it is **not** meant against you
466 personally. Simply correct all issues raised against your patch and
467 resend it.
468
469
470 Differences between the kernel community and corporate structures
471 -----------------------------------------------------------------
472
473 The kernel community works differently than most traditional corporate
474 development environments. Here are a list of things that you can try to
475 do to avoid problems:
476
477 Good things to say regarding your proposed changes:
478
479 - "This solves multiple problems."
480 - "This deletes 2000 lines of code."
481 - "Here is a patch that explains what I am trying to describe."
482 - "I tested it on 5 different architectures..."
483 - "Here is a series of small patches that..."
484 - "This increases performance on typical machines..."
485
486 Bad things you should avoid saying:
487
488 - "We did it this way in AIX/ptx/Solaris, so therefore it must be
489 good..."
490 - "I've being doing this for 20 years, so..."
491 - "This is required for my company to make money"
492 - "This is for our Enterprise product line."
493 - "Here is my 1000 page design document that describes my idea"
494 - "I've been working on this for 6 months..."
495 - "Here's a 5000 line patch that..."
496 - "I rewrote all of the current mess, and here it is..."
497 - "I have a deadline, and this patch needs to be applied now."
498
499 Another way the kernel community is different than most traditional
500 software engineering work environments is the faceless nature of
501 interaction. One benefit of using email and irc as the primary forms of
502 communication is the lack of discrimination based on gender or race.
503 The Linux kernel work environment is accepting of women and minorities
504 because all you are is an email address. The international aspect also
505 helps to level the playing field because you can't guess gender based on
506 a person's name. A man may be named Andrea and a woman may be named Pat.
507 Most women who have worked in the Linux kernel and have expressed an
508 opinion have had positive experiences.
509
510 The language barrier can cause problems for some people who are not
511 comfortable with English. A good grasp of the language can be needed in
512 order to get ideas across properly on mailing lists, so it is
513 recommended that you check your emails to make sure they make sense in
514 English before sending them.
515
516
517 Break up your changes
518 ---------------------
519
520 The Linux kernel community does not gladly accept large chunks of code
521 dropped on it all at once. The changes need to be properly introduced,
522 discussed, and broken up into tiny, individual portions. This is almost
523 the exact opposite of what companies are used to doing. Your proposal
524 should also be introduced very early in the development process, so that
525 you can receive feedback on what you are doing. It also lets the
526 community feel that you are working with them, and not simply using them
527 as a dumping ground for your feature. However, don't send 50 emails at
528 one time to a mailing list, your patch series should be smaller than
529 that almost all of the time.
530
531 The reasons for breaking things up are the following:
532
533 1) Small patches increase the likelihood that your patches will be
534 applied, since they don't take much time or effort to verify for
535 correctness. A 5 line patch can be applied by a maintainer with
536 barely a second glance. However, a 500 line patch may take hours to
537 review for correctness (the time it takes is exponentially
538 proportional to the size of the patch, or something).
539
540 Small patches also make it very easy to debug when something goes
541 wrong. It's much easier to back out patches one by one than it is
542 to dissect a very large patch after it's been applied (and broken
543 something).
544
545 2) It's important not only to send small patches, but also to rewrite
546 and simplify (or simply re-order) patches before submitting them.
547
548 Here is an analogy from kernel developer Al Viro:
549
550 *"Think of a teacher grading homework from a math student. The
551 teacher does not want to see the student's trials and errors
552 before they came up with the solution. They want to see the
553 cleanest, most elegant answer. A good student knows this, and
554 would never submit her intermediate work before the final
555 solution.*
556
557 *The same is true of kernel development. The maintainers and
558 reviewers do not want to see the thought process behind the
559 solution to the problem one is solving. They want to see a
560 simple and elegant solution."*
561
562 It may be challenging to keep the balance between presenting an elegant
563 solution and working together with the community and discussing your
564 unfinished work. Therefore it is good to get early in the process to
565 get feedback to improve your work, but also keep your changes in small
566 chunks that they may get already accepted, even when your whole task is
567 not ready for inclusion now.
568
569 Also realize that it is not acceptable to send patches for inclusion
570 that are unfinished and will be "fixed up later."
571
572
573 Justify your change
574 -------------------
575
576 Along with breaking up your patches, it is very important for you to let
577 the Linux community know why they should add this change. New features
578 must be justified as being needed and useful.
579
580
581 Document your change
582 --------------------
583
584 When sending in your patches, pay special attention to what you say in
585 the text in your email. This information will become the ChangeLog
586 information for the patch, and will be preserved for everyone to see for
587 all time. It should describe the patch completely, containing:
588
589 - why the change is necessary
590 - the overall design approach in the patch
591 - implementation details
592 - testing results
593
594 For more details on what this should all look like, please see the
595 ChangeLog section of the document:
596
597 "The Perfect Patch"
598 https://www.ozlabs.org/~akpm/stuff/tpp.txt
599
600
601 All of these things are sometimes very hard to do. It can take years to
602 perfect these practices (if at all). It's a continuous process of
603 improvement that requires a lot of patience and determination. But
604 don't give up, it's possible. Many have done it before, and each had to
605 start exactly where you are now.
606
607
608
609
610 ----------
611
612 Thanks to Paolo Ciarrocchi who allowed the "Development Process"
613 (https://lwn.net/Articles/94386/) section
614 to be based on text he had written, and to Randy Dunlap and Gerrit
615 Huizenga for some of the list of things you should and should not say.
616 Also thanks to Pat Mochel, Hanna Linder, Randy Dunlap, Kay Sievers,
617 Vojtech Pavlik, Jan Kara, Josh Boyer, Kees Cook, Andrew Morton, Andi
618 Kleen, Vadim Lobanov, Jesper Juhl, Adrian Bunk, Keri Harris, Frans Pop,
619 David A. Wheeler, Junio Hamano, Michael Kerrisk, and Alex Shepard for
620 their review, comments, and contributions. Without their help, this
621 document would not have been possible.
622
623
624
625 Maintainer: Greg Kroah-Hartman <greg@kroah.com>
626

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

이 문서의 목적

1-15

이 문서는 Linux kernel developer가 되는 방법과 Linux kernel development community에서 함께 일하는 방법을 안내하는 종합 문서다. Kernel programming의 기술적 세부 사항 자체는 다루지 않지만, 그 내용을 배우기 위해 어느 방향으로 가야 하는지 알려 준다.

문서 내용이 오래되어 현재 상황과 맞지 않게 되면 문서 맨 아래에 적힌 maintainer에게 patch를 보내 갱신해야 한다.

시작하기 전에 필요한 배경

17-56

Linux kernel developer가 되고 싶거나 관리자로부터 “이 장치의 Linux driver를 작성하라”는 지시를 받았다면, 이 문서는 그 목표에 이르기 위해 거쳐야 할 절차와 community에서 협업하는 방법을 설명한다. Kernel community가 현재와 같은 방식으로 움직이는 이유도 함께 설명하려 한다.

Kernel은 대부분 C로 작성되며 architecture-dependent 부분 일부는 assembly로 작성된다. 따라서 kernel development에는 C를 충분히 이해해야 한다. 특정 architecture의 low-level 개발을 할 계획이 아니라면 assembly 지식은 필수 사항이 아니다.

아래 책들은 탄탄한 C 교육이나 수년간의 경험을 대신할 수는 없지만 참고서로 유용하다.

  • Kernighan과 Ritchie의 “The C Programming Language” [Prentice Hall]
  • Steve Oualline의 “Practical C Programming” [O'Reilly]
  • Harbison과 Steele의 “C: A Reference Manual” [Prentice Hall]

Kernel은 GNU C와 GNU toolchain을 사용한다. ISO C11 표준을 따르지만 표준에 없는 여러 GNU extension도 사용한다. Kernel은 standard C library에 의존하지 않는 freestanding C environment이므로 C 표준의 일부 기능은 지원되지 않는다. 임의의 long long division과 floating point 연산도 허용되지 않는다.

Kernel이 toolchain에 대해 두는 전제와 사용하는 extension을 모두 설명하는 결정적 참고 자료는 없다. 관련 정보는 gcc info page에서 확인할 수 있다.

info gcc

목표는 이미 존재하는 development community와 일하는 법을 배우는 것이다. 이 community는 다양한 사람으로 구성되어 있고 coding, style, procedure에 높은 기준을 둔다. 이 기준은 규모가 크고 지리적으로 흩어진 팀에서 가장 잘 작동했던 방법을 오랜 시간 축적해 만든 것이다. 기준은 잘 문서화되어 있으므로 미리 최대한 익혀야 하며, 다른 개발자들이 자신이나 자기 회사의 업무 방식에 맞춰 줄 것이라고 기대해서는 안 된다.

먼저 읽어야 할 Documentation

75-184

Linux kernel source tree에는 kernel community와 상호 작용하는 방법을 배우는 데 매우 유용한 문서가 폭넓게 들어 있다. Kernel에 새 기능을 추가할 때는 그 기능의 사용법을 설명하는 documentation file도 함께 추가하는 것이 권장된다.

Kernel change로 userspace에 노출되는 interface가 바뀌면 그 변경을 설명하는 정보나 manual page patch를 manual page maintainer인 alx@kernel.org로 보내고 linux-api@vger.kernel.org를 CC하는 것이 권장된다.

Source tree의 필독 문서

  • Documentation/admin-guide/README.rst: Linux kernel의 간략한 배경, kernel configuration과 build에 필요한 작업을 설명한다. Kernel을 처음 접한다면 여기서 시작한다.
  • Documentation/process/changes.rst: Kernel을 성공적으로 build하고 실행하는 데 필요한 여러 software package의 최소 version을 나열한다.
  • Documentation/process/coding-style.rst: Linux kernel coding style과 그 근거 일부를 설명한다. 모든 새 code는 이 지침을 따라야 한다. 많은 maintainer는 규칙을 지킨 patch만 받아들이며, 올바른 style이 아니면 review하지 않는 개발자도 많다.
  • Documentation/process/submitting-patches.rst: Patch를 성공적으로 만들고 보내는 방법을 email 내용, email 형식, 수신자 선택을 포함해 구체적으로 설명한다. 규칙을 따른다고 성공이 보장되지는 않지만, 따르지 않으면 거의 언제나 patch가 받아들여지지 않는다.
  • Documentation/process/stable-api-nonsense.rst: Kernel 내부에 stable API를 두지 않기로 한 의식적인 결정의 근거를 설명한다. 호환성을 위한 subsystem shim layer, operating system 사이의 driver portability, kernel source tree의 빠른 변화를 완화하거나 막는 문제를 포함한다. 다른 operating system 개발 환경에서 Linux로 옮겨 온 사람에게 특히 중요한 Linux development 철학이다.
  • Documentation/process/security-bugs.rst: Linux kernel의 security problem을 발견했다고 판단했을 때 kernel developer에게 알리고 문제 해결을 돕는 절차를 설명한다.
  • Documentation/process/management-style.rst: Linux kernel maintainer가 일하는 방식과 그 방법론에 깔린 공통 ethos를 설명한다. Maintainer의 독특한 행동 방식에 관한 흔한 오해와 혼란을 풀어 주므로 kernel development 입문자와 운영 방식이 궁금한 사람 모두에게 중요하다.
  • Documentation/process/stable-kernel-rules.rst: Stable kernel release가 이루어지는 규칙과 특정 stable release에 변경을 넣으려면 무엇을 해야 하는지 설명한다.
  • Documentation/process/kernel-docs.rst: Kernel development와 관련된 외부 documentation 목록이다. In-kernel documentation에서 원하는 정보를 찾지 못했다면 이 목록을 확인한다.
  • Documentation/process/applying-patches.rst: Patch가 정확히 무엇이며 kernel의 여러 development branch에 어떻게 적용하는지 소개한다.

Patch 작성법을 더 설명하는 자료로 “The Perfect Patch”와 보관된 “Linux kernel patch submission format” 문서가 있다.

Documentation build

Kernel에는 source code 자체나 이 문서와 같은 ReStructuredText(ReST) markup에서 자동 생성할 수 있는 문서도 많다. In-kernel API의 전체 설명과 locking을 올바르게 다루는 규칙도 여기에 포함된다. Source tree 최상위에서 다음 명령을 실행하면 각각 PDF와 HTML을 생성한다.

make pdfdocs
make htmldocs

ReST markup을 사용하는 문서는 Documentation/output에 생성된다. LaTeX와 ePub 형식도 만들 수 있다.

make latexdocs
make epubdocs

Kernel developer로 첫발을 내딛기

185-227

Linux kernel development를 전혀 모른다면 Linux KernelNewbies project를 먼저 살펴본다. 이 project에는 기본적인 kernel development 질문을 거의 무엇이든 물어볼 수 있는 mailing list가 있다. 다만 이미 답변된 질문을 다시 올리지 않도록 먼저 archive를 검색해야 한다.

KernelNewbies에는 실시간으로 질문할 수 있는 IRC channel과 Linux kernel development 학습에 도움이 되는 documentation도 많다. Website는 code organization, subsystem, tree 내부와 외부의 현재 project에 관한 기본 정보뿐 아니라 kernel compile과 patch 적용 같은 기초 절차도 설명한다.

어디서 시작할지 정하지 못했지만 kernel development community에 참여할 첫 작업을 찾고 싶다면 Linux Kernel Janitors project를 방문한다. Kernel source tree에서 정리하거나 고쳐야 할 비교적 단순한 문제 목록이 있어 좋은 출발점이 된다. Project 담당 developer와 함께 작업하면서 patch를 Linux kernel tree에 넣는 기본 절차를 배우고, 다음 작업 방향도 안내받을 수 있다.

Kernel code를 실제로 수정하기 전에 대상 code가 어떻게 동작하는지 이해하는 것은 필수다. 가장 좋은 방법은 source를 직접 읽는 것이며, 까다로운 부분 대부분에는 좋은 comment가 있다. 필요하면 전용 도구도 활용한다. 특히 권장되는 Linux Cross-Reference project는 source code를 상호 참조 가능한 indexed webpage 형태로 보여 준다. 최신 kernel source는 Elixir에서 탐색할 수 있다.

Kernel development branch와 merge 흐름

230-339

Linux kernel development에는 역할이 다른 여러 주요 kernel branch와 subsystem별 branch가 있다. 핵심은 Linus의 mainline tree, 여러 major version의 stable tree, subsystem-specific tree, linux-next integration testing tree다.

Mainline tree

Mainline tree는 Linus Torvalds가 관리하며 kernel.org 또는 repository에서 찾을 수 있다. 새 kernel이 release되면 즉시 2주간의 merge window가 열린다. 이 기간 maintainer는 큰 diff를 Linus에게 제출할 수 있다. 보통 linux-next에 이미 몇 주 동안 포함되어 검증된 patch다. 큰 변경은 kernel source management tool인 git으로 제출하는 것이 선호되지만 일반 patch도 허용된다.

2주가 지나면 -rc1 kernel이 release되고, 이후 목표는 새 kernel을 가능한 한 견고하게 만드는 것이다. 이 시점의 patch 대부분은 regression을 고쳐야 한다. 오래전부터 존재한 bug는 regression이 아니므로 중요할 때만 이런 fix를 밀어 넣는다.

새 driver나 filesystem 전체는 self-contained이고 추가되는 code 밖의 영역에 영향을 주지 않는다면 regression을 만들 위험이 없어 -rc1 뒤에도 받아들여질 수 있다. -rc1 뒤에도 git으로 Linus에게 patch를 보낼 수 있지만 public mailing list에도 함께 보내 review를 받아야 한다.

현재 git tree가 test하기에 충분히 정상적인 상태라고 Linus가 판단할 때마다 새 -rc가 release된다. 목표 주기는 매주 하나의 -rc다. Kernel이 ready 상태라고 판단될 때까지 이 과정을 반복하며 보통 약 6주가 걸린다.

Andrew Morton은 kernel release에 관해 “Kernel이 언제 release될지는 아무도 모른다. 미리 정한 일정이 아니라 관찰된 bug 상태에 따라 release하기 때문이다”라고 linux-kernel mailing list에 썼다.

여러 major version의 stable tree

세 부분으로 된 version을 가진 kernel은 -stable kernel이다. 특정 major mainline release에서 발견된 security problem이나 중대한 regression을 고치는 비교적 작고 중요한 fix가 들어간다. 같은 major stable series의 release마다 version 세 번째 부분만 증가하고 앞의 두 부분은 유지된다.

최신 stable kernel을 원하지만 development 또는 experimental version test에는 참여하지 않으려는 사용자에게 권장되는 branch다. Stable tree는 stable team <stable@vger.kernel.org>이 관리하며 필요에 따라 release한다. 보통 약 2주 간격이지만 긴급한 문제가 없으면 더 길어질 수 있고, security problem이 있으면 거의 즉시 release될 수도 있다. 허용되는 변경과 release 절차는 Documentation/process/stable-kernel-rules.rst에 설명되어 있다.

Subsystem-specific tree

여러 kernel subsystem의 maintainer와 많은 subsystem developer는 현재 개발 상태를 source repository로 공개한다. 따라서 다른 사람도 kernel 각 영역에서 어떤 일이 진행되는지 볼 수 있다. 개발 속도가 빠른 영역에서는 제출물과 이미 진행되는 작업 사이의 conflict를 피하기 위해 subsystem tree를 base로 삼아 patch를 만들도록 요청받을 수 있다.

대부분 git tree지만 다른 SCM을 쓰거나 quilt series 형태로 patch queue를 공개하는 곳도 있다. Subsystem repository 주소는 MAINTAINERS file에 나열되어 있고 많은 tree를 git.kernel.org에서 탐색할 수 있다.

제안된 patch가 subsystem tree에 commit되기 전에는 주로 mailing list에서 review를 받는다. 여러 subsystem은 patchwork로 review process를 추적한다. Patchwork web interface에서는 게시된 patch, patch에 달린 comment와 revision을 볼 수 있고 maintainer는 상태를 review 중, accepted, rejected로 표시할 수 있다. 관련 site 대부분은 patchwork.kernel.org에 모여 있다.

linux-next integration testing tree

Subsystem tree의 update를 mainline에 merge하기 전에 integration test해야 한다. 이를 위해 거의 모든 subsystem tree를 거의 매일 pull하는 전용 testing repository가 있다. linux-next는 다음 merge period에 mainline으로 들어갈 것으로 예상되는 내용을 한곳에서 미리 보여 준다. 적극적인 tester가 linux-next를 실제로 실행해 test하는 것은 매우 환영받는다.

Subsystem 변경이 mainline과 stable로 이동하는 경로
Developer patchSubsystem mailing list reviewSubsystem treelinux-next integration testMainline merge window-rc regression stabilizationFinal releaseEligible fixes → stable tree

Patch는 공개 review와 integration test를 거쳐 mainline에 들어가며, 필요한 작은 fix만 별도 기준을 거쳐 stable series로 옮겨진다.

Bug report 작성과 관리

341-366

Main kernel source directory의 Documentation/admin-guide/reporting-issues.rst는 의심되는 kernel bug를 보고하는 방법과 developer가 문제를 추적하는 데 필요한 정보의 종류를 설명한다.

다른 사람이 보고한 bug를 고치는 일은 kernel hacking 기술을 실제로 적용하는 가장 좋은 방법 중 하나다. Kernel을 더 안정적으로 만들 뿐 아니라 현실의 문제를 해결하는 법을 배우고 실력이 늘며, 다른 developer에게 자신의 존재도 알릴 수 있다. 다른 사람의 bug를 고치는 데 시간을 쓰고 싶어 하는 사람이 많지 않기 때문에 이 작업은 developer 사이에서 신뢰를 얻는 좋은 방법이기도 하다.

기존 bug report를 다루려면 관심 있는 subsystem을 고른다. MAINTAINERS file에서 그 subsystem의 bug가 어디로 보고되는지 확인한다. 보통 mailing list이고 드물게 bug tracker다. 해당 장소의 archive에서 최근 report를 검색하고 도울 수 있는 문제에 참여한다.

bugzilla.kernel.org도 확인할 수 있다. 이를 적극적으로 report 또는 tracking에 사용하는 subsystem은 소수지만 kernel 전체에 관한 bug가 이곳에 등록되기도 한다.

Mailing list 사용법

369-425

핵심 kernel developer 대부분은 Linux Kernel Mailing List에 참여한다. 구독과 구독 해제 방법은 subspace.kernel.org의 안내에서 확인할 수 있다. Mailing list archive는 여러 web site에 있으며 search engine으로 찾을 수 있다. 대표적인 archive는 lore.kernel.org/linux-kernel이다.

List에 주제를 올리기 전에 관련 archive를 검색하는 것이 매우 권장된다. 이미 자세히 논의됐지만 mailing list archive에만 기록된 내용이 많다. Kernel subsystem 대부분은 별도의 development mailing list를 가지며 각 list는 MAINTAINERS file에서 확인할 수 있다. 여러 list가 kernel.org에 hosting되고 그 정보는 subspace.kernel.org에 있다.

Mailing list에서는 올바른 대화 습관을 지켜야 한다. 여러 사람이 답장하면 CC 수신자 목록이 상당히 길어질 수 있다. 정당한 이유 없이 CC에서 사람을 빼거나 list 주소에만 답장하지 않는다. 보낸 사람에게서 온 mail과 list를 거친 mail을 두 번 받는 것에 익숙해져야 하며, 복잡한 mail header를 추가해 이를 조정하려 하면 다른 참여자가 좋아하지 않는다.

답장의 문맥과 인용 주체를 그대로 유지한다. 답장 위쪽의 “John Kernelhacker wrote ...:” 같은 line을 남겨 두고, mail 맨 위에 답을 몰아 쓰지 말고 인용한 개별 구간 사이에 자신의 설명을 적는다.

Mail에 patch를 넣을 때는 Documentation/process/submitting-patches.rst가 요구하는 읽을 수 있는 plain text로 보낸다. Kernel developer는 attachment나 compressed patch를 다루고 싶어 하지 않는다. Patch의 개별 line에 comment하려면 plain text가 필요하다.

Space와 tab 문자를 훼손하지 않는 mail program을 사용해야 한다. 좋은 첫 test는 자신에게 mail을 보낸 뒤 그 mail의 patch를 직접 적용해 보는 것이다. 적용되지 않으면 제대로 될 때까지 mail program 설정을 고치거나 program을 바꾼다. 무엇보다 다른 subscriber를 존중해야 한다.

Community review와 대응

428-467

Kernel community의 목표는 가능한 한 최고의 kernel을 만드는 것이다. 받아들여 달라고 제출한 patch는 기술적 가치만을 기준으로 review된다. 제출자는 criticism, comment, 변경 요청, 근거 설명 요청 또는 아무 답도 없는 silence를 예상해야 한다.

이는 patch를 kernel에 넣는 과정의 일부다. Patch에 대한 비판과 comment를 받아들이고 기술적 관점에서 평가한 뒤 patch를 다시 고치거나, 요청된 변경을 하지 않아야 하는 이유를 명확하고 간결하게 설명할 수 있어야 한다.

게시물에 답이 없으면 며칠 기다렸다가 다시 시도한다. 엄청난 mail 양 때문에 누락되는 경우가 있다. 반대로 patch가 아무 질문 없이 받아들여질 것이라고 기대하거나, 방어적으로 반응하거나, comment를 무시하거나, 요청된 변경을 하나도 반영하지 않은 채 같은 patch를 다시 제출해서는 안 된다.

최선의 기술적 해법을 찾는 community에서는 patch가 얼마나 유익한지를 두고 언제나 다른 의견이 나올 수 있다. 협력적인 태도를 유지하고 자신의 idea가 kernel에 맞도록 조정할 의지가 있어야 하며, 최소한 그 idea가 가치 있음을 입증할 준비가 되어 있어야 한다. 틀리는 것 자체는 괜찮다. 올바른 해법을 향해 함께 일하려는 자세가 중요하다.

첫 patch에 대한 답장이 고쳐야 할 사항 열두 개를 나열하는 것뿐이어도 정상이다. 이는 patch가 받아들여지지 않는다는 뜻도 아니고 개인을 공격하려는 뜻도 아니다. 지적된 문제를 모두 고친 뒤 patch를 다시 보내면 된다.

Kernel community와 기업 조직의 차이

470-514

Kernel community는 전통적인 기업 개발 환경 대부분과 다르게 움직인다. 제안하는 변경을 설명할 때 좋은 표현은 여러 문제를 해결한다는 점, code 2,000줄을 삭제한다는 점, 설명하려는 내용을 보여 주는 patch가 있다는 점, 서로 다른 architecture 5개에서 test했다는 점, 작은 patch의 series라는 점, 일반적인 machine에서 performance를 높인다는 점처럼 기술적 결과와 검증 가능성을 드러낸다.

반대로 “AIX/ptx/Solaris에서 이렇게 했으니 좋은 방식이다”, “이 일을 20년 했다”, “우리 회사가 돈을 벌려면 필요하다”, “Enterprise product line을 위한 것이다”, “idea를 설명하는 1,000 page design document가 있다”, “6개월 동안 작업했다”, “5,000 line patch다”, “현재의 엉망인 부분을 전부 다시 작성했다”, “deadline 때문에 지금 적용해야 한다” 같은 말은 피해야 한다. 경력, 조직 사정, 투입 시간이나 큰 문서보다 code와 기술적 근거가 판단 기준이다.

Kernel community의 또 다른 차이는 서로 얼굴을 보지 않는 상호 작용이다. 문서는 email과 IRC가 주된 communication 방식이어서 성별이나 인종에 따른 차별이 줄어드는 이점이 있다고 설명한다. 참여자는 email address로 보이고, 국제적인 환경에서는 이름만으로 성별을 추측하기도 어렵다. Linux kernel에서 일한 뒤 의견을 밝힌 여성 대부분은 긍정적인 경험을 했다고 문서는 기록한다.

영어가 편하지 않은 사람에게는 language barrier가 문제가 될 수 있다. Mailing list에서 idea를 정확히 전달하려면 영어를 잘 이해해야 할 수 있으므로, 보내기 전에 email의 영어 문장이 의미가 통하는지 확인하는 것이 권장된다.

변경을 작은 patch로 나누기

517-570

Linux kernel community는 큰 code 덩어리를 한 번에 던져 넣는 방식을 반기지 않는다. 변경을 제대로 소개하고 논의하며 작고 독립적인 부분으로 나눠야 한다. 이는 기업에서 흔히 쓰는 방식과 거의 정반대다.

제안은 development process의 매우 이른 시점에 소개해야 작업 방향에 관한 feedback을 받을 수 있다. Community도 기능을 내다 버리듯 넘기는 것이 아니라 자신들과 함께 개발한다고 느낄 수 있다. 그렇다고 mailing list에 한 번에 email 50개를 보내서는 안 되며, 거의 언제나 patch series는 그보다 작아야 한다.

첫 번째 분할 이유는 작은 patch일수록 정확성을 검증하는 데 시간과 노력이 적게 들어 적용될 가능성이 커지기 때문이다. 5 line patch는 maintainer가 거의 한 번만 보고 적용할 수 있지만 500 line patch의 정확성을 review하는 데는 몇 시간이 걸릴 수 있다. Review 시간은 patch 크기에 지수적으로 비례한다고 표현할 정도다.

작은 patch는 문제가 생겼을 때 debug하기도 쉽다. 적용한 뒤 무언가를 깨뜨린 거대한 patch를 해부하는 것보다 patch를 하나씩 되돌리는 편이 훨씬 쉽다.

두 번째로, patch를 작게 보낼 뿐 아니라 제출 전에 다시 작성하고 단순화하거나 순서를 재배치하는 작업도 중요하다.

Al Viro는 이를 수학 숙제를 채점하는 교사에 비유했다. 교사는 학생이 해답을 찾기까지 겪은 시행착오가 아니라 가장 깔끔하고 우아한 답을 보고 싶어 한다. 좋은 학생은 중간 작업이 아니라 최종 해답을 제출한다. Kernel maintainer와 reviewer도 문제 해결 과정의 모든 흔적이 아니라 단순하고 우아한 해법을 보고 싶어 한다.

우아한 해법을 제시하는 일과 unfinished work를 community와 함께 논의하는 일 사이에서 균형을 잡기는 어렵다. 따라서 이른 시점에 feedback을 받아 작업을 개선하되, 전체 과제가 아직 merge할 상태가 아니더라도 완성된 작은 변경은 먼저 받아들여질 수 있도록 나눈다.

아직 완성되지 않았고 나중에 고치겠다는 patch를 inclusion 대상으로 보내는 것은 허용되지 않는다.

변경이 필요한 이유를 입증하기

573-578

Patch를 나누는 것과 함께 Linux community가 이 변경을 추가해야 하는 이유를 알리는 일도 매우 중요하다. 새 기능은 필요하고 유용하다는 근거를 제시해야 한다.

변경 내용을 기록하기

581-605

Patch를 보낼 때 email 본문에 무엇을 쓰는지 특별히 주의해야 한다. 이 정보는 patch의 ChangeLog가 되어 모든 사람이 영구히 볼 수 있도록 보존된다. Patch를 완전하게 설명해야 하며 변경이 필요한 이유, patch의 전체 design approach, implementation detail, testing result를 포함해야 한다.

정확한 형식에 관한 자세한 내용은 “The Perfect Patch”의 ChangeLog section을 참고한다.

이 모든 일을 잘하기는 때때로 매우 어렵다. 이런 practice를 완성하는 데는 여러 해가 걸릴 수 있고 끝내 완벽해지지 않을 수도 있다. 많은 인내와 결단이 필요한 지속적인 개선 과정이다. 그러나 포기할 필요는 없다. 앞선 많은 사람도 해냈고 모두 지금의 입문자와 정확히 같은 자리에서 시작했다.

감사의 말과 maintainer

610-625

Paolo Ciarrocchi는 자신이 작성한 글을 바탕으로 “Development Process” section을 구성하도록 허락했다. Randy Dunlap과 Gerrit Huizenga는 말해야 할 것과 말하지 않아야 할 것의 목록 일부에 기여했다.

Pat Mochel, Hanna Linder, Randy Dunlap, Kay Sievers, Vojtech Pavlik, Jan Kara, Josh Boyer, Kees Cook, Andrew Morton, Andi Kleen, Vadim Lobanov, Jesper Juhl, Adrian Bunk, Keri Harris, Frans Pop, David A. Wheeler, Junio Hamano, Michael Kerrisk, Alex Shepard에게 review, comment, contribution에 대해 감사를 전한다. 이들의 도움이 없었다면 문서는 만들어질 수 없었다.

Maintainer: Greg Kroah-Hartman <greg@kroah.com>