SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
(Kernel) Upstreaming 101:
Social and Technical Lessons
March 5, 2013
Deepak Saxena
dsaxena@linaro.org
Who Am I? Why Listen To Me?
● Kernel Working Group TL
● I make pretty spreadsheets and run meetings
● Before that I did write code!
● 12 years kernel experience
● One of first folks at Intel to work on Linux code
● Developed and maintained IXP* Xscale NPU ports
● Kernel maintainer at MontaVista for several years
● Reviewed all patches for distro kernel
● Reviewed thousands of lines of vendor BSP code
● OLPC kernel maintainer for about 1.5 years
Today's Goals
● Provide an overview of upstreaming code
● Social and Technical
● From Design to Submitting Patches
● How does the process differ from closed development?
● Some general guidelines on design and coding.
● Some low level details on submitting patches.
● Geared at those who are completely new to this world
● For both Managers and Engineers
The Problem
● Ever increasing number of Linux developers!
● Specially in the ARM world
● Lots of good technical documentation!
● Linux Device Drivers - http://lwn.net/Kernel/LDD3/
● Understanding the Linux Kernel - http://goo.gl/p4pM4
● Linux Kernel Development - http://goo.gl/0YY27
● Organizations beginning to understand technical
and business benefits of getting code upstream!
● More developers interested in working upstream!
● This is a problem?
The Issues...
● Using documented APIs and infrastructure is easy
● Creating new APIs and infrastructure is hard
● Creating good APIs and infrastructure is harder
● Creating good APIs and infrastructure for upstream is even harder
● Many SOC problems require creating new subsystems
● Or modifying existing ones to support new features
● Books tend to be x86 oriented
● Do not cover drivers common to other arches: i2c, spi, etc
● Make assumptions about underlying HW
● (See Upcoming Porting Linux by Jon Masters, ETA 2013)
● Working with the community is not documented
● Much tribal knowledge on the process
● Same mistakes are often made by new participants
V3.4
Who Exactly Is The Community?
(From list of top 3.4 contributors: http://lwn.net/Articles/496193/)
Upstream Development:
The Right and Wrong Way
3.x Release 3.y+1-rc1 Release 3.y+1 Release
2 Week Merge Window 6-12 Week Stabilization
Your Development
Starts Here
Months to Years...
If you wait until this window to release your
code, expecting it to just go in, it will not (there
have been a few exceptions, but very rare). You
need to release your code early and often
during your development phase to get feedback
and fix issues as they come up.
Upstream Based Development
Socialize
Ideas
Post
Patches
Community
Review
Revise
Patches
Patches
OK?
Redesign or
Minor Fixes?
Start
Development
Redesign
YES
●Release Early, Release Often
●Iterate Design/Code Cycles
●Social component very important
●Discussion Time >> Coding Time
Avoiding Issues:
Don't Re-invent the Wheel
● Do Your Homework
● Many problems already have known solutions in Linux
● Driver APIs for specific functionality
● User/Kernel interfaces and system level tools
● It may just not be obvious at first.
● May not be documented in one single place
● May just be tribal knowledge
● Google is your friend here
● Read the code
● Ask the experts
● Release Early, Release Often to save your time!
Avoiding Issues:
Abstraction
● Don't Abstract Unnecessarily
● NO cross-OS HALs (unless extremely well designed)
● Don't add wrappers around existing in-kernel APIs
● Too much abstraction makes code harder to maintain
● Code is harder to read/debug
● Abstraction layer might have bugs
● Kernel API changes are hidden
● Difficult for someone new to get involved
● Release Early, Release Often to find these issues early!
Avoiding Issues:
Solving Common Problems
● Your HW is Not Unique
● Your HW may seem unique at first, however...
● Others are close by or will soon follow
● Most HW comes from similar research paths
● They will need same kernel support as you do
● Don't blindly add hooks to kernel for these features
● We don't want multiple implementations of same idea
● Need to add APIs at proper points in kernel
● Work with external developers to develop these
● Work with other HW vendors
● !THIS IS WHAT LINARO IS ALL ABOUT!
● Release Early, Release Often to find common solutions!
Avoiding Issues:
Good API Design
● Good APIs are:
● Easy to use & Hard to misuse
● Follow KISS Principle: Keep it Simple Stupid
● Should be very clear from just name, parameters
● Should be obvious when you use it wrongly
● Build time errors or obvious error values
● Just read Rusty's Blog Post:
● http://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html
● Release Early, Release often so you don't built a whole
stack of software on top of poorly designed APIs!
Practicalities:
How Do I Post Patches?
● Read Documentation/SubmittingPatches
● Send email to maintainers and list
● One cover email with:
● Summary of WHAT you are solving
● Explaining WHY you used your approach
● Talk about any dependent patchsets
● Don't assume knowledge about your technology area
● git log --diff (which includes patch headers)
● Always post patch against latest tip
● One message per patch
● Break up your changes into small units that build on each other
● If you are adding 100's of lines to one function...you're doing it wrong
● Refactor your patches using “git-rebase -i”
● Go to today's git session
Practicalities:
Who do I send my patches to?
● Use git-log and git-blame commands
● git-log to find out the last few people to make changes
● git-blame to find out if
● Read MAINTAINERS file in top level directory
● get-maintainers.pl script
● Will give you mailing list and maintainer address
~/src/linux$ ./scripts/get_maintainer.pl spi_message_queue.patch
Grant Likely <grant.likely@secretlab.ca> (maintainer:SPI SUBSYSTEM)
Randy Dunlap <rdunlap@xenotime.net> (maintainer:DOCUMENTATION)
spi­devel­general@lists.sourceforge.net (open list:SPI SUBSYSTEM)
linux­doc@vger.kernel.org (open list:DOCUMENTATION)
linux­kernel@vger.kernel.org (open list)
~/src/linux$ ./scripts/get_maintainer.pl ­f drivers/mfd/max8925­core.c
Samuel Ortiz <sameo@linux.intel.com> (supporter:MULTIFUNCTION DEV...)
linux­kernel@vger.kernel.org (open list)
:~/src/linux$ ./scripts/get_maintainer.pl ­f drivers/i2c
"Jean Delvare (PC drivers, core)" <khali@linux­fr.org> (maintainer:I2C SUBSYSTEM)
"Ben Dooks (embedded platforms)" <ben­linux@fluff.org> (maintainer:I2C SUBSYSTEM)
"Wolfram Sang (embedded platforms)" <w.sang@pengutronix.de> (maintainer:I2C SUBSYSTEM)
linux­i2c@vger.kernel.org (open list:I2C SUBSYSTEM)
linux­kernel@vger.kernel.org (open list)
Practicalities:
Using Signed-Off By
● Signed-off-by is legally binding!
● Make sure you have approval!
        Developer's Certificate of Origin 1.1
        By making a contribution to this project, I certify that:
        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or
        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or
        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.
        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign­off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.
Practicalities:
Nobody Replied to My Patches!
● Be patient, don't expect an immediate response.
● Check mailing list archives:
● What's the typical response rate?
● Did the maintainer announce a vacation?
● Is this a merge window?
● Everyone is super busy, try again when it closes
● If it really seems like patches got dropped, email
the maintainer privately with a pointer to thread.
● If still no response:
● Ping one level up in tree.
● For drivers: Ping Greg KH
● Sometimes you just have to email patches to Linus directly
● Shames the maintainer, gets his/her attention
Practicalities:
Responses From Other Developers
● Acked-by: This person is OK with the changes.
Usually a maintainer of a subsystem affected by
patch.
● Reviewed-by: This person has done a thorough
technical review of the patch.
● Tested-by: This person did some level of testing.
Allows maintainer to know that it has been
validated on an environment other than original
author's.
Practicalities:
When Someone Attacks You :(
● It unfortunately happens :(
● Do NOT Escalate
● Take a step back
● Go work on something else
● Grab a beer (BUT NOT WHILE REPLYING!)
● Pick out the technical issues
● Get some help in reading the negative email
● Respond to just these
● Hint: Attending conferences and meeting people
face to face reduces the likelihood of this
happening.
Practicalities:
I can't Release Early and Often
● Ask for Private Reviews
● NDAs with upstream maintainer(s) and experts
● Linaro can possibly help here
● Several of these people are part of our organization
● We have good relationships with many upstream maintainers
● Can you release the concepts if not the code?
● Fine art of providing enough details w/o giving away the
secret sauce
● What are the high level problems you want to solve?
Summary
● The community is just a bunch of developers
● Like you, just with more experience of the process.
● Most of them really want to help!
● Good kernel code:
● Doesn't re-invent what's already there
● Doesn't add abstraction for the sake of abstraction
● Solves common issues - abstraction only when needed
● Has well-designed APIs
● Read the documentation and the code
● Participate openly and respectfully
● Ask us for help
● Release Early, Release Often :)
Questions or Comments?

Contenu connexe

Tendances

Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
Omid Vahdaty
 
JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before
JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone beforeJAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before
JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before
jazoon13
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
Hannes Lowette
 

Tendances (20)

Open source 101 for students
Open source 101 for studentsOpen source 101 for students
Open source 101 for students
 
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael KuehneTDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
 
Breaking into Open Source and Linux: A USB 3.0 Success Story
Breaking into Open Source and Linux: A USB 3.0 Success StoryBreaking into Open Source and Linux: A USB 3.0 Success Story
Breaking into Open Source and Linux: A USB 3.0 Success Story
 
Test driven development with sonarQube
Test driven development with sonarQubeTest driven development with sonarQube
Test driven development with sonarQube
 
CI doesn’t start with Jenkins
CI doesn’t start with JenkinsCI doesn’t start with Jenkins
CI doesn’t start with Jenkins
 
Unit Testing TypeScript
Unit Testing TypeScriptUnit Testing TypeScript
Unit Testing TypeScript
 
Test drive on driven development process
Test drive on driven development processTest drive on driven development process
Test drive on driven development process
 
JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before
JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone beforeJAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before
JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before
 
The Development History of PVS-Studio for Linux
The Development History of PVS-Studio for LinuxThe Development History of PVS-Studio for Linux
The Development History of PVS-Studio for Linux
 
Kernel Recipes 2017 - The state of kernel self-protection - Kees Cook
Kernel Recipes 2017 - The state of kernel self-protection - Kees CookKernel Recipes 2017 - The state of kernel self-protection - Kees Cook
Kernel Recipes 2017 - The state of kernel self-protection - Kees Cook
 
Android lint presentation
Android lint presentationAndroid lint presentation
Android lint presentation
 
Long Life Software
Long Life SoftwareLong Life Software
Long Life Software
 
Test Drive Development
Test Drive DevelopmentTest Drive Development
Test Drive Development
 
Winning the battle against Automated testing
Winning the battle against Automated testingWinning the battle against Automated testing
Winning the battle against Automated testing
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
 
DevOpsDaysRiga 2018: Neil Crawford - Trunk based development, continuous depl...
DevOpsDaysRiga 2018: Neil Crawford - Trunk based development, continuous depl...DevOpsDaysRiga 2018: Neil Crawford - Trunk based development, continuous depl...
DevOpsDaysRiga 2018: Neil Crawford - Trunk based development, continuous depl...
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
 
Version Uncontrolled - How to Manage Your Version Control (whitepaper)
Version Uncontrolled - How to Manage Your Version Control (whitepaper)Version Uncontrolled - How to Manage Your Version Control (whitepaper)
Version Uncontrolled - How to Manage Your Version Control (whitepaper)
 
Python lecture 01
Python lecture 01Python lecture 01
Python lecture 01
 

Similaire à LCA13: Upstreaming 101

icebreakerwithdevops-150218112943-conversion-gate02
icebreakerwithdevops-150218112943-conversion-gate02icebreakerwithdevops-150218112943-conversion-gate02
icebreakerwithdevops-150218112943-conversion-gate02
Manohar Kumar
 
The adoption of FOSS workfows in commercial software development: the case of...
The adoption of FOSS workfows in commercial software development: the case of...The adoption of FOSS workfows in commercial software development: the case of...
The adoption of FOSS workfows in commercial software development: the case of...
dmgerman
 
Agile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_pptAgile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_ppt
Hitesh Kumar
 

Similaire à LCA13: Upstreaming 101 (20)

Kernel Recipes 2015: How to choose a kernel to ship with a product
Kernel Recipes 2015: How to choose a kernel to ship with a productKernel Recipes 2015: How to choose a kernel to ship with a product
Kernel Recipes 2015: How to choose a kernel to ship with a product
 
SFO15-TR2: Upstreaming 101
SFO15-TR2: Upstreaming 101SFO15-TR2: Upstreaming 101
SFO15-TR2: Upstreaming 101
 
Linux Kernel Introduction
Linux Kernel IntroductionLinux Kernel Introduction
Linux Kernel Introduction
 
LAS16-TR02: Upstreaming 101
LAS16-TR02: Upstreaming 101LAS16-TR02: Upstreaming 101
LAS16-TR02: Upstreaming 101
 
Ice breaker with dev ops
Ice breaker with dev opsIce breaker with dev ops
Ice breaker with dev ops
 
icebreakerwithdevops-150218112943-conversion-gate02
icebreakerwithdevops-150218112943-conversion-gate02icebreakerwithdevops-150218112943-conversion-gate02
icebreakerwithdevops-150218112943-conversion-gate02
 
Get your FLOSS problems solved
Get your FLOSS problems solvedGet your FLOSS problems solved
Get your FLOSS problems solved
 
HKG15-901: Upstreaming 101
HKG15-901: Upstreaming 101HKG15-901: Upstreaming 101
HKG15-901: Upstreaming 101
 
2 b 2-hatta
2 b 2-hatta2 b 2-hatta
2 b 2-hatta
 
The adoption of FOSS workfows in commercial software development: the case of...
The adoption of FOSS workfows in commercial software development: the case of...The adoption of FOSS workfows in commercial software development: the case of...
The adoption of FOSS workfows in commercial software development: the case of...
 
Building Better FLOSS Community Relationships @ FB
Building Better  FLOSS Community Relationships @ FBBuilding Better  FLOSS Community Relationships @ FB
Building Better FLOSS Community Relationships @ FB
 
Getting started contributing to Apache Spark
Getting started contributing to Apache SparkGetting started contributing to Apache Spark
Getting started contributing to Apache Spark
 
Agile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_pptAgile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_ppt
 
BUD17-TR02: Upstreaming 101
BUD17-TR02: Upstreaming 101 BUD17-TR02: Upstreaming 101
BUD17-TR02: Upstreaming 101
 
Upstreaming 101 - SFO17-TR02
Upstreaming 101 - SFO17-TR02Upstreaming 101 - SFO17-TR02
Upstreaming 101 - SFO17-TR02
 
Version Control, Writers, and Workflows
Version Control, Writers, and WorkflowsVersion Control, Writers, and Workflows
Version Control, Writers, and Workflows
 
Teaching Open Source In The University
Teaching Open Source In The UniversityTeaching Open Source In The University
Teaching Open Source In The University
 
Development Environment Tips
Development Environment TipsDevelopment Environment Tips
Development Environment Tips
 
Picking the right architecture and sticking to it
Picking the right architecture and sticking to itPicking the right architecture and sticking to it
Picking the right architecture and sticking to it
 
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
 

Plus de Linaro

Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea GalloDeep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Linaro
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018
Linaro
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Linaro
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Linaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
Linaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
Linaro
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
Linaro
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMU
Linaro
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation
Linaro
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
Linaro
 

Plus de Linaro (20)

Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea GalloDeep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
 
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta VekariaArm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
 
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua MoraHuawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
 
Bud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaBud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qa
 
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018
 
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
 
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteHKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening Keynote
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP Workshop
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allHKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMU
 
HKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MHKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8M
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 

LCA13: Upstreaming 101

  • 1. (Kernel) Upstreaming 101: Social and Technical Lessons March 5, 2013 Deepak Saxena dsaxena@linaro.org
  • 2. Who Am I? Why Listen To Me? ● Kernel Working Group TL ● I make pretty spreadsheets and run meetings ● Before that I did write code! ● 12 years kernel experience ● One of first folks at Intel to work on Linux code ● Developed and maintained IXP* Xscale NPU ports ● Kernel maintainer at MontaVista for several years ● Reviewed all patches for distro kernel ● Reviewed thousands of lines of vendor BSP code ● OLPC kernel maintainer for about 1.5 years
  • 3. Today's Goals ● Provide an overview of upstreaming code ● Social and Technical ● From Design to Submitting Patches ● How does the process differ from closed development? ● Some general guidelines on design and coding. ● Some low level details on submitting patches. ● Geared at those who are completely new to this world ● For both Managers and Engineers
  • 4. The Problem ● Ever increasing number of Linux developers! ● Specially in the ARM world ● Lots of good technical documentation! ● Linux Device Drivers - http://lwn.net/Kernel/LDD3/ ● Understanding the Linux Kernel - http://goo.gl/p4pM4 ● Linux Kernel Development - http://goo.gl/0YY27 ● Organizations beginning to understand technical and business benefits of getting code upstream! ● More developers interested in working upstream! ● This is a problem?
  • 5. The Issues... ● Using documented APIs and infrastructure is easy ● Creating new APIs and infrastructure is hard ● Creating good APIs and infrastructure is harder ● Creating good APIs and infrastructure for upstream is even harder ● Many SOC problems require creating new subsystems ● Or modifying existing ones to support new features ● Books tend to be x86 oriented ● Do not cover drivers common to other arches: i2c, spi, etc ● Make assumptions about underlying HW ● (See Upcoming Porting Linux by Jon Masters, ETA 2013) ● Working with the community is not documented ● Much tribal knowledge on the process ● Same mistakes are often made by new participants
  • 6. V3.4 Who Exactly Is The Community? (From list of top 3.4 contributors: http://lwn.net/Articles/496193/)
  • 7. Upstream Development: The Right and Wrong Way 3.x Release 3.y+1-rc1 Release 3.y+1 Release 2 Week Merge Window 6-12 Week Stabilization Your Development Starts Here Months to Years... If you wait until this window to release your code, expecting it to just go in, it will not (there have been a few exceptions, but very rare). You need to release your code early and often during your development phase to get feedback and fix issues as they come up.
  • 8. Upstream Based Development Socialize Ideas Post Patches Community Review Revise Patches Patches OK? Redesign or Minor Fixes? Start Development Redesign YES ●Release Early, Release Often ●Iterate Design/Code Cycles ●Social component very important ●Discussion Time >> Coding Time
  • 9. Avoiding Issues: Don't Re-invent the Wheel ● Do Your Homework ● Many problems already have known solutions in Linux ● Driver APIs for specific functionality ● User/Kernel interfaces and system level tools ● It may just not be obvious at first. ● May not be documented in one single place ● May just be tribal knowledge ● Google is your friend here ● Read the code ● Ask the experts ● Release Early, Release Often to save your time!
  • 10. Avoiding Issues: Abstraction ● Don't Abstract Unnecessarily ● NO cross-OS HALs (unless extremely well designed) ● Don't add wrappers around existing in-kernel APIs ● Too much abstraction makes code harder to maintain ● Code is harder to read/debug ● Abstraction layer might have bugs ● Kernel API changes are hidden ● Difficult for someone new to get involved ● Release Early, Release Often to find these issues early!
  • 11. Avoiding Issues: Solving Common Problems ● Your HW is Not Unique ● Your HW may seem unique at first, however... ● Others are close by or will soon follow ● Most HW comes from similar research paths ● They will need same kernel support as you do ● Don't blindly add hooks to kernel for these features ● We don't want multiple implementations of same idea ● Need to add APIs at proper points in kernel ● Work with external developers to develop these ● Work with other HW vendors ● !THIS IS WHAT LINARO IS ALL ABOUT! ● Release Early, Release Often to find common solutions!
  • 12. Avoiding Issues: Good API Design ● Good APIs are: ● Easy to use & Hard to misuse ● Follow KISS Principle: Keep it Simple Stupid ● Should be very clear from just name, parameters ● Should be obvious when you use it wrongly ● Build time errors or obvious error values ● Just read Rusty's Blog Post: ● http://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html ● Release Early, Release often so you don't built a whole stack of software on top of poorly designed APIs!
  • 13. Practicalities: How Do I Post Patches? ● Read Documentation/SubmittingPatches ● Send email to maintainers and list ● One cover email with: ● Summary of WHAT you are solving ● Explaining WHY you used your approach ● Talk about any dependent patchsets ● Don't assume knowledge about your technology area ● git log --diff (which includes patch headers) ● Always post patch against latest tip ● One message per patch ● Break up your changes into small units that build on each other ● If you are adding 100's of lines to one function...you're doing it wrong ● Refactor your patches using “git-rebase -i” ● Go to today's git session
  • 14. Practicalities: Who do I send my patches to? ● Use git-log and git-blame commands ● git-log to find out the last few people to make changes ● git-blame to find out if ● Read MAINTAINERS file in top level directory ● get-maintainers.pl script ● Will give you mailing list and maintainer address ~/src/linux$ ./scripts/get_maintainer.pl spi_message_queue.patch Grant Likely <grant.likely@secretlab.ca> (maintainer:SPI SUBSYSTEM) Randy Dunlap <rdunlap@xenotime.net> (maintainer:DOCUMENTATION) spi­devel­general@lists.sourceforge.net (open list:SPI SUBSYSTEM) linux­doc@vger.kernel.org (open list:DOCUMENTATION) linux­kernel@vger.kernel.org (open list) ~/src/linux$ ./scripts/get_maintainer.pl ­f drivers/mfd/max8925­core.c Samuel Ortiz <sameo@linux.intel.com> (supporter:MULTIFUNCTION DEV...) linux­kernel@vger.kernel.org (open list) :~/src/linux$ ./scripts/get_maintainer.pl ­f drivers/i2c "Jean Delvare (PC drivers, core)" <khali@linux­fr.org> (maintainer:I2C SUBSYSTEM) "Ben Dooks (embedded platforms)" <ben­linux@fluff.org> (maintainer:I2C SUBSYSTEM) "Wolfram Sang (embedded platforms)" <w.sang@pengutronix.de> (maintainer:I2C SUBSYSTEM) linux­i2c@vger.kernel.org (open list:I2C SUBSYSTEM) linux­kernel@vger.kernel.org (open list)
  • 15. Practicalities: Using Signed-Off By ● Signed-off-by is legally binding! ● Make sure you have approval!         Developer's Certificate of Origin 1.1         By making a contribution to this project, I certify that:         (a) The contribution was created in whole or in part by me and I             have the right to submit it under the open source license             indicated in the file; or         (b) The contribution is based upon previous work that, to the best             of my knowledge, is covered under an appropriate open source             license and I have the right under that license to submit that             work with modifications, whether created in whole or in part             by me, under the same open source license (unless I am             permitted to submit under a different license), as indicated             in the file; or         (c) The contribution was provided directly to me by some other             person who certified (a), (b) or (c) and I have not modified             it.         (d) I understand and agree that this project and the contribution             are public and that a record of the contribution (including all             personal information I submit with it, including my sign­off) is             maintained indefinitely and may be redistributed consistent with             this project or the open source license(s) involved.
  • 16. Practicalities: Nobody Replied to My Patches! ● Be patient, don't expect an immediate response. ● Check mailing list archives: ● What's the typical response rate? ● Did the maintainer announce a vacation? ● Is this a merge window? ● Everyone is super busy, try again when it closes ● If it really seems like patches got dropped, email the maintainer privately with a pointer to thread. ● If still no response: ● Ping one level up in tree. ● For drivers: Ping Greg KH ● Sometimes you just have to email patches to Linus directly ● Shames the maintainer, gets his/her attention
  • 17. Practicalities: Responses From Other Developers ● Acked-by: This person is OK with the changes. Usually a maintainer of a subsystem affected by patch. ● Reviewed-by: This person has done a thorough technical review of the patch. ● Tested-by: This person did some level of testing. Allows maintainer to know that it has been validated on an environment other than original author's.
  • 18. Practicalities: When Someone Attacks You :( ● It unfortunately happens :( ● Do NOT Escalate ● Take a step back ● Go work on something else ● Grab a beer (BUT NOT WHILE REPLYING!) ● Pick out the technical issues ● Get some help in reading the negative email ● Respond to just these ● Hint: Attending conferences and meeting people face to face reduces the likelihood of this happening.
  • 19. Practicalities: I can't Release Early and Often ● Ask for Private Reviews ● NDAs with upstream maintainer(s) and experts ● Linaro can possibly help here ● Several of these people are part of our organization ● We have good relationships with many upstream maintainers ● Can you release the concepts if not the code? ● Fine art of providing enough details w/o giving away the secret sauce ● What are the high level problems you want to solve?
  • 20. Summary ● The community is just a bunch of developers ● Like you, just with more experience of the process. ● Most of them really want to help! ● Good kernel code: ● Doesn't re-invent what's already there ● Doesn't add abstraction for the sake of abstraction ● Solves common issues - abstraction only when needed ● Has well-designed APIs ● Read the documentation and the code ● Participate openly and respectfully ● Ask us for help ● Release Early, Release Often :)