linux内核中与进程相关的数据结构(基于linux3.16-rc4)
1.进程描述符
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;
.......
}
所在文件:include/linux/sched.h
2.线程描述符(current指向该描述符,并通过该描述符找到进程描述符)
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:;
unsigned int uaccess_err:; /* uaccess failed */
};
所在文件:arch/x86/include/asm/thread_info.h
3.进程的内核栈
union thread_union {
struct thread_info thread_info;
unsigned long stack[THREAD_SIZE/sizeof(long)];
}
所在文件:include/linux/sched.h
4.进程的运行队列
struct rt_prio_array {
DECLARE_BITMAP(bitmap, MAX_RT_PRIO+);
struct list_head queue[MAX_RT_PRIO];
}
所在文件:kernel/sched/sched.h
linux内核中与进程相关的数据结构(基于linux3.16-rc4)的更多相关文章
- (笔记)Linux内核中内存相关的操作函数
linux内核中内存相关的操作函数 1.kmalloc()/kfree() static __always_inline void *kmalloc(size_t size, gfp_t flags) ...
- 进程在Linux内核中的角色扮演
在Linux内核中,内核将进程.线程和内核线程一视同仁,即内核使用唯一的数据结构task_struct来分别表示他们:内核使用相同的调度算法对这三者进行调度:并且内核也使用同一个函数do_fork() ...
- Linux内核中的算法和数据结构
算法和数据结构纷繁复杂,但是对于Linux Kernel开发人员来说重点了解Linux内核中使用到的算法和数据结构很有必要. 在一个国外问答平台stackexchange.com的Theoretica ...
- Linux内核中常用的数据结构和算法(转)
知乎链接:https://zhuanlan.zhihu.com/p/58087261 Linux内核代码中广泛使用了数据结构和算法,其中最常用的两个是链表和红黑树. 链表 Linux内核代码大量使用了 ...
- Linux内核中进程上下文、中断上下文、原子上下文、用户上下文的理解【转】
转自:http://blog.csdn.net/laoliu_lcl/article/details/39972459 进程上下文和中断上下文是操作系统中很重要的两个概念,这两个概念在操作系统课程中不 ...
- 对Linux内核中进程上下文和中断上下文的理解
内核空间和用户空间是操作系统理论的基础之一,即内核功能模块运行在内核空间,而应用程序运行在用户空间.现代的CPU都具有不同的操作模式,代表不同的 级别,不同的级别具有不同的功能,在较低的级别中将禁止某 ...
- Linux内核中进程上下文和中断上下文的理解
參考: http://www.embedu.org/Column/Column240.htm http://www.cnblogs.com/Anker/p/3269106.html 首先明白一个概念: ...
- 【转载】linux内核笔记之进程地址空间
原文:linux内核笔记之进程地址空间 进程的地址空间由允许进程使用的全部线性地址组成,在32位系统中为0~3GB,每个进程看到的线性地址集合是不同的. 内核通过线性区的资源(数据结构)来表示线性地址 ...
- KSM剖析——Linux 内核中的内存去耦合
简介: 作为一个系统管理程序(hypervisor),Linux® 有几个创新,2.6.32 内核中一个有趣的变化是 KSM(Kernel Samepage Merging) 允许这个系统管理程序通 ...
随机推荐
- WPF 位置转化和动画
位置转化 private void DrawScale() { double majorTickUnitValue = this.ScaleSweepLenth / this.MajorDivisio ...
- uva 165
回溯 参考了一下别人的解法 1 必须存在 再枚举下一个数字的时候 从当前可取到的最小数字加一枚举到当前可取到的最大数字加一 /********************************* ...
- Connect to the mysql dataase from remote server
Make sure that the firewall is closed!!!!!!!!! shell command should be like is: mysql -u username -p ...
- memmove 和 memcpy的区别
memcpy和memmove()都是C语言中的库函数,在头文件string.h中,作用是拷贝一定长度的内存的内容,原型分别如下:void *memcpy(void *dst, const void * ...
- Java Code Examples for org.springframework.http.HttpStatus
http://www.programcreek.com/java-api-examples/index.php?api=org.springframework.http.HttpStatus
- hbase集群 常用维护命令
一. zk集群 1. 查看当前服务的角色 leader/follower echo stat|nc 127.0.0.1 2181 2. 启动ZK服务: sh bin/zkServer.sh star ...
- mysql 查询重复值命令
积累备忘啊: ; 从t_maintenanceinfo表查询重复记录的mtiId 和ip字段,以及重复条数
- 64位ubuntu安装WPS
http://jingyan.baidu.com/article/d3b74d64afd96f1f77e609a3.html http://sixipiaoyang.blog.163.com/blog ...
- Java API ——String类
1.String类概述 · 字符串是由多个字符组成的一串数据(字符序列),也可以看成是一个字符数组. · 字符串字符值“abc”也可以看成是一个字符串对象. · 字符串是常量,一旦被赋值,就不能被改变 ...
- android 电容屏(二):驱动调试之基本概念篇
平台信息: 内核:linux3.4.39系统:android4.4 平台:S5P4418(cortex a9) 作者:瘋耔(欢迎转载,请注明作者) 欢迎指正错误,共同学习.共同进步!! 关注博主新浪博 ...