Linux processes Flashcards
information holds on a linux process
scheduling parameters - priority, amount of cpu consumed, time spent sleeping
memory image - pointer to the text, data and stack segments or page table
signal - masks showing which signals are being ignored
Machine registers - when traped to kernel the machine registers are saved here
system call state - current system call with params
file descriptor table - opened file descriptors
accounting
kernel stack
miscellaneous
Nice value
A priority value assigned to a process, which can affect its scheduling priority. A lower nice value means a higher priority
Process tree
A hierarchical structure of processes in which each process has a parent process and can have one or more child processes
Zombie process
process that has completed execution but has not yet been cleaned up by its parent process. It remains in the system’s process table until its parent acknowledges its termination.
Daemons
Background processes in Linux that run continuously and perform system-related tasks, such as managing network connections or handling print jobs
Interprocess Communication (IPC)
The mechanism used by processes in Linux to exchange data and synchronize their actions, including pipes, shared memory, and message queues.
Process Affinity
The ability in Linux to bind a process to a specific CPU or a group of CPUs, which can improve performance by reducing cache misses and improving memory locality.
three types of threads
- real-time fifo - highest priority and are not preemptable
- real-time round-robin - second priority, preemptable by the clock, and have time quanta associated with them.
- timesharing - lowest priority
runqueue or O(1) queue
2 lists of linked-list-queues, one for active and one for expired processes.
for the active queues, the scheduler chooses the highest priority queue and executes the first processes in it, when it ends the scheduler put the processes in one of the expired queues. once finished with active queues, it will switch the active and expired lists.
Completly Fair Scheduler - CFS
red-black tree, tasks are ordered in the tree based on the amount of time they spend running on the CPU, called vruntime. the child on the left had less time on the CPU and will be scheduled sooner.
periodically CFS increments the task’s vruntime and compares this to the current leftmost node in the tree and chose when to stop the current task and reinsert it into the tree