- struct task_struct {
- volatile long state;
- void *stack;
- atomic_t usage;
- unsigned long flags;
- unsigned long ptrace;
- int lock_depth;
- int prio, static_prio, normal_prio;
- struct list_head run_list;
- const struct sched_class *sched_class;
- struct sched_entity se;
- unsigned short ioprio;
- unsigned long policy;
- cpumask_t cpus_allowed;
- unsigned int time_slice;
- #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
- struct sched_info sched_info;
- #endif
- struct list_head tasks;
-
- struct list_head ptrace_children;
- struct list_head ptrace_list;
- struct mm_struct *mm, *active_mm;
- struct linux_binfmt *binfmt;
- long exit_state;
- int exit_code, exit_signal;
- int pdeath_signal;
- unsigned int personality;
- unsigned did_exec:1;
- pid_t pid;
- pid_t tgid;
- struct task_struct *real_parent;
- struct task_struct *parent;
- struct list_head children;
- struct list_head sibling;
- struct task_struct *group_leader;
-
- struct pid_link pids[PIDTYPE_MAX];
- struct list_head thread_group;
- struct completion *vfork_done;
- int __user *set_child_tid;
- int __user *clear_child_tid;
- unsigned long rt_priority;
- cputime_t utime, stime, utimescaled, stimescaled;;
- unsigned long nvcsw, nivcsw;
- struct timespec start_time;
- struct timespec real_start_time;
- unsigned long min_flt, maj_flt;
- cputime_t it_prof_expires, it_virt_expires;
- unsigned long long it_sched_expires;
- struct list_head cpu_timers[3];
- uid_t uid,euid,suid,fsuid;
- gid_t gid,egid,sgid,fsgid;
- struct group_info *group_info;
- kernel_cap_t cap_effective, cap_inheritable, cap_permitted;
- unsigned keep_capabilities:1;
- struct user_struct *user;
- char comm[TASK_COMM_LEN];
- int link_count, total_link_count;
- struct sysv_sem sysvsem;
- struct thread_struct thread;
- struct fs_struct *fs;
- struct files_struct *files;
- struct nsproxy *nsproxy;
- struct signal_struct *signal;
- struct sighand_struct *sighand;
- sigset_t blocked, real_blocked;
- sigset_t saved_sigmask;
- struct sigpending pending;
- unsigned long sas_ss_sp;
- size_t sas_ss_size;
- int (*notifier)(void *priv);
- void *notifier_data;
- sigset_t *notifier_mask;
- #ifdef CONFIG_SECURITY
- v oid *security;
- #endif
- u32 parent_exec_id;
- u32 self_exec_id;
- void *journal_info;
- struct reclaim_state *reclaim_state;
- struct backing_dev_info *backing_dev_info;
- struct io_context *io_context;
- unsigned long ptrace_message;
- siginfo_t *last_siginfo;
- ...
- };
atomic_t usage; 有几个进程正在使用此结构
[Linux]进程(十二)--task_struct结构体
原文:http://www.cnblogs.com/zhiliao112/p/4051378.html