linux内核学习之进程管理------task_struct结构体
- struct task_struct {
- volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
- struct thread_info *thread_info;
- atomic_t usage;
- unsigned long flags; /* per process flags, defined below */
- unsigned long ptrace;
- int lock_depth; /* Lock depth */
- int prio, static_prio;
- struct list_head run_list;
- prio_array_t *array;
- unsigned long sleep_avg;
- long interactive_credit;
- unsigned long long timestamp;
- int activated;
- unsigned long policy;
- cpumask_t cpus_allowed;
- unsigned int time_slice, first_time_slice;
- struct list_head tasks;
- struct list_head ptrace_children;
- struct list_head ptrace_list;
- struct mm_struct *mm, *active_mm;
- /* task state */
- struct linux_binfmt *binfmt;
- int exit_code, exit_signal;
- int pdeath_signal; /* The signal sent when the parent dies */
- /* ??? */
- unsigned long personality;
- int did_exec:1;
- pid_t pid;
- pid_t __pgrp; /* Accessed via process_group() */
- pid_t tty_old_pgrp;
- pid_t session;
- pid_t tgid;
- /* boolean value for session group leader */
- int leader;
- /*
- * pointers to (original) parent process, youngest child, younger sibling,
- * older sibling, respectively. (p->father can be replaced with
- * p->parent->pid)
- */
- struct task_struct *real_parent; /* real parent process (when being debugged) */
- struct task_struct *parent; /* parent process */
- struct list_head children; /* list of my children */
- struct list_head sibling; /* linkage in my parent's children list */
- struct task_struct *group_leader; /* threadgroup leader */
- /* PID/PID hash table linkage. */
- struct pid_link pids[PIDTYPE_MAX];
- wait_queue_head_t wait_chldexit; /* for wait4() */
- struct completion *vfork_done; /* for vfork() */
- int __user *set_child_tid; /* CLONE_CHILD_SETTID */
- int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */
- unsigned long rt_priority;
- unsigned long it_real_value, it_prof_value, it_virt_value;
- unsigned long it_real_incr, it_prof_incr, it_virt_incr;
- struct timer_list real_timer;
- struct list_head posix_timers; /* POSIX.1b Interval Timers */
- unsigned long utime, stime, cutime, cstime;
- unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; /* context switch counts */
- u64 start_time;
- /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
- unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap;
- /* process credentials */
- uid_t uid,euid,suid,fsuid;
- gid_t gid,egid,sgid,fsgid;
- int ngroups;
- gid_t groups[NGROUPS];
- kernel_cap_t cap_effective, cap_inheritable, cap_permitted;
- int keep_capabilities:1;
- struct user_struct *user;
- /* limits */
- struct rlimit rlim[RLIM_NLIMITS];
- unsigned short used_math;
- char comm[16];
- /* file system info */
- int link_count, total_link_count;
- struct tty_struct *tty; /* NULL if no tty */
- /* ipc stuff */
- struct sysv_sem sysvsem;
- /* CPU-specific state of this task */
- struct thread_struct thread;
- /* filesystem information */
- struct fs_struct *fs;
- /* open file information */
- struct files_struct *files;
- /* namespace */
- struct namespace *namespace;
- /* signal handlers */
- struct signal_struct *signal;
- struct sighand_struct *sighand;
- sigset_t blocked, real_blocked;
- struct sigpending pending;
- unsigned long sas_ss_sp;
- size_t sas_ss_size;
- int (*notifier)(void *priv);
- void *notifier_data;
- sigset_t *notifier_mask;
- void *security;
- /* Thread group tracking */
- u32 parent_exec_id;
- u32 self_exec_id;
- /* Protection of (de-)allocation: mm, files, fs, tty */
- spinlock_t alloc_lock;
- /* Protection of proc_dentry: nesting proc_lock, dcache_lock, write_lock_irq(&tasklist_lock); */
- spinlock_t proc_lock;
- /* context-switch lock */
- spinlock_t switch_lock;
- /* journalling filesystem info */
- void *journal_info;
- /* VM state */
- struct reclaim_state *reclaim_state;
- struct dentry *proc_dentry;
- struct backing_dev_info *backing_dev_info;
- struct io_context *io_context;
- unsigned long ptrace_message;
- siginfo_t *last_siginfo; /* For ptrace use. */
- };
linux内核学习之进程管理------task_struct结构体的更多相关文章
- linux内核学习之六 进程创建过程学习
一 关于linux进程概念的补充 关于进程的基本概念这里不多说,把自己的学习所得作一些补充: 1. 在linux内核中,系统最多可以有64个进程同时存在. 2.linux进程包含的关键要素:一段可执行 ...
- Linux系统学习之进程管理
什么是进程? 进程表示程序的一次执行过程,它是应用程序的运行实例,是一个动态的过程.或者可以更简单地描述为:进程是操作系统当前运行的程序.当一个进程开始运行时,就要启动了这个过程.进程包括动态的执行的 ...
- Linux内核学习笔记-2.进程管理
原创文章,转载请注明:Linux内核学习笔记-2.进程管理) By Lucio.Yang 部分内容来自:Linux Kernel Development(Third Edition),Robert L ...
- Linux进程管理之task_struct结构体
进程是处于执行期的程序以及它所管理的资源(如打开的文件.挂起的信号.进程状态.地址空间等等)的总称.注意,程序并不是进程,实际上两个或多个进程不仅有可能执行同一程序,而且还有可能共享地址空间等资源. ...
- Linux进程描述符task_struct结构体详解--Linux进程的管理与调度(一)【转】
Linux内核通过一个被称为进程描述符的task_struct结构体来管理进程,这个结构体包含了一个进程所需的所有信息.它定义在include/linux/sched.h文件中. 谈到task_str ...
- Linux内核学习笔记(1)-- 进程管理概述
一.进程与线程 进程是处于执行期的程序,但是并不仅仅局限于一段可执行程序代码.通常,进程还要包含其他资源,像打开的文件,挂起的信号,内核内部数据,处理器状态,一个或多个具有内存映射的内存地址空间及一个 ...
- Linux内核学习笔记二——进程
Linux内核学习笔记二——进程 一 进程与线程 进程就是处于执行期的程序,包含了独立地址空间,多个执行线程等资源. 线程是进程中活动的对象,每个线程都拥有独立的程序计数器.进程栈和一组进程寄存器 ...
- Linux进程: task_struct结构体成员
一:简介 为了管理进程,内核必须对每个进程所做的事情进行清除的描叙. 比如:内核必须知道进程优先级,他是正在CPU上运行还是因为某些事件被阻塞了,给它分配了什么样的地址空间,允许它访问哪个文件等等.这 ...
- (笔记)Linux内核学习(二)之进程
一 进程与线程 进程就是处于执行期的程序,包含了独立地址空间,多个执行线程等资源. 线程是进程中活动的对象,每个线程都拥有独立的程序计数器.进程栈和一组进程寄存器. 内核调度的对象是线程而不是进程.对 ...
随机推荐
- SVN管理工具Cornerstone之:创建分支、提交合并
创建工程的分支: 步骤: 1.选择左下角仓库repositories中的工程名->选择trunk->点击Branch->在提示框里填写分支名称create, 2.在做上角work ...
- 「30天自制操作系统」 Stop & 「OS67 」 Start
废话 整个十月都没有再写一点什么, 其实没什么好写的, 把书里的东西码出来贴在博客里实在没什么意思, 况且书里已经写得够详细了. 这本书给我最深刻的感觉是, 作者通过简化一些细节, 一步一步地模拟整个 ...
- C语言学习--链表
#include "node.h" #include<stdio.h> #include<stdlib.h> //typedef struct _node ...
- SQL(二) 将一张表数据插入另外一张表
INSERT INTO BaomingRelation ([BaomingID] ,[RelationNumber] ,[UserID] ,[Area]) SELECT BaomingID,NEWID ...
- Facebook 开源 AI 所使用的硬件平台 'Big Sur'
Facebook 开源 AI 所使用的硬件平台 'Big Sur' Facebook 今开源其 AI 所使用的硬件平台 'Big Sur'.'Big Sur' 是兼容开放机架的 GPU 加速硬件平台. ...
- 【转】MTK Android Driver知识大全
原文网址:http://www.cnblogs.com/biglucky/p/4413797.html 一.Display 1.lcm 相关概念1.1) MIPI接口:一共有三种接口:DBI(也做CP ...
- Android Studio 首次安装报错 Java.lang.RuntimeException:java.lang.NullPointerException...错
下次安装报:Java.lang.RuntimeException: java.lang.NullPointerException......错 只需在文件..\Android Studio\bin\i ...
- SpringMVC 自定义拦截资料
1.springmvc学习笔记(28)——自定义拦截器 2.Spring MVC HandlerInterceptor Annotation Example with WebMvcConfigurer ...
- 完整版的OpenLDAP搭建全过程
总结: 先写总结,再写正文,嘿嘿嘿.这还是第一次认真的写个文档,写个总结,哈哈.大概在一个月前,第一次听说这个东西,完全没有概念,刚开始的时候看理论的知识,看了几次之后就没看了,看不 ...
- SCGHR 系统设计
1.表,弄清表的意义,表是系统的核心.