1. Process Descriptor
struct Task_struct {
volatile long state;
.......
struct List_head tasks;
.......
struct mm_struct *mm, *active_mm;
.......
struct vm_area_struct *vmacache[vmacache_size];
......
pid_t pid;
pid_t Tgid;
.......
}
File: Include/linux/sched.h
2. The thread descriptor (current points to the descriptor, and the process descriptor is found by this descriptor)
struct Thread_info {
struct Task_struct *task; /* Main task structure */
Struct2. Exec_domain *exec_domain; /* Execution Domain */
__U32 flags; /* Low Level flags */
__U32 status; /* Thread Synchronous Flags */
__U32 CPU; /* Current CPU */
int saved_preempt_count;
mm_segment_t Addr_limit;
struct Restart_block restart_block;
void __user *sysenter_return;
unsigned int sig_on_uaccess_error:1;
unsigned int uaccess_err:1; /* Uaccess failed */
};
File: arch/x86/include/asm/thread_info.h
3. Kernel stack of the process
Union thread_union {
struct Thread_info thread_info;
unsigned long stack[thread_size/sizeof (long)];
}
File: Include/linux/sched.h
4. Running queue for a process
struct Rt_prio_array {
Declare_bitmap (BITMAP, max_rt_prio+1);
struct List_head Queue[max_rt_prio];
}
File: Kernel/sched/sched.h