-
Kernel -- software that manages the system by providing access to hardware and other resources (memory, network stack, scheduling cpu, etc). Runs in priveleged CPU mode -- kernel mode. It uses kernel-space stack.
-
Process -- an OS abstraction for running programs. Runs in user mode with access to kernel mode via system calls. It consists of: memory address space, file descriptors, thread stacks, registers. Process uses user-space stacks. For example, syscalls use a s kernel exception stack associated with each thread.
-
System call -- a protocol for user programs to request kernel to perform privileged operations
-
Trap -- a signal sent to kernel to request a system routine (system calls, processor exceptions, interrups)
-
Hardware interrupt -- a signal sent by devise to kernel, it is a type of trap
-
Socket -- endpoints by which user-level aplications access the network
-
Network interface -- physical device to connect to network
-
IPIs -- inter-processor interrupt which is a way to coordinate processors in multiprocessor system
-
SystemD -- service manager on Linux. Among features -- dependecy-aware service startup, analytics (
systemd-analyze
) -
KPTI -- kernel page table isolation patches to mitigate "meltdown" vulnerability. The cost is 0.1% - 6% depending on number of syscalls (context switch is more expensive)
-
Functional unit CPU component does the following: fetch instruction, decode instruction, execute and (optionaly) memory access, register write-back.
-
user-time/kernel-time
ratio is high for computationally intensive applications and low for I/O bound (web server, etc). -
MMU -- memory managment unit. Performs virtual memory management. Memory is paged and the chache for pages translation is TLB (translation lookaside buffer). If there is tlb miss, MMU goes to Page tables (main memory).
-
futex -- fast user space mutex which is using atomic integer under the hood. Basic operations are
WAIT(addr, val)
(if *addr == val => current thread sleeps
andWAKE(addr, num)
(wakes up num threads waiting for the addressaddr
. -
toplev -- tool to find bottleneck in software https://github.com/andikleen/pmu-tools/wiki/toplev-manual
https://www.scylladb.com/2017/07/06/scyllas-approach-improve-performance-cpu-bound-workloads/
Interesting article about icache load and optimizations. Sounds like
futures
and postponed grouped computations might be a thing to consider