Linux is a cross-architecture kernel, often packaged in neat distributions. These distributions contain GNU software, which distributes the C standard library and common utilities. In addition to GNU software, Linux distributions are usually packaged with window managers and desktop environments.
Linux is also the base that operating systems like ChromeOS, Android, and many embedded OS are built on. Linux supports all modern instruction set architectures (like x86-64, ARM, and RISC-V), as well as some historical or embedded architectures (like Nios II, MIPS, and PowerPC).
Architecture
Linux was mostly inspired by UNIX systems, so the programming interface is fairly similar to programming on UNIX systems (like macOS). In particular, POSIX compatibility is shared, so software written for one system is fairly portable.
uses a FCFS and RR scheduler SCHED_FIFO
, SCHED_RR
priority range
soft real-time 99 to 0 -100 to -1
normal niceness -20 to 19 0 to 39
priority -100 == real-time RT
Scheduling
Linux has a broad history of using different scheduling algorithms:
- In Linux 2.4, it used a single scheduler for multiprocessor CPUs.
- In Linux 2.6, it used a compromise scheduler between a global and per-CPU scheduler, with an complexity. The scheduler was able to re-balance per-CPU queues (taking a process from another CPU and assigning it to idle CPUs). It relied on “processor affinity” if a process wanted to be scheduled on the same core.
- It currently relies on a completely fair scheduler, which permits good interactivity for foreground processes.
- Linux also implements first-come-first-serve (FCFS) and round-robin (RR) scheduling, in
SCHED_FIFO
andSCHED_RR
, respectively.
Soft real-time processes are always scheduled with the highest priority processes first. Normal processes have their priorities adjusted based on aging. Linux maintains a priority range (a Linux priority), between -100 and 39.
- Soft real-time processes have a priority between 99 and 0. Their Linux priority is between -100 and -1.
- Normal processes have a “niceness” between -20 and 19. Their Linux priority is between 0 and 39. The order these are described in matters.
Distributions
See also
- The Linux Programming Interface, by Michael Kerrisk