Volunteering at AddisCoder!

This past summer I spent a month in Ethiopia in the capital Addis Ababa volunteering to teach coding to high school students from all over Ethiopia 🇪🇹.

Read More

Replacing PID implementation with IDR API

My project involves replacing bitmap implementation of PID allocation with IDR implementation. In an effort to do this, I made an exhaustive list of all the functions inside pid.c which will need replacement/deletion because they use bitmap (or are no longer needed). While this is not an ideal way to go about this problem, it helps me isolate what needs to be changed. In a while I will also have to figure out how to break my patches logically so that every patch in the series ensures that the kernel will not break. For now, here is the list:

Read More

Process ID Lookup

In this post, I’ll be explaining the functions used for PID lookup in the Linux kernel. The first function is next_pidmap(), which finds the first set bit in the current pidmap or the successor pidmaps corresponding to a namespace ns. Initially, there is a sanity check on the range to see if we have not exceeded the PID_MAX_LIMIT. Inside the for loop, we traverse from the current pidmap till the end of the pidmaps.

Read More

IDR API

The IDR API is charged with the allocation of integer ID numbers used with device names, POSIX timers, and more.

Read More

Freeing Process ID

Allocating a free PID is essentially looking for the first bit in the bitmap whose value is 0; this bit is then set to 1. Conversely, freeing a PID can be implemented by ‘toggling’ the corresponding bit from 1 to 0.

Read More