Linuxプロセス制御ブロックのデータ構造task_structの主な情報
4151 ワード
struct task_struct
{
// ,
volatile long state;
//Flage , fork()
unsigned long flags;
//
int sigpending;
// ,
mm_segment_t addr_limit; //0-0xBFFFFFFF for user-thead
//0-0xFFFFFFFF for kernel-thread
// , , 0, ,
volatile long need_resched;
//
int lock_depth;
//
long nice;
// , , :SCHED_FIFO,SCHED_RR, :SCHED_OTHER
unsigned long policy;
//
struct mm_struct *mm;
int processor;
// CPU , cpus_runnable 0, 1
unsigned long cpus_runnable, cpus_allowed;
//
struct list_head run_list;
//
unsigned long sleep_time;
// , init_task
struct task_struct *next_task, *prev_task;
struct mm_struct *active_mm;
struct list_head local_pages; //
unsigned int allocation_order, nr_local_pages;
struct linux_binfmt *binfmt; //
int exit_code, exit_signal;
int pdeath_signal; //
unsigned long personality;
//Linux UNIX iBCS2
int did_exec:1;
pid_t pid; // ,
pid_t pgrp; // ,
pid_t tty_old_pgrp; //
pid_t session; //
pid_t tgid;
int leader; //
struct task_struct *p_opptr,*p_pptr,*p_cptr,*p_ysptr,*p_osptr;
struct list_head thread_group; //
struct task_struct *pidhash_next; // HASH
struct task_struct **pidhash_pprev;
wait_queue_head_t wait_chldexit; // wait4()
struct completion *vfork_done; // vfork()
unsigned long rt_priority; // , weight
//it_real_value,it_real_incr REAL , jiffies, it_real_value
// . , SIGALRM ,
//it_real_incr ,it_prof_value,it_prof_incr Profile , jiffies。
// , , tick it_prof_value , 0 ,
// SIGPROF, it_prof_incr .
//it_virt_value,it_virt_value Virtual , jiffies。 ,
// , tick it_virt_value 0 , SIGVTALRM,
//it_virt_incr 。
unsigned long it_real_value, it_prof_value, it_virt_value;
unsigned long it_real_incr, it_prof_incr, it_virt_value;
struct timer_list real_timer; //
struct tms times; //
unsigned long start_time; //
// CPU
long per_cpu_utime[NR_CPUS], per_cpu_stime[NR_CPUS];
// :
//min_flt, maj_flt (Copy on Write ) (
// ); nswap , 。
//cmin_flt, cmaj_flt, cnswap , 。
// ,
unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap;
int swappable:1; //
//
//uid,gid , uid,gid
//euid,egid uid,gid
//fsuid,fsgid uid,gid, ID uid,gid ,
// 。
//suid,sgid uid,gid
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;
struct rlimit rlim[RLIM_NLIMITS]; //
unsigned short used_math; // FPU
char comm[16]; //
//
int link_count, total_link_count;
//NULL if no tty , ,
struct tty_struct *tty;
unsigned int locks;
//
struct sem_undo *semundo; // undo
struct sem_queue *semsleeping; // ,
// CPU , , task_struct
struct thread_struct thread;
//
struct fs_struct *fs;
//
struct files_struct *files;
//
spinlock_t sigmask_lock;
struct signal_struct *sig; //
sigset_t 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;
u32 parent_exec_id;
u32 self_exec_id;
spinlock_t alloc_lock;
void *journal_info;
};