![Page 1: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/1.jpg)
Joining the herd of cats:how to work with the
kernel development process
Jonathan [email protected]
Slides: http://lwn.net/talks/elc2007/
![Page 2: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/2.jpg)
I:Introduction
![Page 3: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/3.jpg)
Why?
“There are a number of very good Linux kernel developers, but they tend to get outshouted by a large crowd of arrogant fools. Trying to communicate user requirements to these people is a waste of time. They are much too 'intelligent' to listen to lesser mortals.”
-- Jack O'Quin, Linux audio developer
![Page 4: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/4.jpg)
Why?
There is great value to working with the communityInfluence development directionsOffload code maintenanceBetter support for customersMore efficient developmentBenefit from community expertiseTake ownership of your platform – and make it better
![Page 5: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/5.jpg)
Free software is different
Proprietary softwareProprietary software
Product driven
Free software
Process driven
![Page 6: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/6.jpg)
Free software is different
Proprietary softwareProprietary software
Product driven
Top-down requirements
Free software
Process driven
Bottom-up requirements
![Page 7: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/7.jpg)
Free software is different
Proprietary softwareProprietary software
Product driven
Top-down requirements
Short time horizon
Free software
Process driven
Bottom-up requirements
Long-term view
![Page 8: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/8.jpg)
Free software is different
Proprietary softwareProprietary software
Product driven
Top-down requirements
Short time horizon
Internal QA
Free software
Process driven
Bottom-up requirements
Long-term view
External QA
![Page 9: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/9.jpg)
Free software is different
Proprietary softwareProprietary software
Product driven
Top-down requirements
Short time horizon
Internal QA
Hierarchical decisions
Free software
Process driven
Bottom-up requirements
Long-term view
External QA
Consensus decisions
![Page 10: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/10.jpg)
Free software is different
Proprietary softwareProprietary software
Product driven
Top-down requirements
Short time horizon
Internal QA
Hierarchical decisions
Private
Free software
Process driven
Bottom-up requirements
Long-term view
External QA
Consensus decisions
Public
![Page 11: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/11.jpg)
Free software is different
Proprietary softwareProprietary software
Product driven
Top-down requirements
Short time horizon
Internal QA
Hierarchical decisions
Private
Complete control
Free software
Process driven
Bottom-up requirements
Long-term view
External QA
Consensus decisions
Public
Little control
![Page 12: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/12.jpg)
The kernel is even more different
![Page 13: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/13.jpg)
It's big
Over 2,000 contributors 3/2006 to 4/2007
Only 10 contributed over 1% of changes
![Page 14: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/14.jpg)
It's worldwide
Significant contributions fromNorth AmericaEuropeJapanSouth AmericaIndia...
![Page 15: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/15.jpg)
It's of great commercial interest
At least 2/3 of kernel work is by paid developers
![Page 16: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/16.jpg)
It's growing quickly
750,000 lines added 3/2006 to 3/2007
![Page 17: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/17.jpg)
It's the wild west
![Page 18: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/18.jpg)
It's the wild west
...but that is changing
![Page 19: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/19.jpg)
II:Processissues
![Page 20: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/20.jpg)
Do: understand the patch lifecycle
Much developer pain results from a failure to understand how code gets into the kernel.
![Page 21: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/21.jpg)
Patch lifecycle: the beginning
![Page 22: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/22.jpg)
Patch Lifecycle: the RFC
![Page 23: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/23.jpg)
Patch lifecycle: first code
![Page 24: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/24.jpg)
Patch lifecycle: repairs
![Page 25: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/25.jpg)
Patch lifecycle: wider testing
![Page 26: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/26.jpg)
Finally: into the mainline
![Page 27: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/27.jpg)
Patch lifecycle: repeat
![Page 28: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/28.jpg)
Lifecycle: the corporate view
![Page 29: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/29.jpg)
Do: communicate early
Let the community know what you are doing
Avoid duplication
Avoid mistakes
![Page 30: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/30.jpg)
Do: release early
Big vendor mistake:“We'll release the code after it passes internal QA”
By then it is too late
![Page 31: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/31.jpg)
Do: expect to make changes
No initial code submission is perfect
Kernel developers have different goals
![Page 32: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/32.jpg)
The kernel release cycle
![Page 33: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/33.jpg)
The kernel release cycle
![Page 34: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/34.jpg)
Do: observe the merge window
“I'm really fed up with having to pull big changes after the merge window, because it just doesn't seem to let up. I'm going to go postal on the next maintainer who doesn't understand what 'merge window' and 'fixes only' means”
-- Linus Torvalds
![Page 35: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/35.jpg)
II:Patch
submission
![Page 36: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/36.jpg)
Do: Send in your changes
Avoid having to carry changes out-of-tree
Draw attention to problems
Influence the direction of the kernel
![Page 37: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/37.jpg)
Don't: send multipurpose patches
Patches should:Be small (if possible)Do exactly one thing
If you have a big change:Split it into independent pieces
![Page 38: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/38.jpg)
Do: send bisectable patches
“git bisect” is a great tool for finding regressionsBinary search on the patch stream
To support bisect:Your patch series must work after every patch
![Page 39: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/39.jpg)
Do: take care in submitting patches
Use diff -uNo MIME attachmentsDescribe them properly
A one-line summary at topLonger description below (if needed)Justify the patch
Include a Signed-off-by: lineAvoid word-wrapping
Thunderbird is especially bad here
See:Documentation/SubmittingPatches
![Page 40: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/40.jpg)
Find the correct mailing list
linux-kernel is not the right place for all patches
Example: networking patches go to netdev
See:MAINTAINERSvger.kernel.org/vger-lists.html
![Page 41: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/41.jpg)
Aside: the new linuxkernel subscriber
1) I want to be part of this, I'll subscribe
![Page 42: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/42.jpg)
Aside: the new linuxkernel subscriber
1) I want to be part of this, I'll subscribe2) I have mail from Linus! Cool!
![Page 43: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/43.jpg)
Aside: the new linuxkernel subscriber
1) I want to be part of this, I'll subscribe2) I have mail from Linus! Cool!
...I wish I understood it
![Page 44: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/44.jpg)
Aside: the new linuxkernel subscriber
1) I want to be part of this, I'll subscribe2) I have mail from Linus! Cool!
...I wish I understood it3) Hmm...I have a lot of mail from Linus
![Page 45: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/45.jpg)
Aside: the new linuxkernel subscriber
1) I want to be part of this, I'll subscribe2) I have mail from Linus! Cool!
...I wish I understood it3) Hmm...I have a lot of mail from Linus
...I thought he was a nicer guy than that.
![Page 46: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/46.jpg)
Aside: the new linuxkernel subscriber
1) I want to be part of this, I'll subscribe2) I have mail from Linus! Cool!
...I wish I understood it3) Hmm...I have a lot of mail from Linus
...I thought he was a nicer guy than that.4) 350 new messages. Ouch!
...I was only gone for an hour...
![Page 47: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/47.jpg)
Aside: the new linuxkernel subscriber
1) I want to be part of this, I'll subscribe2) I have mail from Linus! Cool!
...I wish I understood it3) Hmm...I have a lot of mail from Linus
...I thought he was a nicer guy than that.4) 350 new messages. Ouch!
...I was only gone for an hour...5) I'll post my great idea for using C++ in the kernel
![Page 48: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/48.jpg)
Aside: the new linuxkernel subscriber
1) I want to be part of this, I'll subscribe2) I have mail from Linus! Cool!
...I wish I understood it3) Hmm...I have a lot of mail from Linus
...I thought he was a nicer guy than that.4) 350 new messages. Ouch!
...I was only gone for an hour...5) I'll post my great idea for using C++ in the kernel6) These people have no clue of how to program!
![Page 49: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/49.jpg)
Aside: the new linuxkernel subscriber
1) I want to be part of this, I'll subscribe2) I have mail from Linus! Cool!
...I wish I understood it3) Hmm...I have a lot of mail from Linus
...I thought he was a nicer guy than that.4) 350 new messages. Ouch!
...I was only gone for an hour...5) I'll post my great idea for using C++ in the kernel6) These people have no clue of how to program!7) My full mailbox is making me miss those great
penny stock alerts.
![Page 50: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/50.jpg)
Aside: the new linuxkernel subscriber
1) I want to be part of this, I'll subscribe2) I have mail from Linus! Cool!
...I wish I understood it3) Hmm...I have a lot of mail from Linus
...I thought he was a nicer guy than that.4) 350 new messages. Ouch!
...I was only gone for an hour...5) I'll post my great idea for using C++ in the kernel6) These people have no clue of how to program!7) My full mailbox is making me miss those great
penny stock alerts.8) Unsubscribe. I'll go run Windows now.
![Page 51: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/51.jpg)
On mailing lists
Ask whether you really need to read linux-kernelMany of us do
Consider a subsystem list instead
If so, read it sparinglyLook for interesting topics and contributors
![Page 52: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/52.jpg)
Do: listen to reviewers
Reviewing patches is hard, thankless work
When a reviewer makes a commentSay “thanks”Respond politelyFix the problem (or justify the current code)
![Page 53: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/53.jpg)
Don't: attack reviewers
...even if they are rude
![Page 54: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/54.jpg)
Don't: take criticism personally
Patch reviewers do not hate you
They do not hate your company
They do not hate your employees
![Page 55: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/55.jpg)
Requests for major changes
Reviewers may ask for big changesPush functionality into higher layersReimplement major functionalityClean up a longstanding mess
Their goals are different than yoursLong-term maintainability is key
Try to accommodate these requestsThey usually make sense in the long term
![Page 56: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/56.jpg)
Do: Let go
Others will patch your codeAn Acked-by: for good changes is polite
They may replace it outright!Consider it the sincerest form of flattery
Once you release code under a free license...you no longer have controlIt gets better without work from you!
![Page 57: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/57.jpg)
III:Codingissues
![Page 58: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/58.jpg)
Do: follow the coding style
Documentation/CodingStyle
![Page 59: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/59.jpg)
Do: avoid unnecessary abstractions
Things to avoid:HAL layersUnused parameters “just in case”Single-line functions
![Page 60: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/60.jpg)
API stability
There is no stable internal kernel APIGet used to it
Ways to copeGet your code into the mainlinehttp://lwn.net/Articles/2.6-kernel-api
![Page 61: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/61.jpg)
Don't: add multiversion code
Support the current mainline kernel...and no others
![Page 62: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/62.jpg)
Do: clean up your messes
Breaking an internal API is OK...if there is a good reason for it
But: you have the responsibility to fix in-tree code
![Page 63: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/63.jpg)
Don't add regressions
...even to fix something else
![Page 64: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/64.jpg)
Don't: change the userspace API
Breaking applications is bad news
The API includesSystem call behavior/proc filesSysfs filesNetlink
![Page 65: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/65.jpg)
Don't: assume all the world is a PC
Linux runs on all kinds of systemshandhelds to supercomputers32/64 bitSingle processor through thousands of processorsA few dozen architectures
Your code should build and work everywhere
In particular:Get your locking right from the beginning
![Page 66: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/66.jpg)
Do: avoid silly mistakes
Use the tools:gcc -Wlockdepfault injection frameworkslab poisoningsparse...
![Page 67: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/67.jpg)
Red flags
#ifdeftypedefsioctl()Silenceinline functionsHeavy stack usageUnnecessary abstractions
HAL layersSingle-line functionsUnused parameters
![Page 68: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/68.jpg)
IV:Finalnotes
![Page 69: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/69.jpg)
Don't: submit tainted code
Read the Developer's Certification of OriginBe sure you mean it
Be very careful with reverse engineeringChinese wall approach should be used
![Page 70: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/70.jpg)
Don't: ship binaryonly modules
Legality of these modules is dubious
The benefit is even more dubious
Respect your customers: give them the source
![Page 71: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/71.jpg)
Do: use the resources available
There is information and help out therekernelnewbies.orgKernel mentorsDocumentation/HOWTOLWN
![Page 72: Joining the herd of cats: how to work with the kernel ... · Kernel developers have different goals. The kernel release cycle. The kernel release cycle ... Heavy stack usage Unnecessary](https://reader033.vdocument.in/reader033/viewer/2022050217/5f62e820752b6236d27ebeca/html5/thumbnails/72.jpg)
Do: join in and have fun
Questions....?