a guide to the linux kernel development process - freedomhec

55
1 A Guide to the Linux Kernel Development Process Jonathan Corbet LWN.net [email protected]

Upload: others

Post on 10-Feb-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Guide to the Linux Kernel Development Process - FreedomHEC

1

A Guide to the Linux Kernel Development Process

Jonathan CorbetLWN.net

[email protected]

Page 2: A Guide to the Linux Kernel Development Process - FreedomHEC

2

AgendaWhy participation mattersGuiding principlesTreesSome tips

Page 3: A Guide to the Linux Kernel Development Process - FreedomHEC

3

For more informationldn.linuxfoundation.org/book/

how-participate-linux-community

-- or --

Documentation/development-process/

Page 4: A Guide to the Linux Kernel Development Process - FreedomHEC

4

Why?

Page 5: A Guide to the Linux Kernel Development Process - FreedomHEC

5

Why?

The kernel is the core of a Linux system

Page 6: A Guide to the Linux Kernel Development Process - FreedomHEC

6

Why?

It's how you get the kernel to meet your needs

“Well, this is open source... you don't get to request new features, you get to implement them”

-- James Bottomley

Page 7: A Guide to the Linux Kernel Development Process - FreedomHEC

7

Why?

External code is expensive

Page 8: A Guide to the Linux Kernel Development Process - FreedomHEC

8

Why?

External code is lower quality code

Page 9: A Guide to the Linux Kernel Development Process - FreedomHEC

9

Why?

In-tree code can be improved by others

Page 10: A Guide to the Linux Kernel Development Process - FreedomHEC

10

Why?

That is how our community works

Page 11: A Guide to the Linux Kernel Development Process - FreedomHEC

11

Why this talk?

Working with the kernel is not hard...if you understand how the process

works

Page 12: A Guide to the Linux Kernel Development Process - FreedomHEC

12

“So, I've had enough. I'm out of here forever. I want to leave before I get so disgruntled that I end up using Windows. I may play occasionally with userspace code but for me the kernel is a black hole that I don't want to enter the event horizon of again”

-- Con Kolivas

Page 13: A Guide to the Linux Kernel Development Process - FreedomHEC

13

Some guiding principles...which should help in understanding

how the kernel is made

Page 14: A Guide to the Linux Kernel Development Process - FreedomHEC

14

Upstream first

Code goes into the kernel first...before going to customers...before user space depends on it

Page 15: A Guide to the Linux Kernel Development Process - FreedomHEC

15

Not a differentiator

Vendors should not differentiate their offerings at the kernel level

Page 16: A Guide to the Linux Kernel Development Process - FreedomHEC

16

Not a differentiator

Vendors should not differentiate their offerings at the kernel level

(See “Upstream first”)

Page 17: A Guide to the Linux Kernel Development Process - FreedomHEC

17

Technical quality over all

Code quality outweighs:Company plansUser desiresExisting practiceDeveloper status

Page 18: A Guide to the Linux Kernel Development Process - FreedomHEC

18

Long-term view

Kernel developers expect to be maintaining the code 5-10 years from now

Page 19: A Guide to the Linux Kernel Development Process - FreedomHEC

19

Peer review

No code is perfectit can always be improvedheed requests for changes

Page 20: A Guide to the Linux Kernel Development Process - FreedomHEC

20

Developers are individuals

...separate from their employers

Page 21: A Guide to the Linux Kernel Development Process - FreedomHEC

21

No ownership of code

Even code you wrote

Page 22: A Guide to the Linux Kernel Development Process - FreedomHEC

22

No regressions

...even to fix other problems

“So we don't fix bugs by introducing new problems. That way lies madness, and nobody ever knows if you actually make any real progress at all. Is it two steps forwards, one step back, or one step forward and two steps back?”-- Linus Torvalds

Page 23: A Guide to the Linux Kernel Development Process - FreedomHEC

23

No inherent right to inclusion

Changes require justificationOther solutions may win out

Page 24: A Guide to the Linux Kernel Development Process - FreedomHEC

24

Trees

Page 25: A Guide to the Linux Kernel Development Process - FreedomHEC

25

Mainline kernel

Linus Torvalds's kernel2-3 month release cycle

Page 26: A Guide to the Linux Kernel Development Process - FreedomHEC

26

The release cycle

Page 27: A Guide to the Linux Kernel Development Process - FreedomHEC

27

The release cycle

Page 28: A Guide to the Linux Kernel Development Process - FreedomHEC

28

-stable

Important updates to the mainlineSecurity fixesSevere bugsMaintained for ~6 months

Page 29: A Guide to the Linux Kernel Development Process - FreedomHEC

29

Distributor kernels

Based on -stable

May include significant changes“enterprise” kernels especially

Maintenance period varies

Page 30: A Guide to the Linux Kernel Development Process - FreedomHEC

30

Development trees

linux-nextStaging area for the next mainline cyclePatch integrationEarly testing

-mmNow based on linux-nextCollection point for miscellaneous patchesMore early testing

Page 31: A Guide to the Linux Kernel Development Process - FreedomHEC

31

Subsystem trees

Development for a single subsystemFeed into the mainline...or another subsystem tree

Page 32: A Guide to the Linux Kernel Development Process - FreedomHEC

32

Subsystem maintainers

...are the true gatekeepers

But their power is not absolute

Page 33: A Guide to the Linux Kernel Development Process - FreedomHEC

33

Page 34: A Guide to the Linux Kernel Development Process - FreedomHEC

34

Page 35: A Guide to the Linux Kernel Development Process - FreedomHEC

35

The moral of the story

Developers should target subsystem trees

Page 36: A Guide to the Linux Kernel Development Process - FreedomHEC

36

Tips

Page 37: A Guide to the Linux Kernel Development Process - FreedomHEC

37

Getting started: companies

Develop skills in-house

Page 38: A Guide to the Linux Kernel Development Process - FreedomHEC

38

Getting started: companies

Get legal on board

Page 39: A Guide to the Linux Kernel Development Process - FreedomHEC

39

Getting started: companies

Ensure management understands the process

Page 40: A Guide to the Linux Kernel Development Process - FreedomHEC

40

Getting started: companies

Let your developers contribute

Page 41: A Guide to the Linux Kernel Development Process - FreedomHEC

41

Getting started: developersThe #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".

-- Andrew Morton

Page 42: A Guide to the Linux Kernel Development Process - FreedomHEC

42

Getting started: developers

Review code!

Page 43: A Guide to the Linux Kernel Development Process - FreedomHEC

43

Communication (1)

Communicate your plans early

Page 44: A Guide to the Linux Kernel Development Process - FreedomHEC

44

Communication (2)

Specify requirements carefully“Why” instead of “what”

Page 45: A Guide to the Linux Kernel Development Process - FreedomHEC

45

Communication (3)

Listen

Page 46: A Guide to the Linux Kernel Development Process - FreedomHEC

46

Aim for the mainline

...early!

“Do NOT fall into the trap of adding more and more stuff to an out-of-tree project. It just makes it harder and harder to get it merged. There are many examples of this”

-- Andrew Morton

Page 47: A Guide to the Linux Kernel Development Process - FreedomHEC

47

Posting code

Read the process document

Justify the changeWhat problem is fixed?What feature is added (and why)?Effects on performance?

Page 48: A Guide to the Linux Kernel Development Process - FreedomHEC

48

Where to post?

Find the subsystem mailing list

Find the maintainer

Consider linux-kernel

Page 49: A Guide to the Linux Kernel Development Process - FreedomHEC

49

Expect to make changes

No code submission is perfect

Page 50: A Guide to the Linux Kernel Development Process - FreedomHEC

50

Dealing with reviewers

Do not ignore reviews

Be nice to reviewers

Understand their motivationDo not take it personally

Page 51: A Guide to the Linux Kernel Development Process - FreedomHEC

51

Signed-off-by:

Code submissions require a signoff...a statement that it can be contributed

under the GPL

Page 52: A Guide to the Linux Kernel Development Process - FreedomHEC

52

About linux-kernel

Volume is highDiscussion is ... uninhibitedIt's where the community gathers

Avoiding l-k may be appealing...but it has its hazards

Page 53: A Guide to the Linux Kernel Development Process - FreedomHEC

53

Follow through

“Dump and run” submissions are not appreciated

Page 54: A Guide to the Linux Kernel Development Process - FreedomHEC

54

Be part of the process

The kernel needs you

Page 55: A Guide to the Linux Kernel Development Process - FreedomHEC

55

Questions?

Development process documenthttp://ldn.linuxfoundation.org/book/how-

participate-linux-community