Linux | Red Hat Certified | IT Technology | Operations Engineer
👇 Join the technical exchange QQ group with 1000 members. Note 【Official Account】 for quicker approval.
// task_struct structure comments:// ==========================long state // Task running state (-1 not runnable, 0 runnable (ready), >0 stopped).long counter // Task running time count (decrementing) (ticks), running time slice.long priority // Running priority. When the task starts running, counter = priority, the larger it is, the longer it runs.long signal // Signal. It is a bitmap, each bit represents a signal, signal value = bit offset + 1. struct sigaction sigaction[32] // Signal execution attribute structure, corresponding to the operation and flag information to be executed for the signal. long blocked // Process signal mask (corresponding to signal bitmap).// -------------------------- int exit_code // Exit code when the task execution stops, which will be taken by its parent process. unsigned long start_code // Code segment address. unsigned long end_code // Code length (in bytes). unsigned long end_data // Code length + data length (in bytes). unsigned long brk // Total length (in bytes). unsigned long start_stack // Stack segment address. long pid // Process identifier (process number). long father // Parent process number. long pgrp // Parent process group number. long session // Session number. long leader // Session leader. unsigned short uid // User identifier (user id). unsigned short euid // Effective user id. unsigned short suid // Saved user id. unsigned short gid // Group identifier (group id). unsigned short egid // Effective group id. unsigned short sgid // Saved group id. long alarm // Alarm timer value (ticks). long utime // User mode running time (ticks). long stime // System mode running time (ticks). long cutime // Child process user mode running time. long cstime // Child process system mode running time. long start_time // The moment the process starts running. unsigned short used_math // Flag: whether a coprocessor has been used.// -------------------------- int tty // The sub-device number of the tty used by the process. -1 means not used. unsigned short umask // File creation attribute mask bit. struct m_inode * pwd // Current working directory inode structure. struct m_inode * root // Root directory inode structure. struct m_inode * executable // Executable file inode structure. unsigned long close_on_exec // Bitmap flag for closing file handles on execution. (See include/fcntl.h) struct file * filp[NR_OPEN] // File table structure used by the process.// --------------------------struct desc_struct ldt[3] // Local descriptor table for this task. 0-empty, 1-code segment cs, 2-data and stack segment ds&ss.
Identifier: Unique identifier describing this process, used to distinguish it from other processes. State: Task state, exit code, exit signal, etc. Priority: Priority relative to other processes. Program counter: Address of the next instruction to be executed in the program. Memory pointer: Includes pointers to program code and process-related data, as well as pointers to shared memory blocks with other processes.Context data: Data in the processor registers during process execution [Example of rest study, add image CPU, registers].I/O status information: Includes displayed I/O requests, I/O devices allocated to the process, and the list of files used by the process.Accounting information: May include total processor time, total clock counts used, time limits, accounting numbers, and other information.
For course inquiries, add: HCIE666CCIE
↑ Or scan the QR code above ↑
What technical points and content do you want to see?
You can leave a message below to let Xiao Meng know!