Linux Kernel Concurrency Cheat Sheet

Linux Tux

Navigating Linux kernel APIs can be very time-consuming, so Linux ksplice guru Vegard Nossum put together a very handy time-saving cheat sheet to help traversing Linux kernel concurrency primitives.

As a child, I spent countless hours playing games on my Nintendo Game Boy. As I grew older and started programming in QBasic on MS-DOS, I also got curious about how Game Boy games worked.

At that time, I didn’t yet have an Internet connection at home, but I spent a lot of time at my parents’ workplaces after school, where I had access to the Internet. I would frequently bring stacks of floppies and load them up with anything I could download — QBasic programs, shareware, and all the programming tutorials and documentation I could find.

One of the things I found was the “Nintendo GameBoy Crib Sheet” by Justin “Otaku No” Lloyd. The Crib Sheet is a 4-page document, meant to be printed, that is packed with information about Game Boy assembly programming — instructions, opcodes, memory maps, IO registers, etc. At the time, I didn’t really understand a lot of it, but I marveled at it and treasured it.

My dad worked at a printing business, so he had the equipment to print the Crib Sheet in A3 (roughly “Tabloid/Ledger” in US paper sizes), two-sided and in color, and laminate it.

I eventually learned how to program the Game Boy, largely helped by my printed and laminated Crib Sheet.

Since then, I’ve had a bit of a soft spot for cheat sheets. They’re not for everybody, and that’s fine. To me, there is something magical about seeing the essence of something distilled down to a tightly packed overview that fits in your hands.

That’s why I decided to make one for Linux kernel concurrency primitives (click on the preview to download the PDF):

In some places, you’ll see some circled, colored number references. Those refer to potential variants of a function, and the variants are usually listed just below the table of functions.

This cheat sheet is necessarily incomplete — Linux kernel APIs are too numerous and diverse to be able to include every detail. I consider the cheat sheet to be a handy reference and a good starting point for exploring the APIs.

Read Article At