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) 允许这个系统管理程序通 ...
随机推荐
- 【数位DP】bzoj1026: [SCOI2009]windy数
1026: [SCOI2009]windy数 Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 4163 Solved: 1864[Submit][Sta ...
- uva 11143
#include<cstdio> #include<cstring> #include<algorithm> #define maxn 5100 #include& ...
- spoj 379
题是水题 但丫的题目意思太难懂 ....... 英语水平 ...... #include <cstdio> #include <cstring> #include &l ...
- zoj 2387
额 一个贪心 好难想到 ...... #include <cstring> #include <cstdio> #include <algorithm> #in ...
- ***SQL统计语句总结(运用场景:运营分析,财务分析等)
-- 统计三月的每天的数据量 ,) ,) ; --统计从5月19到6月29的数据量 , ) AS '日期', count(*) AS '医说数' FROM xm_feed a WHERE a.feed ...
- HDU4548+素数
简单题. /* */ #include<stdio.h> #include<string.h> #include<stdlib.h> #include<alg ...
- maven3常用命令\创建Project
转自 http://blog.csdn.net/edward0830ly/article/details/8748986 ------------------------------maven3常用命 ...
- C++ 通过对象方式 、指针方式两种方式去访问成员变量(属性或者方法)
准备 1.在VS中新建一个项目-Viscal C++ ---常规--空项目 2.建立一个.h的头文件 定义一个类 声明其成员(C#中的属性和方法) #include<iostream> # ...
- Ubuntu 12.04安装字体
http://www.2cto.com/os/201210/160645.html 安装方法,终端输入: $ sudo thunar /usr/share/fonts/truetype 待ture ...
- ANDROID_MARS学习笔记_S01_005CheckBox
一. 1.checkbox_layout.xml <?xml version="1.0" encoding="utf-8"?> <Linear ...