Process Control blocks and task_struct

Source: Internet
Author: User

http://blog.csdn.net/qq_26768741/article/details/54348586

  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) The parent process, youngest child, younger sibling,
  38. * older sibling, respectively. (P->father can 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. };

Process Control blocks and task_struct

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.