ManagingPIDs

In addition to these two fields, the kernel needs to find a way to manage all local per-namespace quantities, as well as the other identifiers like TID and SID. This requires several interconnected data structures and numerous auxiliary functions that are discussed in the following.

Data Structures

Below I use the term ID to refer to any process identifier. I specify the identifier type explicitly (e.g., TGID for ''thread group identifier'') where this is necessary.

A small subsystem known as a pid allocator is available to speed up the allocation of new IDs. Besides, the kernel needs to provide auxiliary functions that allow for finding the task structure of a process by reference to an ID and its type, and functions that convert between the in-kernel representation of IDs and the numerical values visible to userspace.

Before I introduce the data structures required to represent IDs themselves, I need to discuss how PID namespaces are represented. The elements required for our purposes are as follows:

Continue reading here: Info

Was this article helpful?

0 0