Process Control Block in Linux
Process Control Block in Linux
A process in an operating system is represented by a data structure known as a process control block (PCB/ Task Controlling Block / Task Struct). The PCB contains important information about the specific process including the current state of the process i.e., whether it is ready, running, waiting, or whatever.
This contains the structure of the the next process which are ready to run in ready queue Struct task_struct *prev_run; This is the structure of the previous executed processes in the read queue Struct mm_struct mm[1]; Unsigned long kernel_stack_page; Unsigned long saved_kernel_stack; Struct fs_struct fs[1]; Long utime, stime, cutime, cstime, start_time; Struct sem_queue *semsleeping; Struct wait_queue *wait_chldexit; Struct sigaction sigaction[32]; Struct rlimit rlim[RLIM_NLIMITS]; Struct thread_struct tss; This includes saved registers
Unsigned long policy; Unsigned long rt_priority; Int processor, last processor; Int lock_depth; It indicates how many times has been acquired the kernel lock. This lock protects some of the kernel data structures. }