I did a web search for differences of mainline vs stable and got Quora What is the difference between Mainline, Stable and Longterm Kernel in linux?:
Stable After each mainline kernel is released, it is considered "stable." Any bug fixes for a stable kernel are backported from the mainline tree and applied by a designated stable kernel maintainer.
However when I downloaded git repos of stable and mainline as referenced from https://www.kernel.org/, I noted stable is 4.4 GB whereas mainline is "only" 2.7 GB. If stable is made from mainline, how can it be so much larger in size?
I got bare repos via git clone --mirror git://...
. Interestingly git show
gives same output for both repos:
$ git show
commit c9e6606c7fe92b50a02ce51dda82586ebdf99b48 (HEAD -> master, tag: v5.16-rc8)
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Sun Jan 2 14:23:25 2022 -0800
Linux 5.16-rc8
diff --git a/Makefile b/Makefile
index 17b4319ad2ff..16d7f83ac368 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
VERSION = 5
PATCHLEVEL = 16
SUBLEVEL = 0
-EXTRAVERSION = -rc7
+EXTRAVERSION = -rc8
NAME = Gobble Gobble
# *DOCUMENTATION*
Added 1:
Cloning stable from https://kernel.googlesource.com
as opposed to git://git.kernel.org
resulted in same amount of objects,~ 20% more deltas, orders of magnitude more reused
and 1.5 times less storage required, another mystery for me.
Added 2:
I've read about reuse in When I do "git push", what do the statistics mean? (Total, delta, etc.). My guess is that google repacked repo with some options different from options used for kernel.org git. I'm trying to run git gc --aggressive
, but got frozen for several minutes PC and error: pack-objects died of signal 930040)
.
~/Downloads$ git_clone https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux.git
Cloning into bare repository './.git'...
remote: Sending approximately 2.15 GiB ...
remote: Counting objects: 9774, done
remote: Finding sources: 100% (5794/5794)
remote: Total 10033935 (delta 8400402), reused 10033919 (delta 8400402)
Receiving objects: 100% (10033935/10033935), 2.15 GiB, done.
Resolving deltas: 100% (8400402/8400402), done.
~/Downloads$ git_clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Cloning into bare repository './.git'...
remote: Enumerating objects: 110, done.
remote: Counting objects: 100% (110/110), done.
remote: Compressing objects: 100% (60/60), done.
remote: Total 10033935 (delta 76), reused 59 (delta 50), pack-reused 10033825
Receiving objects: 100% (10033935/10033935), 3.82 GiB, done.
Resolving deltas: 100% (8004025/8004025), done.
Checking objects: 100% (33554432/33554432), done.
The output of mainline kernel does not show a lot of reuse, so the question why mainline and stable differ in size remains:
~/Downloads$ git_clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Cloning into bare repository './.git'...
remote: Enumerating objects: 110, done.
remote: Counting objects: 100% (110/110), done.
remote: Compressing objects: 100% (60/60), done.
Receiving objects: 100% (8481144/8481144), 2.29 GiB, done.
remote: Total 8481144 (delta 76), reused 59 (delta 50), pack-reused 8481034
Resolving deltas: 100% (6937684/6937684), done.