linux内核中与进程相关的数据结构(基于linux3.16-rc4)

王朝学院·作者佚名  2016-05-27
窄屏简体版  字體: 小  |  中  |  大  |  超大  

linux内核中与进程相关的数据结构(基于linux3.16-rc4)1.进程描述符

1 struct task_struct { 2 3 volatile long state; 4 5 ....... 6 7 struct list_head tasks; 8 9 .......10 11 struct mm_struct *mm, *active_mm;12 13 .......14 15 struct vm_area_struct *vmacache[VMACACHE_SIZE];16 17 ......18 19 pid_t pid;20 pid_t tgid;21 22 .......23 }

所在文件:include/linux/sched.h

2.线程描述符(current指向该描述符,并通过该描述符找到进程描述符)

1 struct thread_info { 2 struct task_struct *task; /* main task structure */ 3 struct2. exec_domain *exec_domain; /* execution domain */ 4 __u32 flags; /* low level flags */ 5 __u32 status; /* thread synchronous flags */ 6 __u32 cpu; /* current CPU */ 7 int saved_PReempt_count; 8 mm_segment_t addr_limit; 9 struct restart_block restart_block;10 void __user *sysenter_return;11 unsigned int sig_on_uaccess_error:1;12 unsigned int uaccess_err:1; /* uaccess failed */13 };

所在文件:arch/x86/include/asm/thread_info.h

3.进程的内核栈

1 union thread_union {2 3 struct thread_info thread_info;4 5 unsigned long stack[THREAD_SIZE/sizeof(long)];6 7 }

所在文件:include/linux/sched.h

4.进程的运行队列

1 struct rt_prio_array { 2 3 DECLARE_BITMAP(bitmap, MAX_RT_PRIO+1);4 5 struct list_head queue[MAX_RT_PRIO];6 7 }

所在文件:kernel/sched/sched.h

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有 導航