首页
Web开发
Windows程序
编程语言
数据库
移动开发
系统相关
微信
其他好文
会员
首页
>
系统相关
> 详细
linux内核学习之进程管理------task_struct结构体
时间:
2016-05-31 08:59:16
阅读:
218
评论:
0
收藏:
0
[点我收藏+]
标签:
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结构体
标签:
原文地址:http://www.cnblogs.com/shihaochangeworld/p/5544659.html
踩
(
0
)
赞
(
0
)
举报
评论
一句话评论(
0
)
登录后才能评论!
分享档案
更多>
2021年07月29日 (22)
2021年07月28日 (40)
2021年07月27日 (32)
2021年07月26日 (79)
2021年07月23日 (29)
2021年07月22日 (30)
2021年07月21日 (42)
2021年07月20日 (16)
2021年07月19日 (90)
2021年07月16日 (35)
周排行
更多
gitlab 在linux安装环境下存储地址
2021-07-29
当 Mac 未检测到外部显示器时如何修复它
2021-07-29
Ubuntu18.04安装qemu遇到问题-qemu : Depends: qemu-system (>= 1:2.11+dfsg-1ubuntu7)
2021-07-28
[Linux]Shell编程【待续】
2021-07-28
Linux系统资源查看
2021-07-27
Archlinux爬坑指南
2021-07-27
[Linux]Linux发展历程
2021-07-27
非桌面系统 (ubuntu)安装google-chrome
2021-07-27
在Ubuntu18.04系统中源码安装 gcc7.3.0
2021-07-23
Linux快捷键杂记
2021-07-22
友情链接
兰亭集智
国之画
百度统计
站长统计
阿里云
chrome插件
新版天听网
关于我们
-
联系我们
-
留言反馈
© 2014
mamicode.com
版权所有 联系我们:gaon5@hotmail.com
迷上了代码!