source:task_struct
1224 struct task_struct {
1225 volatile long state;
1226 void *stack;
1227 atomic_t usage;
1228 unsigned int flags;
1229 unsigned int ptrace;
1231#ifdef CONFIG_SMP
1232 struct llist_node wake_entry;
1233 int on_cpu;
1234 struct task_struct *last_wakee;
1235 unsigned long wakee_flips;
1236 unsigned long wakee_flip_decay_ts;
1238 int wake_cpu;
1239 #endif
1240 int on_rq;
1242 int prio, static_prio, normal_prio;
1243 unsigned int rt_priority;
1244 const struct sched_class *sched_class;
1245 struct sched_entity se;
1246 struct sched_rt_entity rt;
1247 #ifdef CONFIG_CGROUP_SCHED
1248 struct task_group *sched_task_group;
1249 #endif
1250 struct sched_dl_entity dl;
1251
1252 #ifdef CONFIG_PREEMPT_NOTIFIERS
1254 struct hlist_head preempt_notifiers;
1255 #endif
1256
1257 #ifdef CONFIG_BLK_DEV_IO_TRACE
1258 unsigned int btrace_seq;
1259 #endif
1260
1261 unsigned int policy;
1262 int nr_cpus_allowed;
1263 cpumask_t cpus_allowed;
1265 #ifdef CONFIG_PREEMPT_RCU
1266 int rcu_read_lock_nesting;
1267 char rcu_read_unlock_special;
1268 struct list_head rcu_node_entry;
1269 #endif
1270 #ifdef CONFIG_TREE_PREEMPT_RCU
1271 struct rcu_node *rcu_blocked_node;
1272 #endif
1273 #ifdef CONFIG_RCU_BOOST
1274 struct rt_mutex *rcu_boost_mutex;
1275 #endif
1277 #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
1278 struct sched_info sched_info;
1279 #endif
1281 struct list_head tasks;
1282 #ifdef CONFIG_SMP
1283 struct plist_node pushable_tasks;
1284 struct rb_node pushable_dl_tasks;
1285 #endif
1287 struct mm_struct *mm, *active_mm;
1288 #ifdef CONFIG_COMPAT_BRK
1289 unsigned brk_randomized:1;
1290 #endif
1291
1292 u32 vmacache_seqnum;
1293 struct vm_area_struct *vmacache[VMACACHE_SIZE];
1294 #if defined(SPLIT_RSS_COUNTING)
1295 struct task_rss_stat rss_stat;
1296 #endif
1297
1298 int exit_state;
1299 int exit_code, exit_signal;
1300 int pdeath_signal;
1301 unsigned int jobctl;
1303
1304 unsigned int personality;
1306 unsigned in_execve:1;
1308 unsigned in_iowait:1;
1310
1311 unsigned no_new_privs:1;
1313
1314 unsigned sched_reset_on_fork:1;
1315 unsigned sched_contributes_to_load:1;
1317 pid_t pid;
1318 pid_t tgid;
1320 #ifdef CONFIG_CC_STACKPROTECTOR
1321
1322 unsigned long stack_canary;
1323 #endif
1324
1329 struct task_struct __rcu *real_parent;
1330 struct task_struct __rcu *parent;
1331
1334 struct list_head children;
1335 struct list_head sibling;
1336 struct task_struct *group_leader;
1343 struct list_head ptraced;
1344 struct list_head ptrace_entry;
1347 struct pid_link pids[PIDTYPE_MAX];
1348 struct list_head thread_group;
1349 struct list_head thread_node;
1351 struct completion *vfork_done;
1352 int __user *set_child_tid;
1353 int __user *clear_child_tid;
1355 cputime_t utime, stime, utimescaled, stimescaled;
1356 cputime_t gtime;
1357 #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
1358 struct cputime prev_cputime;
1359 #endif
1360 #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
1361 seqlock_t vtime_seqlock;
1362 unsigned long long vtime_snap;
1363 enum {
1364 VTIME_SLEEPING = 0,
1365 VTIME_USER,
1366 VTIME_SYS,
1367 } vtime_snap_whence;
1368 #endif
1369 unsigned long nvcsw, nivcsw;
1370 struct timespec start_time;
1371 struct timespec real_start_time;
1372
1373 unsigned long min_flt, maj_flt;
1375 struct task_cputime cputime_expires;
1376 struct list_head cpu_timers[3];
1378
1379 const struct cred __rcu *real_cred;
1381 const struct cred __rcu *cred;
1383 char comm[TASK_COMM_LEN];
1387
1388 int link_count, total_link_count;
1389 #ifdef CONFIG_SYSVIPC
1390
1391 struct sysv_sem sysvsem;
1392 #endif
1393 #ifdef CONFIG_DETECT_HUNG_TASK
1394
1395 unsigned long last_switch_count;
1396 #endif
1398 struct thread_struct thread;
1399
1400 struct fs_struct *fs;
1402 struct files_struct *files;
1403
1404 struct nsproxy *nsproxy;
1405
1406 struct signal_struct *signal;
1407 struct sighand_struct *sighand;
1409 sigset_t blocked, real_blocked;
1410 sigset_t saved_sigmask;
1411 struct sigpending pending;
1413 unsigned long sas_ss_sp;
1414 size_t sas_ss_size;
1415 int (*notifier)(void *priv);1416 void *notifier_data;
1417 sigset_t *notifier_mask;
1418 struct callback_head *task_works;
1420 struct audit_context *audit_context;
1421 #ifdef CONFIG_AUDITSYSCALL
1422 kuid_t loginuid;
1423 unsigned int sessionid;
1424 #endif1425 struct seccomp seccomp;
1427
1428 u32 parent_exec_id;
1429 u32 self_exec_id;
1430
1432 spinlock_t alloc_lock;
1434
1435 raw_spinlock_t pi_lock;
1437 #ifdef CONFIG_RT_MUTEXES
1438
1439 struct rb_root pi_waiters;
1440 struct rb_node *pi_waiters_leftmost;
1441
1442 struct rt_mutex_waiter *pi_blocked_on;
1443
1444 struct task_struct *pi_top_task;
1445 #endif
1447 #ifdef CONFIG_DEBUG_MUTEXES
1448
1449 struct mutex_waiter *blocked_on;
1450 #endif
1451 #ifdef CONFIG_TRACE_IRQFLAGS
1452 unsigned int irq_events;
1453 unsigned long hardirq_enable_ip;
1454 unsigned long hardirq_disable_ip;
1455 unsigned int hardirq_enable_event;
1456 unsigned int hardirq_disable_event;
1457 int hardirqs_enabled;
1458 int hardirq_context;
1459 unsigned long softirq_disable_ip;
1460 unsigned long softirq_enable_ip;
1461 unsigned int softirq_disable_event;
1462 unsigned int softirq_enable_event;
1463 int softirqs_enabled;
1464 int softirq_context;
1465 #endif
1466 #ifdef CONFIG_LOCKDEP
1467 # define MAX_LOCK_DEPTH 48UL
1468 u64 curr_chain_key;
1469 int lockdep_depth;
1470 unsigned int lockdep_recursion;
1471 struct held_lock held_locks[MAX_LOCK_DEPTH];
1472 gfp_t lockdep_reclaim_gfp;
1473 #endif
1475
1476 void *journal_info;
1478
1479 struct bio_list *bio_list;
1481 #ifdef CONFIG_BLOCK
1482
1483 struct blk_plug *plug;
1484 #endif
1486
1487 struct reclaim_state *reclaim_state;
1489 struct backing_dev_info *backing_dev_info;
1491 struct io_context *io_context;
1493 unsigned long ptrace_message;
1494 siginfo_t *last_siginfo;
1495 struct task_io_accounting ioac;
1496 #if defined(CONFIG_TASK_XACCT)
1497 u64 acct_rss_mem1;
1498 u64 acct_vm_mem1;
1499 cputime_t acct_timexpd;
1500 #endif
1501 #ifdef CONFIG_CPUSETS
1502 nodemask_t mems_allowed;
1503 seqcount_t mems_allowed_seq;
1504 int cpuset_mem_spread_rotor;
1505 int cpuset_slab_spread_rotor;
1506 #endif
1507 #ifdef CONFIG_CGROUPS
1508
1509 struct css_set __rcu *cgroups;
1510
1511 struct list_head cg_list;
1512 #endif
1513 #ifdef CONFIG_FUTEX
1514 struct robust_list_head __user *robust_list;
1515 #ifdef CONFIG_COMPAT
1516 struct compat_robust_list_head __user *compat_robust_list;
1517 #endif
1518 struct list_head pi_state_list;
1519 struct futex_pi_state *pi_state_cache;
1520 #endif
1521 #ifdef CONFIG_PERF_EVENTS
1522 struct perf_event_context *perf_event_ctxp[perf_nr_task_contexts];
1523 struct mutex perf_event_mutex;
1524 struct list_head perf_event_list;
1525 #endif
1526 #ifdef CONFIG_DEBUG_PREEMPT
1527 unsigned long preempt_disable_ip;
1528 #endif
1529 #ifdef CONFIG_NUMA
1530 struct mempolicy *mempolicy;
1531 short il_next;
1532 short pref_node_fork;
1533 #endif
1534 #ifdef CONFIG_NUMA_BALANCING(configure NUMA balancing)配置非一致性記憶體存取平衡
1535 int numa_scan_seq;
1536 unsigned int numa_scan_period;
1537 unsigned int numa_scan_period_max;
1538 int numa_preferred_nid;
1539 unsigned long numa_migrate_retry;
1540 u64 node_stamp;
1541 u64 last_task_numa_placement;
1542 u64 last_sum_exec_runtime;
1543 struct callback_head numa_work;
1545 struct list_head numa_entry;
1546 struct numa_group *numa_group;
1549
1553 unsigned long *numa_faults_memory;
1554 unsigned long total_numa_faults;
1556
1561 unsigned long *numa_faults_buffer_memory;
1563
1567 unsigned long *numa_faults_cpu;
1568 unsigned long *numa_faults_buffer_cpu;
1570
1576 unsigned long numa_faults_locality[2];
1578 unsigned long numa_pages_migrated;
1579 #endif
1581 struct rcu_head rcu;
1583
1586 struct pipe_inode_info *splice_pipe;
1588 struct page_frag task_frag;
1590 #ifdef CONFIG_TASK_DELAY_ACCT
1591 struct task_delay_info *delays;
1592 #endif
1593 #ifdef CONFIG_FAULT_INJECTION
1594 int make_it_fail;
1595 #endif
1596
1600 int nr_dirtied;
1601 int nr_dirtied_pause;
1602 unsigned long dirty_paused_when;
1604 #ifdef CONFIG_LATENCYTOP
1605 int latency_record_count;
1606 struct latency_record latency_record[LT_SAVECOUNT];
1607 #endif
1608
1612 unsigned long timer_slack_ns;
1613 unsigned long default_timer_slack_ns;
1615 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
1616
1617 int curr_ret_stack;
1618
1619 struct ftrace_ret_stack *ret_stack;
1620
1621 unsigned long long ftrace_timestamp;
1622
1626 atomic_t trace_overrun;
1627
1628 atomic_t tracing_graph_pause;
1629 #endif
1630 #ifdef CONFIG_TRACING
1631
1632 unsigned long trace;
1633
1634 unsigned long trace_recursion;
1635 #endif
1636 #ifdef CONFIG_MEMCG
1637 struct memcg_batch_info {
1638 int do_batch;
1639 struct mem_cgroup *memcg;
1640 unsigned long nr_pages;
1641 unsigned long memsw_nr_pages;
1642 } memcg_batch;
1643 unsigned int memcg_kmem_skip_account;
1644 struct memcg_oom_info {
1645 struct mem_cgroup *memcg;
1646 gfp_t gfp_mask;
1647 int order;
1648 unsigned int may_oom:1;
1649 } memcg_oom;
1650 #endif
1651 #ifdef CONFIG_UPROBES
1652 struct uprobe_task *utask;
1653 #endif
1654 #if defined(CONFIG_BCACHE) || defined(CONFIG_BCACHE_MODULE)
1655 unsigned int sequential_io;
1656 unsigned int sequential_io_avg;
1657 #endif
1658 };
沒有留言:
張貼留言