Skip to content

Instantly share code, notes, and snippets.

@congto
Forked from reterVision/notes.md
Created March 25, 2018 10:54
Show Gist options
  • Save congto/458fefb9631ea0d1b5867e62d3b80727 to your computer and use it in GitHub Desktop.
Save congto/458fefb9631ea0d1b5867e62d3b80727 to your computer and use it in GitHub Desktop.
Linux Performance Tuning

Linux process management

  • process scheduling
  • interrupt handling
  • signaling
  • process prioritization
  • process switching
  • process state
  • process memory

A process is an instance of execution that runs on a processor.

task_struct -> process descriptor

Life cycle of processes

parent process -> fork() -> child process -> exec() -> child process -> exit() -> zombie process -> parent process

Copy On Write

Kernel only assgins the new physical page to the child processes when the child process call exec() which copies the new program to the address space of the child process.

The child process will not be completely removed unitl the parent process knows of the termination of its child process by the wait() system call.

Thread

A thread is an execution unit generated in a single process. It runs parallel with other threads in the same process.

Thread creation is less expensive than process creation because a thread does not need to copy resources on creation.

Process priority and nice level

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment