2022/06
linux kernel
pull request
pr
(2022/6/20) Jim Huang's student, steven1lung, post an article '提交第一份 Patch 到 Linux Kernel about his experience of first Linux kernel pull request.
Later, found another article 第一次給Linux Kernel發patch, also helpful.
Linux kernel does not adopt github PR (Pull Request) process, though its source code is mirrored and published on github. Let's give it a try to see if can contribute to Open Source Linux kernel.
Table of Contents
Assume you are familiar with Linux, and maybe Linux kernel. In this article, we will focus on the Linux kernel patch. Linux community requests contributors to do the compilation at 4 different machines before sending the patch. We will touch upon the basic of building Linux kernel in this section.
There is official HOWTO do Linux kernel development¶. However, it is not easy to follow as newbies. This article provides a clear picture about how to build Linux kernel.
Below is a very brief go-through of preparing and building Linux kernel.
$ sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison
$ sudo apt install dwarves
# install dwarves is to avoid below error encountered
BTF: .tmp_vmlinux.btf: pahole (pahole) is not available
Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make: *** [Makefile:1106: vmlinux] Error 1
$ git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
make menuconfig
linux/.config
contentmake[1] **No rule to nake target ‘debian/canonical-certs.pew’, needed by ‘certs/x509_certificate_list’.Stop.
Search CONFIG_SYSTEM_TRUSTED_KEYS, and remove debian/canonical-certs.pew, and leave it blank.Same for CONFIG_SYSTEM_REVOCATION_KEYS.
# I use a server of 32 cores (16 cores per socket x 2 sockets).
That gives me maximum of 64 threads for `make`
$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 64
On-line CPU(s) list: 0-63
Thread(s) per core: 2
Core(s) per socket: 16
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz
$ time make
10582.07user 1772.13system 3:17:38elapsed 104%CPU
$ time make -j 2
10694.89user 1850.39system 1:40:38elapsed 207%CPU
$ time make -j 4
10929.35user 1907.20system 52:17.20elapsed 409%CPU
$ time make -j 8
11146.45user 1884.67system 27:24.38elapsed 792%CPU
$ time make -j 16
12379.05user 1863.47system 16:00.89elapsed 1482%CPU
$ time make -j 32
13215.08user 2016.08system 10:14.39elapsed 2479%CPU
$ time make -j 64
17429.77user 2417.85system 8:32.16elapsed 3875%CPU
$ time make -j 128
18884.64user 2540.17system 8:02.04elapsed 4444%CPU
$ time make -j 256
19332.70user 2570.70system 8:05.18elapsed 4514%CPU
git
and git send-email
(Using Gmail or Yahoo mail account)This is the article mentioned '提交第一份 Patch 到 Linux Kernel'.
Further study
Learn More →
Learn More →
Learn More →
Learn More →
Learn More →
Learn More →