What does the number following 'linux-2.6.38.' in the file names like linux-2.6.38.1.tar.xz and linux-2.6.38.2.tar.xz mean? - linux

I wanted to download Linux kernel 2.6.38 source files from https://www.kernel.org/pub/linux/kernel/v2.6/
but the webpage listed linux-2.6.38.1.tar.xz, linux-2.6.38.2.tar.xz etc, as well as linux-2.6.38.tar.xz.
What's the relationship between them? Which file should I choose?

These number represents the kernel version/releases, and give us information about its stability. From here :
The first number denotes the kernel version. It is changed least
frequently, and only when truly major changes in the concept and the
code of the kernel occur. In fact, it has been changed only twice in
the history of the kernel: in 1994 with version 1.0 and in 1996 with
version 2.0.
The second number denotes the major revision of the kernel version. It
was formerly the case that even numbers indicated a stable release,
that is, one that was deemed fit for production use (i.e., use in a
non-experimental environment), such as 1.2, 2.4 or 2.6. Likewise, odd
numbers, such as 1.1 or 2.5, have historically represented development
releases. They were for testing new features and device drivers until
they became sufficiently stable to be included in a stable release.
However, this has changed starting with the Linux 2.6.x series, and
new feature development now takes place in the same revision number.
The third number indicates the minor revision of the kernel. It is
only changed when new features or new drivers are added.
The fourth number represents corrections, such as security patches and
bug (i.e., error) fixes.

Related

Which linux OS supports AVX-512 VNNI (Vector Neural Network Instruction)?

I need to deploy an EC2 instance where VNNI (Vector Neural Network Instruction) is supported. There are some EC2 instance types that can support the same.
From AWS:
Intel Deep Learning Boost (Intel DL Boost): A new set of built-in processor technologies designed to accelerate AI deep learning use cases. The 2nd Gen Intel Xeon Scalable processors extend Intel AVX-512 with a new Vector Neural Network Instruction (VNNI/INT8) that significantly increases deep learning inference performance over previous generation Intel Xeon Scalable processors (with FP32), for image recognition/segmentation, object detection, speech recognition, language translation, recommendation systems, reinforcement learning and others. VNNI may not be compatible with all Linux distributions. Please check documentation before using.
It is mentioned that VNNI may not be compatible with all Linux distributions. So, which Linux distribution supports VNNI? I am also not sure as to which documentation this statement refers to.
No kernel support is needed beyond that for AVX-512 (i.e. context switch handling of the new AVX-512 zmm and k registers). AVX-512VNNI instructions just operate on those registers, so there's no new architectural state to save/restore on context switch. https://en.wikichip.org/wiki/x86/avx512_vnni / https://en.wikipedia.org/wiki/AVX-512#VNNI
(Unlike AMX (Advanced Matrix Extensions), new in Sapphire Rapids; that does introduce large new "2D tile" registers, 8x 1KiB, that context-switches need to handle1.)
The other relevant thing for distros are compilers versions, like GCC or clang. https://godbolt.org/z/668rvhWPx shows GCC 8.1 and clang 7.0 (both released in 2018) compiling AVX-512VNNI _mm512_dpbusd_epi32 with -march=icelake-server or -march=icelake-client. Versions before that fail, so those are the minimum versions. (Or clang6.0 for -mavx512vnni, but that doesn't enable other things an IceLake CPU supports, or set tuning options.)
So if you want to use the latest hotness, you need a compiler that's at least somewhat up to date. It's generally a good idea to use a compiler newer than the CPU you're using, so compiler devs have had a chance to tweak tuning settings for it. And code-gen from intrinsics, especially newish instruction-sets like AVX-512, has generally improved over compiler versions, so if you care about performance of the generated code, you typically want a newer compiler version. (Regressions happen for some releases for some loops/functions, and thus for some programs, but on average newer compilers make faster code than old ones. That's a big part of what compiler devs spend time improving.)
You can install a new compiler on an old distro via backport packages or manually. Or you can just use a distro release that isn't old and crusty.
Footnote 1: See also a phoronix article re: non-empty AMX register state keeping the CPU from doing a deep sleep. Normally CPUs fully power down the core in deeper sleep states, stashing registers somewhere that stays powered. I'm guessing that they didn't provide space for AMX tiles to do that, so having state there prevents sleep. So if you're using AMX, you'll want Linux kernel at least 5.19.
In AWS, the instance type and OS combination that worked for me:
EC2 instance type: m5n.large (m5n instance family supports AVX-512 VNNI)
OS: Amazon Linux 2 (other Linux distributions should work as well, as explained by #BasileStarynkevitch and #PeterCordes).
For curious minds: What Linux distribution is the Amazon Linux AMI based on?

Does a new kernel contain all patches with all the options

Well, let's start with what I know.
I know that I can apply a linux kernel patch to upgrade my current kernel version. let's say that I've a 4.2 version and I want to upgrade to 4.3 I can apply this patch:
https://www.kernel.org/pub/linux/kernel/v4.x/patch-4.3.xz
Now let's say that I don't want that I want to install the 4.3 kernel(without patching my current one) I can do that by:
https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.3.tar.xz
Now let's move on to what ruined my knowledge, while researching on how to make a linux kernel run in RealTime, I found that I need to apply this patch to the kernel that I downloaded:
https://www.kernel.org/pub/linux/kernel/projects/rt/4.1/patch-4.1.15-rt17.patch.xz
My question here is: Does "linux-4.3.tar.xz" have RT support on no, to have it available I need to apply "patch-4.1.15-rt17.patch.xz" to any kernel that I want to be supporting RealTime feature ?
some Src: http://proaudio.tuxfamily.org/wiki/index.php?title=Realtime_(RT)_Kernel#Obtain_the_kernel-source_and_necessary_patches
New kernel contains only accepted patches. AFAIK RT kernel patches are not accepted in vanilla kernel (to which you refer as "patch-4.3"), so it is developed as separate project and provides its own patches to be applied on vanilla kernel.
I suppose RT support is developed in this repository: https://git.kernel.org/cgit/linux/kernel/git/rt/linux-rt-devel.git/
Here is a repository for vanilla kernel: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/
You may try to seek any merges from RT to vanilla kernel, but I doubt that they exist.
The RT patches are not part of the upstream, mainline kernel yet. It's a feature in development, and released as patches on top of each supported mainline kernel release. To use RT, you need to choose the RT patchset that matches the mainline kernel you want to use.
Gradually, the patches are being merged to mainline kernel. At the same time, the mainline kernel moves on, and the other out-of-tree RT patches might no longer apply without rebasing. That's why there are RT patches for each (supported) mainline kernel release.

linux 0.01 kernel cross reference

i am searching for a linux cross reference for the first linux kernel 0.01,
many websites provide a LXR (Linux Cross Reference) for existing kernels starting from 2.x but not including old ones.
There is no cross-reference readily available for this version, because it is too old. If you want one, you will have to create it yourself. (Which should not be difficult; this version of the kernel is barely 10k lines of code. This is small enough that a cross-reference is hardly even necessary.)
Keep in mind that Linux 0.01 was a very early release. It represents the original "pre-alpha" version of the kernel that Linus Torvalds made available on his university's FTP server in 1991. At that point in time, the kernel had one developer (Linus himself) and no users.
Moreover, Linux 0.01 isn't even a very good resource for learning about the Linux kernel. It predates much of the modern organization of the kernel, and as such is significantly different from modern kernels. In particular:
Kconfig is not present. Linux 0.01 had no configuration options at all, and was built using hand-written Makefiles.
There is no arch directory yet. Linux 0.01 would only build and run on x86 systems.
There is no drivers directory either. The system only supported a few built-in system devices, such as the hard disk and keyboard, and those were essentially hard-coded into the kernel directory.
There is no support for SMP systems, nor any form of locking or kernel preemption. Multiprocessor x86 systems were extremely rare when Linux 0.01 was released, so Linus didn't have one to test on.
Many commonly used macros and structures in the modern Linux kernel, such as struct list, are not yet present. There wasn't a need for them yet.
Trying to use this extremely early version of Linux for learning purposes is not a good introduction to Linux kernel programming. If you want to learn, you should really work with a current version.
You don't need a cross-reference site. If you have a copy of the source code, download and use cscope. It's a great tool for searching C programs; I'm sure you'll find it useful.

Understanding linux kernel and patches releases

I would like to better understand how linux kernel / patches releases work.
For example, if I open www.kernel.org today (Dec 12, 2013) the main download (yellow button) takes me to "linux-3.12.5.tar.xx" that is the latest stable. This is clear.
But if I move into "https://www.kernel.org/pub/linux/kernel/v3.x/", I can find (among many archives):
(1) linux-3.12.tar.gz
(2) patch-3.12.5.gz
(3) patch-3.12.gz
So the first question: is "linux-3.12.5" = (1)linux-3.12 "+" (2)patch-3.12.5?
If so, what is "patch-3.12"(3) for ? is "linux-3.12" = linux-3.11 "+" (3)patch-3.12 like above?
Thanks!
According to https://github.com/torvalds/linux/blob/master/README (line 95 onward):
Unlike patches for the 3.x kernels, patches for the 3.x.y kernels
(also known as the -stable kernels) are not incremental but instead
apply directly to the base 3.x kernel. For example, if your base
kernel is 3.0 and you want to apply the 3.0.3 patch, you must not
first apply the 3.0.1 and 3.0.2 patches. Similarly, if you are running
kernel version 3.0.2 and want to jump to 3.0.3, you must first reverse
the 3.0.2 patch (that is, patch -R) before applying the 3.0.3 patch.
You can read more on this in Documentation/applying-patches.txt
Thanks to n.m. for linking source!

How many system calls are there in linux kernel 2.6?

How many system calls are there totally in linux 2.6 kernel. Does the number of system calls vary from version to version.
In the 3.0 (which is not different from 2.6 from that point of view), the file syscall_table.S contains 326 entries.
It is located in arch/m32r/kernel/syscall_table.S.
The number varies from version, including minor versions, so there isn't a good hard number to answer to your question. Check this out: http://www.kernel.org/doc/man-pages/online/pages/man2/syscalls.2.html
It varies slightly between architectures. Some architectures have syscalls which are either architecture-specific, or provide different sizes of parameters to the same routine.
Look at the system call table in the version and architecture you're interested in (Aif answered for the "m32r" architecture)

Resources