Files
Linux-Kernel-Programming_2E/Further_Reading.md

789 lines
70 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Further Reading
*For the book "Linux Kernel Programming", 2nd Ed, Kaiwan N Billimoria, Packt (2024).*
*Book GitHub repo*: https://github.com/PacktPublishing/Linux-Kernel-Programming_2E
Here, we present, in a chapter-wise format, additional online as well as book references. We feel that these will help you, the reader, in digging deeper into topics, or gaining additional views/information, or both. We definitely recommend you browse through the provided references. Also, you will find that some resources are repeated across chapters; we leave it this way so that you can gain all required resources in one place (and chapter-wise).
(Obviously, these reference articles/blogs/etc are provided "as-is"; we cannot vouch for their correctness or validity).
For your convenience, below are chapter-wise links to the *Further Reading* notes:
- [**Generic online and book resources: miscellaneous, very useful**](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#generic-online-and-book-resources--miscellaneous-very-useful)
*Section 1: The Basics*
- [Chapter 1, Kernel workspace setup](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#chapter-1-kernel-development-workspace-setup---further-reading)
- [Chapter 2, Building the 6.x Linux kernel from source - Part 1](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#chapter-2-building-the-linux-kernel-from-source-part-1---further-reading)
- [Chapter 3, Building the 6.x Linux kernel from source - Part 2](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#chapter-3-building-the-linux-kernel-from-source-part-2---further-reading)
- [Chapter 4, Writing your first kernel module - Part 1](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#chapter-4-writing-your-first-kernel-module-lkms-part-1---further-reading)
- [Chapter 5, Writing your first kernel module - Part 2](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#chapter-5-writing-your-first-kernel-module-lkms-part-2---further-reading)
*Section 2: Understanding and Working with the Kernel*
- [Chapter 6, Kernel Internals Essentials - Processes and Threads](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#chapter-6-kernel-internals-essentials---processes-and-threads---further-reading)
- [Chapter 7, Memory Management Internals Essentials](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#chapter-7-memory-management-internals-essentials---further-reading)
- [Chapter 8, Kernel Memory Allocation for Module Authors - Part 1](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#chapter-8-kernel-memory-allocation-for-module-authors-part-1---further-reading)
- [Chapter 9, Kernel Memory Allocation for Module Authors - Part 2](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#chapter-9-kernel-memory-allocation-for-module-authors-part-2---further-reading)
- [Chapter 10, The CPU Scheduler, Part 1](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#chapter-10-the-cpu-scheduler-part-1---further-reading)
- [Chapter 11, The CPU Scheduler, Part 2](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#chapter-11-the-cpu-scheduler-part-2---further-reading)
*Section 3: Delving Deeper*
- [Chapter 12, Kernel Synchronization - Part 1](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#chapter-12-kernel-synchronization-part-1---further-reading)
- [Chapter 13, Kernel Synchronization - Part 2](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#chapter-13-kernel-synchronization-part-2---further-reading)
**Friendly Reminder !** <br>
This book's companion volume *'Linux Kernel Programming (Part 2): Writing character device drivers: Learn to work with user-kernel interfaces, handle peripheral I/O & hardware interrupts'* is available as well. <br>
*And, hey, the ebook's free!*
<br>
The [LKP-Part2 book's GitHub repo is here.](https://github.com/PacktPublishing/Linux-Kernel-Programming-Part-2)
<br>
Besides the *Further Reading* resource specified chapter-wise, be sure to refer to the "special" section below entitled **Generic online and book resources : miscellaneous, very useful**! These
links and books are considered to be useful throughout your journey through this book and after.
<br>
## Generic online and book resources : miscellaneous, very useful
- [The Linux kernel documentation](https://www.kernel.org/doc/html/latest/#the-linux-kernel-documentation)
- Very useful! [LWN (Linux weekly news) Kernel index](https://lwn.net/Kernel/Index/)
- Deprecated things: DON'T use 'em! Just say No; [Deprecated Interfaces, Language Features, Attributes, and Conventions](https://www.kernel.org/doc/html/latest/process/deprecated.html#deprecated-interfaces-language-features-attributes-and-conventions)
A few excellent books that come to mind (specific books on the Linux kernel and writing Linux device drivers are mentioned in the appropriate chapter's *Further reading* section):
- The Mythical Man Month, Frederick P Brooks
- The Art of Unix Programming, Eric S Raymond (AW)
- Programming Pearls, Jon Bentley
- The Practice of Programming, Brian Kernighan and Rob Pike
- The Pragmatic Programmer: From Journeyman to Master, Hunt and Thomas
- The Joy of Linux, Hall and Proffitt
- Linux Kernel Debugging - Leverage proven tools and advanced techniques to effectively debug Linux kernels and kernel modules, Kaiwan N Billimoria, Packt
- Linux Kernel Programming - A comprehensive guide to kernel internals, writing kernel modules, and kernel synchronization, Kaiwan N Billimoria, Packt
- Linux Kernel Programming, Part 2 - Writing character device drivers: Learn to work with user-kernel interfaces, handle peripheral I/O & hardware interrupts, Kaiwan N Billimoria, Packt
- Hands-On System Programming with Linux, Kaiwan N Billimoria, Packt
- Unix Network Programming, W. Richard Stevens
- Unix Systems Programming: Communication, Concurrency and Threads, Robbins and Robbins
- [Secure Programming for Linux and Unix HOWTO, David Wheeler](https://www.tldp.org/HOWTO/pdf/Secure-Programs-HOWTO.pdf)
- Excellent newsletters / blogs (biased towards embedded but useful to all IMO)
- [The Embedded Muse (TEM) blog/newsletter by Jack Ganssle](http://www.ganssle.com/tem-subunsub.html)
- [Embedded Artistry](https://embeddedartistry.com/first-time-here/)
- In general an excellent in-depth technical article: [SO YOU WANT TO BUILD AN EMBEDDED LINUX SYSTEM?, Jay Carlson, Oct 2020](https://jaycarlson.net/embedded-linux/) ; it covers an introduction to the whys and why-nots of using Linux on an embedded system, hardware and software design workflow, as well as a pretty detailed rundown on 10 CPUs/boards that run embedded Linux (with benchmarks)
- Julia Evans' blog and zines:
- ['You can be a kernel hacker!', Julia Evans](https://jvns.ca/blog/2014/09/18/you-can-be-a-kernel-hacker/)
- [Blog](https://jvns.ca/)
- [Zines](https://wizardzines.com/)
- Ideas / articles on Software Design (biased towards embedded)
- [Collection of excellent articles from Embedded Artistry](https://embeddedartistry.com/archive/#featured-posts)
- [Practical Decoupling Techniques Applied to a C-based Radio Driver, PHILLIP JOHNSTON, Embedded Artistry, Aug 2019](https://embeddedartistry.com/blog/2019/8/5/practical-decoupling-techniques-applied-to-a-c-based-radio-driver/)
- [LOW-LEVEL SOFTWARE DESIGN, Kaiwan NB, Jan 2017](https://kaiwantech.wordpress.com/2017/01/03/low-level-software-design/)
- [Lowlevel programming University, gurugio](https://github.com/gurugio/lowlevelprogramming-university)
- [ADVICE TO A YOUNG FIRMWARE DEVELOPER BY JACK GANSSLE; AND ASSEMBLY, Kaiwan NB, Nov 2018](https://kaiwantech.wordpress.com/2018/11/20/advice-to-a-young-firmware-developer-by-jack-ganssle-and-assembly/)
- *Tip (reprodcued from Chapter 5)*:
"Is there a really practical hands-on tip, an almost guaranteed way to become a kernel hacker? Of course, keep reading this book! Ha ha, yes, besides, do partake in the [simply awesome Eudyptula Challenge](http://www.eudyptula-challenge.org/). Hang on, it's - very unfortuantely, and as of this writing - closed down.
Fear not, [here's a site with all the challenges](https://github.com/agelastic/eudyptula) posted (and the solutions, don't cheat!); do check it out and try the challenges."
- [Create Your Own Operating System: Build, deploy, and test your very own operating systems for the Internet of Things and other devices, Lucus Darnell, Aug 2016; Kindle:](https://www.amazon.in/Create-Your-Own-Operating-System-ebook/dp/B01KU8N6FC/)
[\[Top\]](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#further-reading)
<br>
## Chapter 1, Kernel Development Workspace Setup - Further Reading
Resources on setting up a Linux guest using VirtualBox on a Windows host:
- A very clearly written tutorial entitled [Install Linux Inside Windows
Using VirtualBox, Abhishek Prakash (It's FOSS!, August 2019)](https://itsfoss.com/install-linux-in-virtualbox/)
- An alternate, similarly excellent resource: [Install Ubuntu on Oracle
VirtualBox](https://brb.nci.nih.gov/seqtools/installUbuntu.html)
- [How to Install VirtualBox Guest Additions in Ubuntu](https://www.tecmint.com/install-virtualbox-guest-additions-in-ubuntu/)
- Related [Easy Ways to Check If Your Processor Supports Virtualization](https://www.technorms.com/8208/check-if-processorsupports-virtualization)
- ['Share Folders between Host and Guest OS in VirtualBox', S Butler, April 2020](https://helpdeskgeek.com/virtualization/virtualbox-share-folder-host-guest/)
- [Emulating Raspberry Pi on Linux](http://embedonix.com/articles/linux/emulating-raspberry-pi-on-linux/)
Good resources on toolchains:
- [Cross-compilation toolchains for Linux, Bootlin](https://toolchains.bootlin.com/)
Very user-friendly simply select and download the toolchain of choice.
- [Toolchains on eLinux](https://elinux.org/Toolchains)
- A wiki page (from the SEALS project I maintain, see the following) with instructions on downloading and installing the latest ARM Linaro toolchain (a popular one) is available [here](https://github.com/kaiwan/seals/wiki/HOWTO-Install-required-packages-on-the-Host-for-SEALS)
- Learn how to install many apps on Ubuntu/CentOS/Debian/etc via the [Installi web guide](https://installati.one/)
Some useful tooling, drivers, and so on, created by myself:
- The *procmap* utility - view any process's virtual address space fully (both user+kernel VAS): [procmap](https://github.com/kaiwan/procmap)
- Scripts, tools, utils, code : [usefulsnips](https://github.com/kaiwan/usefulsnips)
- [SEALS](https://github.com/kaiwan/seals) : Simple Embedded Arm Linux System
- [device-memory-readwrite](https://github.com/kaiwan/device-memory-readwrite) : Read/write pretty much any memory location (RAM or hardware IO memory) on a device or PC
Miscellaneous:
- Emulating a Raspberry Pi:
- [Emulating a Raspberry Pi on Linux](http://embedonix.com/articles/linux/emulating-raspberry-pi-on-linux/)
- [qemu-rpi-kernel, GitHub](https://github.com/dhruvvyas90/qemu-rpi-kernel/wiki)
- Code browsers
- [Ctags Tutorial](https://courses.cs.washington.edu/courses/cse451/10au/tutorials/tutorial_ctags.html)
- [The Vim/Cscope tutorial](http://cscope.sourceforge.net/cscope_vim_tutorial.html)
- [Ubuntu releases](https://wiki.ubuntu.com/Releases)
- [Ubuntu kernel mapping to mainline](https://ubuntu.com/kernel)
<br>
[\[Top\]](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#further-reading)
## Chapter 2, Building the Linux Kernel From Source, Part 1 - Further Reading
- **[Official Kernel Documentation](https://www.kernel.org/doc/html/latest/index.html)** : the modern Linux kernel documentation is very well written and presented here
- ["2. How the development process works"](https://www.kernel.org/doc/html/latest/process/2.Process.html#how-the-development-process-works)
- [The Linux kernel build system - kbuild - infrastructure](https://www.kernel.org/doc/Documentation/kbuild/)
- [Kernel Sysctl Explorer - content from official docs in a searchable web page](https://sysctl-explorer.net/)
- Git
- [Firstly, A Gentle Introduction to Version Control](http://chronicle.com/blogs/profhacker/a-gentle-introduction-to-version-control/23064)
- [Resources to Learn Git](http://try.github.io/)
- [The “official” git website](http://git-scm.com/)
- [Try Git in your browser interactive tutorial!](https://try.github.io/levels/1/challenges/1)
- [Most commonly used git tips and tricks on github](https://github.com/git-tips/tips)
- [The "Git Magic" book, by Ben Lynn (PDF)](http://www-cs-students.stanford.edu/~blynn/gitmagic/book.pdf)
- [Aha! Moments when learning Git](http://betterexplained.com/articles/aha-moments-when-learning-git/)
- [How not to be afraid of Git anymore](https://medium.freecodecamp.org/how-not-to-be-afraid-of-git-anymore-fe1da7415286)
- [Getting Git Right, Atlassian.com](https://www.atlassian.com/git/)
- [... and many more](https://www.google.com/search?q=learning+to+use+git)
- [Linux Kernel Release Model, Greg Kroah-Hartman, Feb 2018](http://kroah.com/log/blog/2018/02/05/linux-kernel-release-model/)
- [Civil Infrastructure Platform Announces New Super Long Term Support Kernel that Advances Automation, Machine Learning and Artificial Intelligence, LF, Feb 2019](https://www.linuxfoundation.org/press-release/2019/02/civil-infrastructure-platform-announces-new-super-long-term-support-kernel-that-advances-automation-machine-learning-and-artificial-intelligence/)
- [LTSI Project update - Long Term Support Initiative slide deck, Open Source Summit Japan, June 2018](https://events19.linuxfoundation.org/wpcontent/uploads/2017/11/Using-Linux-for-Long-Term-Community-Status-and-the-Way-We-Go-OSS-Tsugikazu-Shibata.pdf)
- [Working with the kernel development community](https://www.kernel.org/doc/html/latest/process/index.html#working-with-the-kernel-development-community)
- Blog artcile: ['Kernel Patch Submission tutorial', Saurabh Singh Sengar](https://saurabhsengarblog.wordpress.com/2015/11/26/kernel-patch-submission-tutorial/)
- Working with the bleeding-edge, the linux-next tree:
- [Working with linux-next](https://www.kernel.org/doc/man-pages/linux-next.html)
- [How to contribute (was Re: Kernelnewbies Digest, Vol 77, Issue 7](https://lists.kernelnewbies.org/pipermail/kernelnewbies/2017-April/017765.html)
- [Linux kernel versions with detailed notes on new features, kernelnewbies](https://kernelnewbies.org/LinuxVersions)
- Fun: [Occurences of words in the Linux kernel source code over time](https://www.vidarholen.net/contents/wordcount/#hack*,workaround*,todo,fixme)
- Licensing
- [The differences between the GPL, LGPL and the BSD](https://fosswire.com/post/2007/04/the-differences-between-the-gpl-lgpl-and-the-bsd/)
- [Proprietary loadable kernel modules, LWN](https://lwn.net/Articles/434491/)
- [Choose an open source license](https://choosealicense.com/)
- [Open source licensing for supervillains, Mossberg, Jan 2021](https://offlinemark.com/2021/01/22/open-source-licensing-for-supervillains/)
- [Legal Risks of Open Source GPL/Linux Loadable Kernel Modules](http://sourceauditor.com/blog/legal-risks-of-open-source-gpllinux-loadable-kernel-modules/)
- [Linux kernel licensing rules](https://www.kernel.org/doc/html/latest/process/license-rules.html#linux-kernel-licensing-rules)
- To circumvent the EXPORT_SYMBOL_GPL(), people have been known to use a GPL "shim" kernel module whose routines are invoked from a proprietary module; [Greg K Hartman 'Re: EXPORT_SYMBOL_GPL recursive for shim and/or wrapper](http://linux-kernel.2935.n7.nabble.com/EXPORT-SYMBOL-GPL-recursive-for-shim-and-or-wrappers-tp474689p474690.html)
- [MIT vs. BSD vs. Dual License](https://softwareengineering.stackexchange.com/questions/121998/mit-vs-bsd-vs-dual-license)
- Recent, off-beat
- [What comes after open source? Bruce Perens is working on it, The Register, Dec 2023](https://www.theregister.com/2023/12/27/bruce_perens_post_open/)
- [The eternal struggle between open source and proprietary software, TechCrunch, Dec 2023](https://techcrunch.com/2023/12/26/the-eternal-struggle-between-open-source-and-proprietary-software/)
- io_uring
- [What is io_uring?, unixism.net, 2020](https://unixism.net/loti/what_is_io_uring.html)
- [The next deep magic Linux program to change the world? Io_uring, Steven J. Vaughan-Nichols, The Register, Sept 2022](https://www.theregister.com/2022/09/16/column/)
- [Why you should use io_uring for network I/O, D Hunter, RedHat Developer, April 2023](https://developers.redhat.com/articles/2023/04/12/why-you-should-use-iouring-network-io)
- This article includes more resource links.
- Rust in the Linux kernel !
- [Rust in the Linux Kernel, Steven J. Vaughan-Nichols, thenewstack, Oct 2022](https://thenewstack.io/rust-in-the-linux-kernel/)
- [Article on How to create a kernel module using Rust, Jack Clayton, 2022?](https://www.jackos.io/rust-kernel/rust-for-linux.html)
- Based on this video presentation: [Mentorship Session: Writing Linux Kernel Modules in Rust, The Linux Foundation](https://www.youtube.com/watch?v=-l-8WrGHEGI)
- Official kernel doc: [Rust](https://www.kernel.org/doc/html/v6.1/rust/index.html)
- [Configuring the kernel](https://www.kernel.org/doc/html/latest/admin-guide/README.html#configuring-the-kernel)
- Kconfig/Kbuild system
- Detailed article: [Exploring the Linux kernel: The secrets of Kconfig/kbuild](https://opensource.com/article/18/10/kbuild-and-kconfig)
- Slide presentation (PDF): [A Dive Into Kbuild, Cao Jin, Fujitsu, Aug 2018](https://events19.linuxfoundation.org/wp-content/uploads/2017/11/A-Dive-into-Kbuild-Cao-Jin-Fujitsu.pdf)
- Article: [How to compile a Linux kernel in the 21st century, S Kenlon, Aug 2019](https://opensource.com/article/19/8/linux-kernel-21st-century)
- [Boot config: official kernel doc](https://elixir.bootlin.com/linux/v6.1.25/source/Documentation/admin-guide/bootconfig.rst)
- [GCC plugins: official kernel doc](https://elixir.bootlin.com/linux/v6.1.25/source/Documentation/kbuild/gcc-plugins.rst)
- Interesting: [Meet the contributor of the 1-millionth commit: Ricardo Neri, Swapnil Bharatiya, Sept 2020](https://www.linux.com/featured/meet-the-one-millionth-committer-to-linux-ricardo-neri/)
<br>
[\[Top\]](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#further-reading)
## Chapter 3, Building the Linux Kernel From Source, Part 2 - Further Reading
- Initramfs (initrd):
- [Opening and modifying the initrd](http://www.alexonlinux.com/opening-and-modifying-the-initrd)
- [Initramfs (on Ubuntu wiki)](https://wiki.ubuntu.com/Initramfs)
- Informative: [debian bug report: intel-microcode: breaks initrd for newer kernels, Sept 2014](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760765)
- [distri: 20x faster initramfs (initrd) from scratch, Jan 2020](https://michael.stapelberg.ch/posts/2020-01-21-initramfs-from-scratch-golang/)
- Encrypting disks with LUKS and cryptsetup
- ['How To: Linux Hard Disk Encryption With LUKS (cryptsetup Command), Sept 2017, nixCraft](https://www.cyberciti.biz/hardware/howto-linux-hard-disk-encryption-with-luks-cryptsetup-command/)
- ['Basic Guide To Encrypting Linux Partitions With LUKS', Oct 2016, Nick Congleton](https://linuxconfig.org/basic-guide-to-encrypting-linux-partitions-with-luks)
- RedHat-specific: ['What is LUKS disk encryption and how can it be implemented?', Oct 2019, RedHat](https://access.redhat.com/solutions/100463)
- Article: [How to Build Linux Kernel From Scratch {Step-By-Step Guide}, Nov 2020](https://phoenixnap.com/kb/build-linux-kernel)
- [GRUB: How do I change the default boot kernel](https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry)
- [How to Boot into Single User Mode in CentOS/RHEL 7, Kili, Tecmint, August 2017](https://www.tecmint.com/boot-into-single-user-mode-in-centos-7/)
- Article: [Linux Kernel Cross Compilation](https://gts3.org/2017/cross-kernel.html)
- [SEALS - Simple Embedded ARM Linux System - project](https://github.com/kaiwan/seals)
- - [Wiki pages](https://github.com/kaiwan/seals/wiki)
- Building the (usual 32-bit) kernel for the Raspberry Pi device
- [Raspberry Pi kernel build: official doc](https://www.raspberrypi.org/documentation/linux/kernel/building.md)
- Building a **64-bit** kernel for the Raspberry Pi
- blog article: [Cross compiling for arm or aarch64 on Debian or Ubuntu, Jensd, Jan 2021](https://jensd.be/1126/linux/cross-compiling-for-arm-or-aarch64-on-debian-or-ubuntu)
- blog article: ['BUILD A 64-BIT KERNEL FOR YOUR RASPBERRY PI 3', Dec 2016](https://devsidestory.com/build-a-64-bit-kernel-for-your-raspberry-pi-3/)
- blog article: ['Tutorial: How (and why!) to set up a 64-bit kernel, 32-bit Raspbian host OS, 64-bit nspawn Debian guest OS RPi3 system', Jan 2019](https://www.raspberrypi.org/forums/viewtopic.php?f=56&t=232415&sid=146ea82cef8d235c1eaf64a12a8c3427)
- On GitHub: ['Bootable RPi3 image with 64-bit kernel, 32-bit Raspbian Stretch host OS, 64-bit Debian Buster guest OS in nspawn container', Sakaki, Apr 2019](https://github.com/sakaki-/raspbian-nspawn-64)
- Interesting, an [Ubuntu 18.04 server on Aarch64 Raspberry Pi](https://wiki.ubuntu.com/ARM/RaspberryPi); simplest way to get a 64-bit Raspberry Pi kernel and rootfs in a single image which can be burned onto the SD card.
<br>
[\[Top\]](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#further-reading)
## Chapter 4, Writing your first Kernel Module-LKMs Part 1 - Further Reading
- [Official Kernel Documentation : kernel parameters](https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html)
- ['How to get printk format specifiers right', Linux kernel doc](https://www.kernel.org/doc/html/latest/core-api/printk-formats.html?highlight=dma)
- ['What are the __init* and __exit* macros ?', kernelnewbies](https://kernelnewbies.org/FAQ/InitExitMacros)
- **Systemd**
- Article: ['Systemd Essentials: Working with Services, Units, and the Journal', DigitalOcean](https://www.digitalocean.com/community/tutorials/systemd-essentials-working-with-services-units-and-the-journal)
- Article: ['Understanding Systemd Units and Unit Files', DigitalOcean](https://www.digitalocean.com/community/tutorials/understanding-systemd-units-and-unit-files)
- [How to create a systemd service in Linux, Patel, Sept 2022](https://linuxhandbook.com/create-systemd-services/)
- [Understanding and administering systemd, Christopher Engelhard, Kamil Páral, Caleb McKee, Fedora docs, Aug 2020](https://docs.fedoraproject.org/en-US/quick-docs/systemd-understanding-and-administering/)
- [Systemd Documentation](http://0pointer.de/blog/projects/systemd-docs.html)
- [Systemd FAQs](https://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions/)
- [Linux console (on Wikipedia)](https://en.wikipedia.org/wiki/Linux_console)
- [Debugging by printing, eLinux](https://elinux.org/Debugging_by_printing)
- [LWN kernel index on 'Kernel messages' (printk)](https://lwn.net/Kernel/Index/#Kernel_messages)
- [printk() indexing, Jon Corbet, LWN, May 2021](https://lwn.net/Articles/857148/)
- Makefiles : introductory stuff
- [A Simple Makefile Tutorial](https://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/)
- [Practical Makefiles, by example](http://nuclear.mutantstargoat.com/articles/make/)
- [Learn Makefiles; With the tastiest examples](https://makefiletutorial.com/)
- [The Linux Kernel Module Programming Guide, by Peter Jay Salzman, Michael Burian, Ori Pomerantz, Bob Mottram, Jim Huang,
July 5, 2023](https://sysprog21.github.io/lkmpg/)
- Blog article: ["MAKEFILES TUTORIAL", Liran B.H.](http://devarea.com/makefiles-tutorial/)
- Blog article: [A Standalone Linux Kernel Module, Levinzon, Medium, May 2020](https://medium.com/@eitan.levinzon/a-standalone-linux-kernel-module-df54283d4803)
- [BusyBox: The Swiss Army Knife of Embedded Linux](https://www.busybox.net/)
<br>
[\[Top\]](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#further-reading)
## Chapter 5, Writing your first Kernel Module-LKMs Part 2 - Further Reading
- Blog article: [WORKING ON THE CONSOLE WITH THE RASPBERRY PI, kaiwanTECH](https://kaiwantech.wordpress.com/2018/12/16/working-on-the-console-with-the-raspberry-pi/)
- [Cross compiling a kernel module, embear](https://embear.ch/blog/compiling-a-kernel-module)
- Clang, a modern alternative to GCC
- [Cross compiling made easy, using Clang and LLVM, Feb 2021](https://mcilloni.ovh/2021/02/09/cxx-cross-clang/)
- Official Clang docs: [Cross-compilation using Clang](https://clang.llvm.org/docs/CrossCompilation.html)
- StackOverflow Q&A: ["How to prevent “error: 'symbol' undeclared here” despite EXPORT_SYMBOL in a Linux kernel module?"](https://stackoverflow.com/questions/6670589/how-to-prevent-error-symbol-undeclared-here-despite-export-symbol-in-a-linu?noredirect=1&lq=1)
- Article: ['Improving EXPORT_SYMBOL()', Jon Corbet, Feb 2016, LWN](https://lwn.net/Articles/674303/)
- Linux kernel static analysis
- Blog article: ["Static analysis on the Linux kernel"](http://smackerelofopinion.blogspot.com/2017/09/static-analysis-on-linux-kernel.html)
- PDF: ["Static code checking In the Linux kernel", Arnd Bergmann, Linaro](https://elinux.org/images/d/d3/Bargmann.pdf)
- Thesis paper: ["Automatic Bug-finding Techniques for Large Software Projects", Jiri Slaby](https://www.fi.muni.cz/~xslaby/sklad/dis.pdf)
- A book on static analysis with the opensource SonarQube tool: ['SonarQube in Action', G. Ann Campbell and Patroklos P. Papapetrou, Oct 2013] https://www.manning.com/books/sonarqube-in-action#toc
- Licensing
- [Being honest with MODULE_LICENSE, Jon Corbet, LWN, Apr 2004](https://lwn.net/Articles/82305/)
- [Multi-licensing](https://en.wikipedia.org/wiki/Multi-licensing)
- [Dual Licensing: Having Your Cake and Eating It Too](https://www.linuxinsider.com/story/38172.html), LinuxInsider
- [GPL License FAQs](https://www.gnu.org/licenses/gpl-faq.html)
- Selecting a license
- [Open Source Licenses Comparison -Guide](https://itsfoss.com/open-source-licenses-explained/), Leroux, Nov 2019
- [Choose an open source license](https://choosealicense.com/)
- [Appendix; a convenient comparison table of OSS licenses](https://choosealicense.com/appendix/)
- Blog article: ["LINUX KERNEL DEVELOPMENT KERNEL MODULE PARAMETERS", Liran B.H.](http://devarea.com/linux-kernel-development-kernel-module-parameters/)
- Useful Arch Linux Wiki on kernel module - gathering info, auto-loading, aliasing, blacklisting, etc: ["Kernel module"](https://wiki.archlinux.org/index.php/Kernel_module)
- StackOverflow Q&A: ["Where does modprobe load a driver that udev requests?"](https://unix.stackexchange.com/questions/330186/where-does-modprobe-load-a-driver-that-udev-requests)
- DKMS: Dynamic Kernel Module Support
- AskUbuntu: ["What does DKMS do? How do I use it?"](https://askubuntu.com/questions/408605/what-does-dkms-do-how-do-i-use-it)
- dkms(8) man page](https://linux.die.net/man/8/dkms)
- A few Linux *FastBoot!* resources
- [Fast boot with Raspberry Pi, Himeshs blog, Aug 2018](http://himeshp.blogspot.com/2018/08/fast-boot-with-raspberry-pi.html)
- Presentation by Jan Altenberg on booting linux in less than 1 second
- [Powerpoint here](https://elinux.org/images/9/97/Boot_one_second_altenberg.pdf)
- [Youtube link](https://www.youtube.com/watch?v=KTRA1PRJWH8)
- [powerpoint on boot time optimization using a beaglebone as a prototype](https://elinux.org/images/6/64/Chris-simmonds-boot-time-elce-2017_0.pdf)
- [powerpoint on speeding up raspberry pi boot time here](https://www.slideshare.net/righiandr/linux-boottime-23817352)
- [Blog article Reducing Boot Time with systemd, Murray, Feb 2022](https://www.thegoodpenguin.co.uk/blog/reducing-boot-time-with-systemd/)
- [Good stackoverflow question on using systemd to figure boot time...](https://superuser.com/questions/852610/how-to-tell-which-services-run-at-startup-on-raspberry-pi-raspbian)
- [A Challenge called boot time, witekio blog](https://witekio.com/blog/a-challenge-called-boot-time-3/)
- [Linux Kernel Security](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/master/Further_Reading.md#kernel_sec)
- The [Kernel Self Protection Project](https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project) (KSPP, Kees Cook)
- Regular updates on the state of kernel security: [codeblog, by Kees Cook](https://outflux.net/blog/)
- [YouTube Linux Foundation channel: 'Mitigating Hackers with Hardening on Linux An Overview for Developers, Focus on BoF', Kaiwan Billimoria (Embedded IOT Summit, Prague, June 2023)](https://www.youtube.com/watch?v=KQa_XEiLGMc)
- Arch Linux wiki: ["Security / Kernel hardening"](https://wiki.archlinux.org/index.php/security#Kernel_hardening)
- ["The status of kernel hardening", LWN, Nov 2016](https://lwn.net/Articles/705262/)
- Blog article: ["Effectively bypassing kptr_restrict on Android"](http://bits-please.blogspot.com/2015/08/effectively-bypassing-kptrrestrict-on.html)
- Quora: ["What are some of the best resources for Kernel exploitation on Linux?"](https://www.quora.com/What-are-some-of-the-best-resources-for-Kernel-exploitation-on-Linux/answer/Kaiwan-N-Billimoria)
- [Linux Kernel Exploitation GitHub blog - a long list of kernel exploitation resources](https://github.com/xairy/linux-kernel-exploitation)
- ["Hardened GNU/Linux - Linux kernel mitigation checklist"](https://hardenedlinux.github.io/system-security/2016/12/13/kernel_mitigation_checklist.html)
- ["Loading signed kernel modules", LWN, Dec 2011](https://lwn.net/Articles/470906/)
- ["Is My IoT Device Secure? 7 Questions You Should Be Asking Yourself Today", Jan 2020, DZone](https://dzone.com/articles/is-my-iot-device-secure-7-questions-you-should-be)
- Kernel Lockdown LSM
- [Linux Kernel Finally Gets Its Lockdown, Oct 2019](https://thenewstack.io/linux-kernel-finally-gets-its-lockdown/)
- [kernel_lockdown(7) — Linux manual page](https://man7.org/linux/man-pages/man7/kernel_lockdown.7.html)
- [Securing the Linux kernel with lockdown mode, 2020](https://www.linux-magazine.com/Issues/2020/239/Lockdown-Mode/(offset)/3)
- Arithmetic Overflow
- An excellent must-read whitepaper: ['Understanding Integer Overflow in C/C++', Dietz, et al, June 2012](http://www.cs.utah.edu/~regehr/papers/overflow12.pdf)
- ['Catch and compute overflow during multiplication of two large integers', StackOverflow](https://stackoverflow.com/questions/1815367/catch-and-compute-overflow-during-multiplication-of-two-large-integers)
- An example of checking for arithmetic overflow in 'real-world' code can be found [in the git codebase](https://github.com/git/git); see the [wrapper.c code](https://github.com/git/git/blob/master/wrapper.c) for usage examples
- [The Eudyptula Challenge](http://eudyptula-challenge.org/): "The Eudyptula Challenge was a series of programming exercises for the Linux kernel, that started from a very basic "Hello world" kernel module, moving on up in complexity to getting patches accepted into the main Linux kernel source tree." It's really cool but NOT active as of this writing though.
<br>
[\[Top\]](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#further-reading)
## Chapter 6, Kernel Internals Essentials - Processes and Threads - Further Reading
- Book: [Hands-On System Programming with Linux", Kaiwan N Billimoria, Packt](https://www.packtpub.com/en-us/product/hands-on-system-programming-with-linux-9781788996747). Prerequisites to this chapter (essential reading, really):
- Ch 1 : Linux System Architecture
- Ch 2 : Virtual Memory
- [Process Virtual address space (VAS) on Wikipedia](https://en.wikipedia.org/wiki/Virtual_address_space)
- CPU ABI, a blog article : [APPLICATION BINARY INTERFACE (ABI) DOCS AND THEIR MEANING](https://kaiwantech.wordpress.com/2018/05/07/application-binary-interface-abi-docs-and-their-meaning/)
- [LWN kernel index on kernel stacks](https://lwn.net/Kernel/Index/#Kernel_stack)
- Blog article: [Some Tricks used by the Linux kernel](https://geeksww.com/tutorials/operating_systems/linux/tips_and_tricks/some_tricks_used_by_the_linux_kernel.php)
- [un]likely() macros:
- [likely()/unlikely() macros in the Linux kernel - how do they work? What's their benefit?](https://stackoverflow.com/questions/109710/likely-unlikely-macros-in-the-linux-kernel-how-do-they-work-whats-their)
- [Why do we use __builtin_expect when a straightforward way is to use if-else](https://stackoverflow.com/questions/7346929/why-do-we-use-builtin-expect-when-a-straightforward-way-is-to-use-if-else)
- [e]BPF The modern approach to system/app tracing and performance analysis:
- [Linux Extended BPF (eBPF) Tracing Tools, Brendan Gregg](http://www.brendangregg.com/ebpf.html)
- [Learn eBPF Tracing: Tutorial and Examples (B Gregg)](http://www.brendangregg.com/blog/2019-01-01/learnebpf-tracing.html)
- [How eBPF Turns Linux into a Programmable Kernel, Jackson, October 2020](https://thenewstack.io/how-ebpf-turnslinux-into-a-programmable-kernel/)
- (Kernel-level) [A thorough introduction to eBPF, Matt Fleming, LWN, December 2017](https://lwn.net/Articles/740157/)
- [How io_uring and eBPF Will Revolutionize Programming in Linux, Glauber Costa, April 2020](https://thenewstack.io/how-io_uring-and-ebpf-will-revolutionizeprogramming-in-linux/)
- [BPF Performance Tools, by Brendan Gregg official repo](https://github.com/brendangregg/bpf-perf-tools-book)
- [Flame Graphs](https://www.brendangregg.com/flamegraphs.html)
- Kernel lockdown:
- [Linux Kernel Finally Gets Its Lockdown, J Wallen, October 2019](https://thenewstack.io/linux-kernel-finally-gets-its-lockdown/)
- [Lockdown as a security module, Jonathan Corbet, LWN, June 2019](https://lwn.net/Articles/791863/)
- [Running an eBPF program may require lifting the kernel lockdown, Gehrcke, September 2019](https://gehrcke.de/2019/09/running-an-ebpf-program-may-require-liftingthe-kernel-lockdown/)
- System Call internals
- Internal glibc-and-kernel level implementation of system calls, a good blog article: [LINUX SYSTEM CALLS UNDER THE HOOD, Julien Sobczak, Aug 2021](https://www.juliensobczak.com/inspect/2021/08/10/linux-system-calls-under-the-hood.html)
- Official kernel doc: [Adding a New System Call](https://www.kernel.org/doc/html/v6.1/process/adding-syscalls.html#adding-a-new-system-call)
<br>
[\[Top\]](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#further-reading)
## Chapter 7, Memory Management Internals Essentials - Further Reading
- Books on Linux kernel memory management internals:
- ['Professional Linux Kernel Architecture', Mauerer, Wrox Press](https://www.amazon.in/Professional-Linux-Kernel-Architecture-Programmer/dp/0470343435/ref=sr_1_1?ie=UTF8&qid=1547525512&sr=8-1&keywords=Professional%20Linux%20Kernel%20Architecture%27)
- ['Understanding the Linux Virtual Memory Manager', Mel Gorman (Bruce Perens Open Source)](https://www.amazon.in/Understanding-Virtual-Memory-Manager-Perens/dp/0131453483/ref=sr_1_1?ie=UTF8&qid=1547529951&sr=8-1&keywords=mel%20gorman)
- [x86 Paging Tutorial, C Santilli](https://cirosantilli.com/x86-paging)
- Deep detail on MM and paging on the Intel processors can be found in their excellent manuals here (Ch 4, Paging): [Intel® 64 and IA-32 Architectures
Software Developers Manual. Volume 3 (3A, 3B & 3C): System Programming Guide](https://software.intel.com/en-us/download/intel-64-and-ia-32-architectures-sdm-combined-volumes-3a-3b-3c-and-3d-system-programming-guide)
- [All Intel 64 and IA-32 architecture and programming environment manuals](https://software.intel.com/en-us/articles/intel-sdm)
- Excellent blog article: [Linux Internals: How /proc/self/mem writes to unwritable memory, 'offlinemark', May 2021](https://offlinemark.com/2021/05/12/an-obscure-quirk-of-proc/)
- pahole, BTF
- ['Poke-a-hole and friends', Rodrigues, LWN, June 2009](https://lwn.net/Articles/335942/)
- [How to generate BTF information ?](https://github.com/aquasecurity/btfhub/blob/main/docs/how-to-use-pahole.md)
- Official kernel doc: [BPF Type Format (BTF)](https://www.kernel.org/doc/html/v6.1/bpf/btf.html#bpf-type-format-btf)
- [How the ARM32 kernel starts, Linus Walleij, Aug 2020](https://people.kernel.org/linusw/how-the-arm32-kernel-starts)
- On vsyscall, vdso and VVAR
- ["On vsyscalls and the vDSO"](https://lwn.net/Articles/446528/), LWN, Jon Corbet, June 2011
- ["Are system calls the only way to interact with the Linux kernel from user land?", StackExchange, Apr 2014](https://unix.stackexchange.com/questions/124928/are-system-calls-the-only-way-to-interact-with-the-linux-kernel-from-user-land)
- Using the pmap and smem utilities
- [pmap(1) man page](https://linux.die.net/man/1/pmap)
- ['How to analyze a Linux process' memory map with pmap', Rossi, RedHat, Dec 2022](https://www.redhat.com/sysadmin/pmap-command)
- [How to Use the pmap Linux Command to Check Memory Usage, D Kariuki, June 2022](https://linuxhint.com/pmap-linux-command-check-memory-usage/)
- [smem(8) - Linux man page](https://linux.die.net/man/8/smem)
- ['Get memory use statistics with this Linux command-line tool', T Waraksa, Oct 2021](https://opensource.com/article/21/10/memory-stats-linux-smem)
- [smem memory reporting tool, Selenic](https://www.selenic.com/smem/)
- ['Linux Terminal: Check who uses all your memory with smem', Linuxaria, Oct 2013](https://linuxaria.com/pills/linux-terminal-check-who-uses-all-your-memory-with-smem)
- Kernel memory optimization techniques
- [THP (Transparent Huge Pages)](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge)
- [KSM (Kernel Samepage Merging)](https://www.kernel.org/doc/html/latest/admin-guide/mm/ksm.html)
- ['Virtual Memory and Linux', PDF, Matt Porter, Alan Ott](https://elinux.org/images/b/b0/Introduction_to_Memory_Management_in_Linux.pdf)
- Linux (physical) memory models
- [Official kernel doc: Physical Memory Model](https://docs.kernel.org/mm/memory-model.html#physical-memory-model)
- [Memory: the flat, the discontiguous, and the sparse, LWN, M Rapoport, May 2019](https://lwn.net/Articles/789304/)
- [struct page, the Linux physical page frame data structure, Mathhew Wilcox, Oct 2020](https://blogs.oracle.com/linux/post/struct-page-the-linux-physical-page-frame-data-structure)
- Blog article: [In defence of swap: common misconceptions, Chris Down, Jan 2018](https://chrisdown.name/2018/01/02/in-defence-of-swap.html)
<br>
[\[Top\]](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#further-reading)
## Chapter 8, Kernel Memory Allocation for Module Authors, Part 1 - Further Reading
- Book: ['Hands-On System Programming with Linux', Kaiwan N Billimoria, Packt](https://www.packtpub.com/en-us/product/hands-on-system-programming-with-linux-9781788996747). Prerequisites to this chapter (essential reading, really):
- Ch 1 : Linux System Architecture
- Ch 2 : Virtual Memory
- [Linux kernel documentation on memory management](https://www.kernel.org/doc/html/latest/core-api/index.html#memory-management)
- [A pair of memory-allocation improvements in 5.13, Jon Corbet, LWN, May 2021](https://lwn.net/Articles/855226/)
- Information regarding GFP flags internal usage, etc: ['Memory management when failure is not an option', LWN, Mar 2015](https://lwn.net/Articles/635354/)
- smem: [smem memory reporting tool](https://www.selenic.com/smem/)
- CPU Caching
- [Why software developers should care about CPU caches, EventHelix, Medium, July 2017](https://medium.com/software-design/why-software-developers-should-care-about-cpu-caches-8da04355bb8a)
- [Cache coherence](https://en.wikipedia.org/wiki/Cache_coherence)
- ["How L1 and L2 CPU Caches Work, and Why Theyre an Essential Part of Modern Chips", Joel Hruska, Aug 2018](http://www.extremetech.com/extreme/188776-how-l1-and-l2-cpu-caches-work-and-why-theyre-an-essential-part-of-modern-chips)
- An example diagram of CPU (cache) hierarchy: ["Memory hierarchy of an AMD Bulldozer server"](https://en.wikipedia.org/wiki/CPU_cache#/media/File:Hwloc.png)
- Slab layer - performance, etc
- [Linux SLUB Allocator Internals and Debugging, Part 1 of 4, Imran Khan, Dec 2022](https://blogs.oracle.com/linux/post/linux-slub-allocator-internals-and-debugging-1)
- ['Toward a more efficient slab allocator', LWN, Jon Corbet, Jan 2015](https://lwn.net/Articles/629152/)
- Blog article ['INTERESTING NUMBERS'](https://kaiwantech.wordpress.com/2015/05/01/interesting-numbers/); see the section on *Networking* for some information on how the network subsystem has time critical code paths (and the resource links that follow)
- GNUplot
- Must-See [Demos for gnuplot version 5.4 (pngcairo terminal)](http://gnuplot.sourceforge.net/demo/index.html)
- ["GNUPLOT 4.2 - A Brief Manual and Tutorial", Duke University](https://people.duke.edu/~hpgavin/gnuplot.html)
- [gnuplot Quick Reference](http://www.gnuplot.info/docs_4.0/gpcard.pdf)
- ['Object-oriented design patterns in the kernel, part 1', Neil Brown, LWN, June 2011](https://lwn.net/Articles/444910/)
<br>
[\[Top\]](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#further-reading)
## Chapter 9, Kernel Memory Allocation for Module Authors, Part 2 - Further Reading
- [LWN kernel index on memory management](https://lwn.net/Kernel/Index/#Memory_management)
- [Better tools for out-of-memory debugging, LWN, Jon Corbet, May 2022](https://lwn.net/Articles/894546/)
- ['kvmalloc()', Jon Corbet, LWN, Jan 2017](https://lwn.net/Articles/711653/)
- [A pair of memory-allocation improvements in 5.13, Jon Corbet, LWN, May 2021](https://lwn.net/Articles/855226/)
- ['The "too small to fail" memory-allocation rule', Jon Corbet, LWN, Dec 2014](https://lwn.net/Articles/627419/)
- Blog article: ['linux slab poisoning 101', Mar 2009](http://www.chizang.net/alex/2009/03/11/linux-slab-poisoning-101/)
- ['The slab and protected-memory allocators', LWN, May 2018](https://lwn.net/Articles/753154/)
- Kernel memory debugging tools and techniques:
- [KASAN Kernel Address Sanitizer](https://www.kernel.org/doc/html/latest/dev-tools/kasan.html)
- [Kernel SLUB debug](https://www.kernel.org/doc/Documentation/vm/slub.txt)
- [kmemleak](https://www.kernel.org/doc/html/latest/dev-tools/kmemleak.html)
- DMA - Direct Memory Access
- Books: 'Essential Linux Device Drivers', S Venkateswaran, and 'Linux Device Drivers', Rubini, Corbet & Hartman
- ['DMAEngine documentation', Linux kernel](https://www.kernel.org/doc/html/latest/driver-api/dmaengine/index.html#dmaengine-documentation)
- ['A deep dive into CMA', LWN, Mar 2012](https://lwn.net/Articles/486301/)
- A quite simple and interesting example of a “DMA test application” device driver is from Xilinx (for it's Zynq PL330 DMA controller); [wiki page here](http://www.wiki.xilinx.com/Zynq+Linux+pl330+DMA)
- [Q&A on SO: Linux DMA: Using the DMAengine for scatter-gather transactions, May 2016](http://stackoverflow.com/questions/37119332/linux-dma-using-the-dmaengine-for-scatter-gather-transactions)
- Reclaim: [Official kernel documentation](https://www.kernel.org/doc/html/v6.1/admin-guide/mm/concepts.html#reclaim)
- Multi Generational LRU (MGLRU); merged in 6.1
- Official kernel docs:
- [Multi-Gen LRU](https://www.kernel.org/doc/html/v6.1/admin-guide/mm/multigen_lru.html): provides documentation on quick start, enabling / disabling it, various tunables
- [MGLRU design doc](https://www.kernel.org/doc/html/latest/mm/multigen_lru.html)
- LWN:
- [Merging the multi-generational LRU, Jon Corbet, May 2022](https://lwn.net/Articles/894859/)
- [Multi-generational LRU: the next generation, Jon Corbet, May 2022](https://lwn.net/Articles/856931/)
- [The multi-generational LRU, Jon Corbet, April 2022](https://lwn.net/Articles/851184/)
- Related:
- [Enable or disable multigenerational LRU](https://github.com/hakavlad/mg-lru-helper/tree/main). Practical..
- [mm: multi-gen LRU: per-process heatmaps](https://lwn.net/Articles/907718/)
- [Linux kernel page replacement algorithms, SoByte, Jan 2022](https://www.sobyte.net/post/2022-01/linux-multi-lru/)
- [Linux to Adopt New Multi-Generation LRU Page Reclaim Policy, Sergio De Simone, Jan 2022](https://www.infoq.com/news/2022/01/linux-mglru-memory-reclaim/)
- [Early commit: mm: multi-gen LRU: minimal implementation](https://github.com/torvalds/linux/commit/ac35a490237446b71e3b4b782b1596967edd0aa8)
- [OpenWrt / MIPS benchmark with MGLRU, Yu Zhao, Aug 2022](https://lore.kernel.org/all/20220831041731.3836322-1-yuzhao@google.com/)
- DAMON Data Access Monitor
- [Official kernel doc: DAMON](https://www.kernel.org/doc/html/v6.1/admin-guide/mm/damon/index.html)
- [Section 'Visualizing Recorded Patterns'](https://www.kernel.org/doc/html/v6.1/admin-guide/mm/damon/start.html#visualizing-recorded-patterns)
- [D A M O N: Data Access MONitoring Framework for Fun and Memory Management Optimizations, SeongJae Park, Kernel Summit Aug 2020](https://lpc.events/event/7/contributions/659/attachments/503/1195/damon_ksummit_2020.pdf)
- [DAMON: Data Access Monitor, SeongJae Park, May 2023](https://sjp38.github.io/post/damon/)
- [The damo front-end utility on GitHub](https://github.com/awslabs/damo); Shows some nice usage examples!
- [The masim memory access simulator on GitHub](https://github.com/sjp38/masim)
- [An example of DAMON usage for profiling, SeongJae Park, April 2023](https://sjp38.github.io/post/damon_profile_callstack_example/)
- [Using DAMON for proactive reclaim, Jon Corbet, LWN, July 2021](https://lwn.net/Articles/863753/)
- [Memory-management optimization with DAMON, Jon Corbet, LWN, Feb 2020](https://lwn.net/Articles/812707/)
- OOM and VM Overcommit
- [Better tools for out-of-memory debugging, Jon Corbet, May 2022, LWN](https://lwn.net/Articles/894546/)
- [Per-file OOM badness, Jon Corbet, June 2022, LWN](https://lwn.net/Articles/896738/)
- [Chris Siebenmann's excellent blog articles; (search for 'overcommit' within them)](https://utcc.utoronto.ca/~cks/space/blog/__IndexChron)
- [Toward more predictable and reliable out-of-memory handling, LWN, Jon Corbet, December 2015](https://lwn.net/Articles/668126/)
- [Quora: What are the disadvantages of disabling memory overcommit in Linux?](https://www.quora.com/What-are-the-disadvantages-of-disabling-memory-overcommit-in-Linux)
- [Relevant Linux kernel documentation](https://www.kernel.org/doc/Documentation/vm/overcommit-accounting)
- Blog article: ['Virtual memory settings in Linux - The Problem with Overcommit'](http://engineering.pivotal.io/post/virtual_memory_settings_in_linux_-_the_problem_with_overcommit/)
- RHEL specific but useful: ['Interpreting /proc/meminfo and free output for Red Hat Enterprise Linux 5, 6 and 7'](https://access.redhat.com/solutions/406773)
- [Blog article: Surviving the Linux OOM Killer, October 2018](https://dev.to/rrampage/surviving-the-linux-oomkiller-2ki9)
- User space OOM killer systemd-oomd
- [Man page on systemd-oomd.service(8)](https://www.freedesktop.org/software/systemd/man/systemd-oomd.service.html)
- Older - March 2014: [User-space out-of-memory handling, David Rientjes, LWN](https://lwn.net/Articles/590960/)
- [How to diagnose OOM errors on Linux systems, Paul Gottschling, Datadog, Dec 2023](https://linuxblog.io/how-to-diagnose-oom-errors-on-linux-systems/)
- [StackOverflow: How to mmap a Linux kernel buffer to userspace?](https://stackoverflow.com/a/10770582/779269)
<br>
[\[Top\]](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#further-reading)
## Chapter 10, The CPU Scheduler, Part 1 - Further Reading
- Detailed PDF: ['A complete guide to Linux process scheduling', Nikita Ishkov, Feb 2015](https://trepo.tuni.fi/bitstream/handle/10024/96864/GRADU-1428493916.pdf)
- (CFS) Autogroups
- [Why nice levels are a placebo and have been for a very long time, and no one seems to have noticed, Reddit, 2020](https://www.reddit.com/r/linux/comments/d7hx2c/why_nice_levels_are_a_placebo_and_have_been_for_a/)
- [RFC: documentation of the autogroup feature [v2], Nov 2016](https://www.uwsg.indiana.edu/hypermail/linux/kernel/1611.3/00766.html)
- [man 7 sched](https://man7.org/linux/man-pages/man7/sched.7.html)
- Scheduler tuning:
- A short and useful PDF doc: [Completely Fair Scheduler and its tuning, Jacek Kobus and Rafał Szklarski, 2009](http://fizyka.umk.pl/~jkob/_downloads/cfs-tuning.pdf)
- [Tuning the Task Scheduler, SuSe documentation](https://documentation.suse.com/sles/12-SP4/html/SLES-all/cha-tuning-taskscheduler.html)
- [A real-world, useful case: Reducing latency spikes by tuning the CPU scheduler, T Gabriec, June 2016, Scylla]( https://www.scylladb.com/2016/06/10/read-latency-and-scylla-jmx-process/)
- perf
- [Linux perf examples, Brendan Gregg](http://www.brendangregg.com/perf.html)
- [The perf wiki page](https://perf.wiki.kernel.org/index.php/Main_Page)
- [perf tutorial](https://perf.wiki.kernel.org/index.php/)
- Tutorial: [Playing around with perf](https://www.bernardi.cloud/2012/08/07/playing-around-with-perf/)
- [Memory Access Patterns Are Important](https://mechanical-sympathy.blogspot.com/2012/08/memoryaccess-patterns-are-important.html)
- [Video tutorial: talk recorded for the Linux Foundations OSSNA (Open Source Summit, North America), June 2023: 'Leveraging the OS CPU Scheduler to Write Real-Time MT Apps', Kaiwan N Billimoria, kaiwanTECH](https://www.youtube.com/watch?v=h9psonTquHU&t=63s)
- Ftrace
- ['ftrace: trace your kernel functions!', Julia Evans, Mar 2017](https://jvns.ca/blog/2017/03/19/getting-started-with-ftrace/)
- [Linux kernel preemption and the latency-throughput tradeoff, Dec 2019](https://www.codeblueprint.co.uk/2019/12/23/linuxpreemption-latency-throughput.html)
- An excellent detailed code-level article on how, specifically, the context switching switch_to() code path has evolved on the x86[_64] arch: [Evolution of the x86 context switch in Linux, Maizure, September 2018](https://www.maizure.org/projects/evolution_x86_context_switch_linux/)
<br>
[\[Top\]](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#further-reading)
## Chapter 11, The CPU Scheduler, Part 2 - Further Reading
- [Using the kernel's cgroups v2 cpusets: kernel doc](https://docs.kernel.org/admin-guide/cgroup-v2.html#cpuset)
- **Control Groups (cgroups)**
- [The must-read: official Linux kernel doc: Control Group v2](https://docs.kernel.org/admin-guide/cgroup-v2.html)
- Four-part series on cgroups and systemd, Red Hat, Steve Ovens
- [A Linux sysadmin's introduction to cgroups, Steve Ovens, Sept 2020](https://www.redhat.com/sysadmin/cgroups-part-one)
- [How to manage cgroups with CPUShares, Steve Ovens, Oct 2020](https://www.redhat.com/sysadmin/cgroups-part-two)
- [Managing cgroups the hard way-manually, Steve Ovens, Oct 2020](https://www.redhat.com/sysadmin/cgroups-part-three)
- [Managing cgroups with systemd, Steve Ovens, Oct 2020](https://www.redhat.com/sysadmin/cgroups-part-four)
- [How I think you set up fair share scheduling under systemd, C Siebenmann, May 2016](https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdFairshareScheduling)
- [The basics of Linux fair share CPU scheduling in cgroup v2 ('unified cgroups'), C Siebenmann, May 2022](https://utcc.utoronto.ca/~cks/space/blog/linux/CgroupV2FairShareScheduling)
- [Understanding cgroups, Grant, Nov 2018](https://www.grant.pizza/blog/understanding-cgroups/)
- Good introductory article (focussed on cgroups1): ['Control Groups in Linux', Feb 2017](http://blog.brew.com.hk/control-groups-in-linux/)
- ['Understanding the new control groups API', Rami Rosen, LWN, Mar 2016](https://lwn.net/Articles/679786/)
- man page (informational): ['cgroups - Linux control groups'](http://man7.org/linux/man-pages/man7/cgroups.7.html) (man 7 cgroups)
- [Managing resources with cgroups in systemd, David Both, Oct 2020](https://opensource.com/article/20/10/cgroups)
- RedHat System Design Guide (RHEL 8); focus on cgroups v1: ['SETTING LIMITS FOR APPLICATIONS'](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/system_design_guide/setting-limits-for-applications_system-design-guide)
- FB: Includes an interesting case study on how Facebook uses Linux's cgroups2 to perform equitable resource distribution on (some of) it's servers: ['Maximizing Resource Utilization with cgroup2'](https://facebookmicrosites.github.io/cgroup2/docs/overview.html)
- ['Creating and organizing cgroups'](https://facebookmicrosites.github.io/cgroup2/docs/create-cgroups.html)
- Blog article, examples of using cgroups v1 for CPU and memory bandwidth control: ['Linux Virtualization : Resource throttling using cgroups'](https://www.geeksforgeeks.org/linux-virtualization-resource-throttling-using-cgroups/)
- Kernel namespaces
- [The 7 most used Linux namespaces, Oens, Red Hat, Jan 2021](https://www.redhat.com/sysadmin/7-linux-namespaces)
- [A Practical Introduction to Container Terminology, Feb 2018, McCarty, Red Hat Developer](https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction)
- [namespaces(7) — Linux manual page](https://man7.org/linux/man-pages/man7/namespaces.7.html)
- **Hard Real-Time and Linux as an RTOS**
- ['Inside Real-Time Linux', Feb 2017](https://www.linux.com/news/event/elce/2017/2/inside-real-time-linux)
- ['The Road to Real Time Linux', Steven Rostedt, Mar 2017](https://blogs.vmware.com/opensource/2017/03/16/road-real-time-linux/)
- [VDC Survey on real-time response : The Embedded Muse, 341, 03 Jan 2018, Jack Ganssle](http://www.ganssle.com/tem/tem341.html#article3)
- Blog article: ['Algorithm time complexity and big O notation'](https://medium.com/@StueyGK/algorithm-time-complexity-and-big-o-notation-51502e612b4d)
- Book: *Automate This: How Algorithms Came to Rule Our World, Christopher Steiner*
- Older wiki site on *preempt_rt*; it's in the process of being migrated to the new documentation for RTL; it still has very useful HOWTO guides, articles, etc: ['Real-Time Linux Wiki'](https://rt.wiki.kernel.org/index.php/Main_Page)
- RTL Real-Time Linux, using Linux as an RTOS:
- [The RTL Collaborative Project](https://wiki.linuxfoundation.org/realtime/rtl/start)
- [RTL Real-Time documentation](https://wiki.linuxfoundation.org/realtime/documentation/start)
- [HOWTO: RTOS and RT Applications](https://wiki.linuxfoundation.org/realtime/documentation/howto/applications/application_base)
- Interesting: "... compares the load results of the Ubuntu 18.04 LTS generic kernel 4.15.0-22-generic, the Ubuntu low-latency kernel 4.15.0-22-lowlatency and an Ubuntu Linux kernel patched to be fully preemptive 4.16.0-rt4-PREEMPT_RT_FULL as well as preemptive with low-latency 4.16.12-rt4+REEMPT_LL" : ['Low latency and real-time kernels for telco and NFV', Ubuntu, Oct 2018](https://ubuntu.com/blog/low-latency-real-time-kernels-telco-nfv)
- ['Real-time Linux communications - An evaluation of the Linux communication stack for real-time robotic applications', Sept 2018](https://hackernoon.com/real-time-linux-communications-2faabf31cf5e)
- ['The real-time linux kernel: A survey on Preempt_RT', Feb 2019](https://www.researchgate.net/publication/331290349_The_real-time_linux_kernel_A_survey_on_Preempt_RT)
- Detailed slides on cyclictest, good for understanding latency and it's measurement: ['Using and Understanding the Real-Time Cyclictest Benchmark', Rowand, Oct 2013](https://events.static.linuxfound.org/sites/events/files/slides/cyclictest.pdf)
- ['Intro to Real-Time Linux for Embedded Developers', an interview with Steven Rostedt](https://www.linuxfoundation.org/blog/2013/03/intro-to-real-time-linux-for-embedded-developers/)
- The still amazing and very relevant book on software engineering: *'The Mythical Man Month: Essays on Software Engineering'*, Frederick P Brooks, 1975, 1995
- [On Amazon (Anniversary Edition)](https://www.amazon.com/Mythical-Man-Month-Anniversary-Software-Engineering-ebook/dp/B00B8USS14/ref=sr_1_1?crid=3R2CNHTX5LYIC&keywords=mythical+man+month&qid=1562226712&s=digital-text&sprefix=mythical+%2Cdigital-text%2C376&sr=1-1)
- [Quotes](https://en.wikiquote.org/wiki/Fred_Brooks)
- New(er) articles on LWN regarding scheduling-related topics:
- The new 6.6 EEVDF (Earliest Eligible Virtual Deadline First) CPU/task scheduler:
- [An EEVDF CPU scheduler for Linux, Jon Corbet, Mar 2023](https://lwn.net/Articles/925371/)
- [EEVDF Scheduler Merged For Linux 6.6, Intel Hybrid Cluster Scheduling Re-Introduced, M Larabel, Aug 2023](https://www.phoronix.com/news/Linux-6.6-EEVDF-Merged)
- [KernelNewbies: Linux 6.6](https://kernelnewbies.org/Linux_6.6#New_task_scheduler:_EEVDF)
- [Fixing a corner case in asymmetric CPU packing (January 7, 2022)](https://lwn.net/Articles/880367/)
- [Hybrid scheduling gets more complicated (September 30, 2022)](https://lwn.net/Articles/909611/)
- [Core scheduling lands in 5.14 (July 1, 2021)](https://lwn.net/Articles/861251/)
- [Improved response times with latency nice (March 17, 2022)](https://lwn.net/Articles/887842/)
- [Evaluating vendor changes to the scheduler (May 19, 2020)](https://lwn.net/Articles/820825/)
- [Removing the scheduler's energy-margin heuristic (July 1, 2022)](https://lwn.net/Articles/899303/)
- Cgroups
- [The burstable CFS bandwidth controller (February 8, 2021)](https://lwn.net/Articles/844976/)
- [A "kill" button for control groups (May 3, 2021)](https://lwn.net/Articles/855049/)
- [Cleaning up dying control groups, 2022 edition (May 19, 2022)](https://lwn.net/Articles/895431/)
- Google's research project: ghOSt OS
- 'ghOSt: Fast & Flexible User-Space Delegation of Linux Scheduling', J T Humphries et al, ACM Digital Library, Oct 2021
- [Paper](https://dl.acm.org/doi/10.1145/3477132.3483542)
- [Video talk](https://www.youtube.com/watch?v=j4ABe4dsbIY)
- [ghOSt user space repo on GitHub](https://github.com/google/ghost-userspace)
- [ghOSt kernel-space repo on GitHub](https://github.com/google/ghost-kernel)
<br>
[\[Top\]](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#further-reading)
## Chapter 12, Kernel Synchronization, Part 1 - Further Reading
- The official kernel documentation on Locking: [Locking](https://docs.kernel.org/locking/index.html)
- In-depth, execellent: [Is Parallel Programming Hard, And, If So, What Can You Do About It?, Paul E. McKenney, 2023 (maintained)](https://mirrors.edge.kernel.org/pub/linux/kernel/people/paulmck/perfbook/perfbook.html)
- Deeper details on the LKMM: [Explanation of the Linux-Kernel Memory Model](https://github.com/aparri/memory-model/blob/master/Documentation/explanation.txt)
- [Who's afraid of a big bad optimizing compiler? Article contributed by Jade Alglave, Will Deacon, Boqun Feng, David Howells, Daniel Lustig, Luc Maranget, Paul E. McKenney, Andrea Parri, Nicholas Piggin, Alan Stern, Akira Yokosawa, and Peter Zijlstra, LWN, July 2019](https://lwn.net/Articles/793253/)
- [Why kernel code should use READ_ONCE and WRITE_ONCE for shared memory accesses, Google wiki](https://github.com/google/kernel-sanitizers/blob/master/other/READ_WRITE_ONCE.md#why-kernel-code-should-use-read_once-and-write_once-for-shared-memory-accesses). *CAUTION! Module/driver devs, don't blindly do this!*
- Daniel Vetters excellent blog posts here:
- [Locking Engineering Principles, Daniel Vetter, July 2022](https://blog.ffwll.ch/2022/07/locking-engineering.html) (In this post, he says, among other stuff: “… 1. Make it Dumb: Since this is the key principle …”. IOW, keep it simple)
- [Locking Engineering Hierarchy, Daniel Vetter, August 2022](https://blog.ffwll.ch/2022/08/locking-hierarchy.html) : A pile of locking patterns and designs, from the easiest to hardest
- Here's Paul E. McKenneys follow-up post: [Stupid SMP Tricks: A Review of Locking Engineering Principles and Hierarchy, Aug 2022](https://paulmck.livejournal.com/67832.html?utm_source=3userpost)
- A good read: ['What every systems programmer should know about concurrency', M Kline, May 2018](https://assets.bitbashing.io/papers/concurrency-primer.pdf)
- Chip Overclock blog: [Peeking under the Hood, Sloan, May 2012](https://coverclock.blogspot.com/2012/05/peeking-under-hood.html)
- [Measuring context switching and memory overheads for Linux threads, Eli Bendersky, Sept 2018](https://eli.thegreenplace.net/2018/measuring-context-switching-and-memory-overheads-for-linux-threads/)
- Compiler Explorer website, Matt Godbolt; very useful: [See the live disassembly of your code on a large choice of compilers and compiler flags](https://godbolt.org/)
- This presentation covers deadlock scenarios: ['Lockdep: how to read it's cryptic output', Steve Rostedt, Linux Plumbers Conf 2011](https://blog.linuxplumbersconf.org/2011/ocw/sessions/153)
- ['Mutexes and Semaphores Demystified', Micheal Barr, May 2016](https://barrgroup.com/Embedded-Systems/How-To/RTOS-Mutex-Semaphore)
- Mutex internal implementation
- [Official kernel doc: Implementation](https://docs.kernel.org/locking/mutex-design.html#implementation)
- [Mutex - Linux inside - 0xax](https://0xax.gitbooks.io/linux-insides/content/SyncPrim/linux-sync-4.html)
- Spinlock internal implementation
- ['Peeking Under the Hood', John Sloan, Chip Overclock blog, May 2012](https://coverclock.blogspot.com/2012/05/peeking-under-hood.html)
- ['spin_lock implementation in ARM linux', linuxforthenew blog, Apr 2013](http://linuxforthenew.blogspot.com/2013/04/spinlock-implementation-in-arm-linux.html)
- [Synchronization primitives in the Linux kernel. Part 1, linux-insides online book](https://0xax.gitbooks.io/linux-insides/content/SyncPrim/linux-sync-1.html)
- The Mars Pathfinder mission and Priority Inversion
- ['What really happened on Mars ?' Glenn Reeves](https://cs.unc.edu/~anderson/teach/comp790/papers/mars_pathfinder_long_version.html)
- A must-read (PDF): [*What the Media Couldn't Tell You About Mars Pathfinder*](http://people.cs.ksu.edu/~hatcliff/842/Docs/Course-Overview/pathfinder-robotmag.pdf)
- Detailed paper (PDF): [*Mars Pathfinder: Priority Inversion Problem*, R.M. Pathan](http://www.cse.chalmers.se/edu/year/2015/course/EDA222/Documents/Misc/Report_MarsPathFinder.pdf)
- More recently (May 2015), with respect to the NASA Curiosity Rover: [*13 engineering truths proved by NASA's Curiosity Rover*, EDN](https://www.edn.com/electronics-blogs/now-hear-this/4439386/13-engineering-truths-proved-by-NASA-s-CuriosityRover?mc=NL_EDN_EDT_EDN_funfriday_20150508&cid=NL_EDN_EDT_EDN_funfriday_20150508&elq=75871e4437784010b51f12e4c3be00a2&elqCampaignId=22919&elqaid=25798&elqat=1&elqTrackId=8e848e14bf3e41b58e660c804b335b07)
- OSFY magazine: ['How to Avoid Priority Inversion and Enable Priority Inheritance in Linux Kernel Programming', Thangaraju & Warade, Apr 2019](https://opensourceforu.com/2019/04/how-to-avoid-priority-inversion-and-enable-priority-inheritance-in-Linux-Kernel-Programming/)
- The w/w - wait/wound - mutex:
- [ww-mutex-design.txt, Jon Corbet, LWN, April 2013](https://lwn.net/Articles/548921/)
- Official kernel doc (based upon the above one, actually) [Wound/Wait Deadlock-Proof Mutex Design](https://docs.kernel.org/locking/ww-mutex-design.html#wound-wait-deadlock-proof-mutex-design)
<br>
[\[Top\]](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#further-reading)
## Chapter 13, Kernel Synchronization, Part 2 - Further Reading
- [LWN Kernel Index on Reference counting](https://lwn.net/Kernel/Index/#Reference_counting)
- [Official kernel doc: Reference counting (interfaces/APIs)](https://docs.kernel.org/driver-api/basics.html#reference-counting)
- Reference Counting API: [kernsec: a summary](https://kernsec.org/wiki/index.php/Kernel_Protections/refcount_t)
- CPU Caches, coherency and False Sharing
- [Cache coherency protocol examples, Wikipedia](https://en.wikipedia.org/wiki/Cache_coherency_protocols_(examples)#Coherency_protocols)
- [Cache Coherence Problem & Cache Coherency Protocols, Neso, YouTube video](https://www.youtube.com/watch?v=r_ZE1XVT8Ao)
- [MOESI protocol; used on AMD64 processors](https://en.wikipedia.org/wiki/MOESI_protocol)
- ['Avoiding and Identifying False Sharing Among Threads', Intel, Nov 2011](https://software.intel.com/en-us/articles/avoiding-and-identifying-false-sharing-among-threads)
- Blog article: ['Understanding False Sharing', Mar 2017](https://parallelcomputing2017.wordpress.com/2017/03/17/understanding-false-sharing/)
- Lock-free (or lockless) programming:
- [What every systems programmer should know about concurrency, Matt Kline, May 2018](https://assets.bitbashing.io/papers/concurrency-primer.pdf)
- Excellent "lock-free 101" articles:
- [Fear and Loathing in Lock-Free Programming, T. Neely, Medium](https://medium.com/@tylerneely/fear-and-loathing-in-lock-freeprogramming-7158b1cdd50c)
- [An Introduction to Lock-Free Programming, Preshing on Programming blog, June 2012](https://preshing.com/20120612/an-introduction-to-lock-free-programming/)
- Good articles, series: ['Introduction to Lock-free Algorithms'](http://www.1024cores.net/home/lock-free-algorithms/introduction)
- Presentation: ['Lock-Free Programming', Geoff Langdale](https://www.cs.cmu.edu/~410-s05/lectures/L31_LockFree.pdf)
- Blog article: ['Some notes on lock-free and wait-free algorithms'](http://www.rossbencina.com/code/lockfree?q=~rossb/code/lockfree/)
- ['CppCon 2014: Herb Sutter "Lock-Free Programming (or, Juggling Razor Blades), Part I', Herb Sutter, YouTube video](https://www.youtube.com/watch?v=c1gO9aB9nbs)
- [1024cores: Dmitry Vyukov's blog articles etc](https://www.1024cores.net/)
- []()
- Per-CPU variables:
- Blog article: [A brief introduction to per-cpu variables, Chen, May 2014](http://thinkiii.blogspot.com/2014/05/a-briefintroduction-to-per-cpu.html)
- [How are percpu pointers implemented in the Linux kernel?, Stack Overflow, June 2013](https://stackoverflow.com/questions/16978959/how-are-percpu-pointersimplemented-in-the-linux-kernel)
- RCU - Read-Copy-Update - in the Linux kernel
- Official kernel doc (includes FAQs): [RCU Concepts](https://docs.kernel.org/RCU/rcu.html#rcu-concepts)
- Excellent (and up-to-date!) collated documentation on RCU, Paul E. McKenney: [Read-Copy Update (RCU) Publications](https://docs.google.com/document/d/1X0lThx8OK0ZgLMqVoXiR4ZrGURHrXK6NyLRbeXe3Xac/edit#heading=h.gidbhbrm8o5x)
- [RCU articles on LWN kernel index, from 2004 onward](https://lwn.net/Kernel/Index/#Read-copy-update)
- A superb playlist of YouTube video tutorials on RCU (by S.T. Chang)! [RCU](https://www.youtube.com/playlist?list=PLIlI4QbmdBqH9-L1QOq6O5Yxt-YVjRsFZ)
- Do see the first one first [12 what is RCU, Paul E. McKenney, presentation at IISc Bangalore, 2013](https://www.youtube.com/watch?v=obDzjElRj9c&list=PLIlI4QbmdBqH9-L1QOq6O5Yxt-YVjRsFZ)
- Modern-ish take: [Kernel Recipes 2019 - RCU in 2019, Joel Fernandes, Google, Oct 2019](https://www.youtube.com/watch?v=bsyXDAouI6E&list=PLIlI4QbmdBqH9-L1QOq6O5Yxt-YVjRsFZ&index=3)
- [My First Kernel Module: A Debugging Nightmare, Ryan Eberhardt. Nov 2020](https://reberhardt.com/blog/2020/11/18/my-first-kernel-module.html); see the section entitled 'RCU: Read, Copy, Update', excellent and clear!
- A 3 series article to learn RCU: ['What is RCU, Fundamentally?', LWN, Paul E. McKenney, Dec 2007, Part 1 of 3 ](https://lwn.net/Articles/262464/)
- ['RCU Usage In the Linux Kernel: One Decade Later', Paul E. McKenney et al (PDF), circa 2013](http://www2.rdrop.com/~paulmck/techreports/RCUUsage.2013.02.24a.pdf)
- Code-level examples of RCU usage:
- A nice simple 'book library' example: [rcu_example, Jinbum Park](https://github.com/jinb-park/rcu_example/tree/master)
- Another covering rw-lock and (S)RCU: [Linux RCU Usage and internals, Feb 2021](https://sklinuxblog.blogspot.com/2021/02/linux-rcu-usage.html)
- [Linux RCU, Lizhou Shan, Oct 2021](http://lastweek.io/notes/linux/linux-rcu/)
- [Sleepable RCU, Paul E. McKenney, LWN, Oct 2006](https://lwn.net/Articles/202847/)
- ['Make any algorithm lock-free with this one crazy trick', May 2016](https://www.the-paper-trail.org/post/2016-05-25-make-any-algorithm-lock-free-with-this-one-crazy-trick/)
- ['The lockless page cache', LWN, Jon Corbet, July 2008](https://lwn.net/Articles/291826/) (an interesting article)
- Lockdep
- ['Runtime locking correctness validator', kernel documentation](https://www.kernel.org/doc/Documentation/locking/lockdep-design.txt)
- ['The kernel lock validator', LWN, J Corbet, May 2006](https://lwn.net/Articles/185666/)
- ['Lockdep: how to read it's cryptic output', Steve Rostedt, Linux Plumbers Conf 2011](https://blog.linuxplumbersconf.org/2011/ocw/sessions/153)
- ['LOCKDEP, AN INSIDE OUT PERSPECTIVE', Nahim El Atmani, Nov 2016](https://www.lse.epita.fr/data/lt/2016-11-08/lt-2016-11-08-Nahim_El_Atmani-lockdep-an-inside-out-perspective.pdf)
- [Lockdep False Positives, some stories about, David Airlie, Aug 2020](https://blog.ffwll.ch/2020/08/lockdep-false-positives.html)
- Memory barriers:
- PDF: ['Memory Barriers: a Hardware View for Software Hackers',
Paul E. McKenney, IBM LTC, June 2010](http://www.rdrop.com/~paulmck/scalability/paper/whymb.2010.06.07c.pdf)
- [Memory Barriers Are Like Source Control Operations, Preshing on Programming blog, July 2012](https://preshing.com/20120710/memory-barriers-are-like-source-control-operations/)
- kdump and crash:
- Kernel documentation for kdump: [The kexec-based Crash Dumping Solution](https://www.kernel.org/doc/ocumentation/kdump/kdump.txt)
- [Oops! Debugging Kernel Panics, Linux Journal, August 2019](https://www.linuxjournal.com/content/oopsdebugging-kernel-panics-0)
- Excellent resource for learning and using the crash app: [White paper: Red Hat Crash Utility, David Anderson](https://crash-utility.github.io/crash_whitepaper.html)
- [Analyzing Linux kernel crash dumps with crash - The one tutorial that has it all, Dedoimedo, June 2010]( http://www.dedoimedo.com/computers/crash-analyze.html)
[\[Top\]](https://github.com/PacktPublishing/Linux-Kernel-Programming_2E/blob/main/Further_Reading.md#further-reading)
[End Doc]