1. struct task_struct {
  2. volatile long state;    /* -1 unrunnable, 0 runnable, >0 stopped */
  3. struct thread_info *thread_info;
  4. atomic_t usage;
  5. unsigned long flags;    /* per process flags, defined below */
  6. unsigned long ptrace;
  7. int lock_depth;     /* Lock depth */
  8. int prio, static_prio;
  9. struct list_head run_list;
  10. prio_array_t *array;
  11. unsigned long sleep_avg;
  12. long interactive_credit;
  13. unsigned long long timestamp;
  14. int activated;
  15. unsigned long policy;
  16. cpumask_t cpus_allowed;
  17. unsigned int time_slice, first_time_slice;
  18. struct list_head tasks;
  19. struct list_head ptrace_children;
  20. struct list_head ptrace_list;
  21. struct mm_struct *mm, *active_mm;
  22. /* task state */
  23. struct linux_binfmt *binfmt;
  24. int exit_code, exit_signal;
  25. int pdeath_signal;  /*  The signal sent when the parent dies  */
  26. /* ??? */
  27. unsigned long personality;
  28. int did_exec:1;
  29. pid_t pid;
  30. pid_t __pgrp;       /* Accessed via process_group() */
  31. pid_t tty_old_pgrp;
  32. pid_t session;
  33. pid_t tgid;
  34. /* boolean value for session group leader */
  35. int leader;
  36. /*
  37. * pointers to (original) parent process, youngest child, younger sibling,
  38. * older sibling, respectively.  (p->father can be replaced with
  39. * p->parent->pid)
  40. */
  41. struct task_struct *real_parent; /* real parent process (when being debugged) */
  42. struct task_struct *parent; /* parent process */
  43. struct list_head children;  /* list of my children */
  44. struct list_head sibling;   /* linkage in my parent's children list */
  45. struct task_struct *group_leader;   /* threadgroup leader */
  46. /* PID/PID hash table linkage. */
  47. struct pid_link pids[PIDTYPE_MAX];
  48. wait_queue_head_t wait_chldexit;    /* for wait4() */
  49. struct completion *vfork_done;      /* for vfork() */
  50. int __user *set_child_tid;      /* CLONE_CHILD_SETTID */
  51. int __user *clear_child_tid;        /* CLONE_CHILD_CLEARTID */
  52. unsigned long rt_priority;
  53. unsigned long it_real_value, it_prof_value, it_virt_value;
  54. unsigned long it_real_incr, it_prof_incr, it_virt_incr;
  55. struct timer_list real_timer;
  56. struct list_head posix_timers; /* POSIX.1b Interval Timers */
  57. unsigned long utime, stime, cutime, cstime;
  58. unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; /* context switch counts */
  59. u64 start_time;
  60. /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
  61. unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap;
  62. /* process credentials */
  63. uid_t uid,euid,suid,fsuid;
  64. gid_t gid,egid,sgid,fsgid;
  65. int ngroups;
  66. gid_t   groups[NGROUPS];
  67. kernel_cap_t   cap_effective, cap_inheritable, cap_permitted;
  68. int keep_capabilities:1;
  69. struct user_struct *user;
  70. /* limits */
  71. struct rlimit rlim[RLIM_NLIMITS];
  72. unsigned short used_math;
  73. char comm[16];
  74. /* file system info */
  75. int link_count, total_link_count;
  76. struct tty_struct *tty; /* NULL if no tty */
  77. /* ipc stuff */
  78. struct sysv_sem sysvsem;
  79. /* CPU-specific state of this task */
  80. struct thread_struct thread;
  81. /* filesystem information */
  82. struct fs_struct *fs;
  83. /* open file information */
  84. struct files_struct *files;
  85. /* namespace */
  86. struct namespace *namespace;
  87. /* signal handlers */
  88. struct signal_struct *signal;
  89. struct sighand_struct *sighand;
  90. sigset_t blocked, real_blocked;
  91. struct sigpending pending;
  92. unsigned long sas_ss_sp;
  93. size_t sas_ss_size;
  94. int (*notifier)(void *priv);
  95. void *notifier_data;
  96. sigset_t *notifier_mask;
  97. void *security;
  98. /* Thread group tracking */
  99. u32 parent_exec_id;
  100. u32 self_exec_id;
  101. /* Protection of (de-)allocation: mm, files, fs, tty */
  102. spinlock_t alloc_lock;
  103. /* Protection of proc_dentry: nesting proc_lock, dcache_lock, write_lock_irq(&tasklist_lock); */
  104. spinlock_t proc_lock;
  105. /* context-switch lock */
  106. spinlock_t switch_lock;
  107. /* journalling filesystem info */
  108. void *journal_info;
  109. /* VM state */
  110. struct reclaim_state *reclaim_state;
  111. struct dentry *proc_dentry;
  112. struct backing_dev_info *backing_dev_info;
  113. struct io_context *io_context;
  114. unsigned long ptrace_message;
  115. siginfo_t *last_siginfo; /* For ptrace use.  */
  116. };

linux内核学习之进程管理------task_struct结构体的更多相关文章

  1. linux内核学习之六 进程创建过程学习

    一 关于linux进程概念的补充 关于进程的基本概念这里不多说,把自己的学习所得作一些补充: 1. 在linux内核中,系统最多可以有64个进程同时存在. 2.linux进程包含的关键要素:一段可执行 ...

  2. Linux系统学习之进程管理

    什么是进程? 进程表示程序的一次执行过程,它是应用程序的运行实例,是一个动态的过程.或者可以更简单地描述为:进程是操作系统当前运行的程序.当一个进程开始运行时,就要启动了这个过程.进程包括动态的执行的 ...

  3. Linux内核学习笔记-2.进程管理

    原创文章,转载请注明:Linux内核学习笔记-2.进程管理) By Lucio.Yang 部分内容来自:Linux Kernel Development(Third Edition),Robert L ...

  4. Linux进程管理之task_struct结构体

    进程是处于执行期的程序以及它所管理的资源(如打开的文件.挂起的信号.进程状态.地址空间等等)的总称.注意,程序并不是进程,实际上两个或多个进程不仅有可能执行同一程序,而且还有可能共享地址空间等资源. ...

  5. Linux进程描述符task_struct结构体详解--Linux进程的管理与调度(一)【转】

    Linux内核通过一个被称为进程描述符的task_struct结构体来管理进程,这个结构体包含了一个进程所需的所有信息.它定义在include/linux/sched.h文件中. 谈到task_str ...

  6. Linux内核学习笔记(1)-- 进程管理概述

    一.进程与线程 进程是处于执行期的程序,但是并不仅仅局限于一段可执行程序代码.通常,进程还要包含其他资源,像打开的文件,挂起的信号,内核内部数据,处理器状态,一个或多个具有内存映射的内存地址空间及一个 ...

  7. Linux内核学习笔记二——进程

    Linux内核学习笔记二——进程   一 进程与线程 进程就是处于执行期的程序,包含了独立地址空间,多个执行线程等资源. 线程是进程中活动的对象,每个线程都拥有独立的程序计数器.进程栈和一组进程寄存器 ...

  8. Linux进程: task_struct结构体成员

    一:简介 为了管理进程,内核必须对每个进程所做的事情进行清除的描叙. 比如:内核必须知道进程优先级,他是正在CPU上运行还是因为某些事件被阻塞了,给它分配了什么样的地址空间,允许它访问哪个文件等等.这 ...

  9. (笔记)Linux内核学习(二)之进程

    一 进程与线程 进程就是处于执行期的程序,包含了独立地址空间,多个执行线程等资源. 线程是进程中活动的对象,每个线程都拥有独立的程序计数器.进程栈和一组进程寄存器. 内核调度的对象是线程而不是进程.对 ...

随机推荐

  1. Android HttpClient POST JSON Restful-web-services

    @Override protected String doInBackground(String... arg0) { Gson gson = new Gson(); String json = gs ...

  2. 7816的报文结构APDU

    命令APDU 包括头和主体(这可以在上面的图中看到).头包括CLA,INS,P1 和P2 域.同T0 协议一样,CLA 和INS 说明了应用的分类和指令.P1 和P2 用来详细说明具体指令,并由每一条 ...

  3. HDFS基础和java api操作

    1. 概括 适合一次写入多次查询情况,不支持并发写情况 通过hadoop shell 上传的文件存放在DataNode的block中,通过linux shell只能看见block,看不见文件(HDFS ...

  4. 怎样在WIN7系统下安装IIS

    http://jingyan.baidu.com/article/19192ad853224ce53f570748.html

  5. Delphi7 THTTPRIO 控件设置超时

    HTTPRIOLeExp.HTTPWebNode.SendTimeout := 100000;  //发射  HTTPRIOLeExp.HTTPWebNode.ConnectTimeout := 10 ...

  6. 9. memcpy() memccpy() memmove() strcpy() memset()

    部分参考: http://www.cppblog.com/kang/archive/2009/04/05/78984.html 表头文件: #include <string.h>定义函数: ...

  7. HDOJ 1097 A hard puzzle(循环问题)

    Problem Description lcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how ...

  8. Java中Timer的用法--转载之网络

    用法很简单,new一个timer,然后写一个timertask的子类即可. import java.util.Timer; import java.util.TimerTask; public cla ...

  9. Jenkins配置Java项目1(Java+Maven+Tomcat)

    先收集几个网址,后续再自己动手过一遍 http://www.cnblogs.com/sunzhenchao/archive/2013/01/30/2883289.html https://my.osc ...

  10. 一个超级简单的node.js爬虫(内附表情包)

    之所以会想到要写爬虫,并不是出于什么高大上的理由,仅仅是为了下载个表情包而已-- 容我先推荐一下西乔出品的神秘的程序员表情包. 这套表情包着实是抵御产品.对付测试.嘲讽队友.恐吓前任的良品, 不过不知 ...