diff options
Diffstat (limited to 'include/linux/sched.h')
| -rw-r--r-- | include/linux/sched.h | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index a781dec1cd0b..825ed838d4b9 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -3,6 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | #include <uapi/linux/sched.h> | 4 | #include <uapi/linux/sched.h> |
| 5 | 5 | ||
| 6 | #include <linux/sched/prio.h> | ||
| 7 | |||
| 6 | 8 | ||
| 7 | struct sched_param { | 9 | struct sched_param { |
| 8 | int sched_priority; | 10 | int sched_priority; |
| @@ -1077,6 +1079,7 @@ struct sched_entity { | |||
| 1077 | #endif | 1079 | #endif |
| 1078 | 1080 | ||
| 1079 | #ifdef CONFIG_FAIR_GROUP_SCHED | 1081 | #ifdef CONFIG_FAIR_GROUP_SCHED |
| 1082 | int depth; | ||
| 1080 | struct sched_entity *parent; | 1083 | struct sched_entity *parent; |
| 1081 | /* rq on which this entity is (to be) queued: */ | 1084 | /* rq on which this entity is (to be) queued: */ |
| 1082 | struct cfs_rq *cfs_rq; | 1085 | struct cfs_rq *cfs_rq; |
| @@ -1460,6 +1463,9 @@ struct task_struct { | |||
| 1460 | struct mutex perf_event_mutex; | 1463 | struct mutex perf_event_mutex; |
| 1461 | struct list_head perf_event_list; | 1464 | struct list_head perf_event_list; |
| 1462 | #endif | 1465 | #endif |
| 1466 | #ifdef CONFIG_DEBUG_PREEMPT | ||
| 1467 | unsigned long preempt_disable_ip; | ||
| 1468 | #endif | ||
| 1463 | #ifdef CONFIG_NUMA | 1469 | #ifdef CONFIG_NUMA |
| 1464 | struct mempolicy *mempolicy; /* Protected by alloc_lock */ | 1470 | struct mempolicy *mempolicy; /* Protected by alloc_lock */ |
| 1465 | short il_next; | 1471 | short il_next; |
| @@ -1470,9 +1476,10 @@ struct task_struct { | |||
| 1470 | unsigned int numa_scan_period; | 1476 | unsigned int numa_scan_period; |
| 1471 | unsigned int numa_scan_period_max; | 1477 | unsigned int numa_scan_period_max; |
| 1472 | int numa_preferred_nid; | 1478 | int numa_preferred_nid; |
| 1473 | int numa_migrate_deferred; | ||
| 1474 | unsigned long numa_migrate_retry; | 1479 | unsigned long numa_migrate_retry; |
| 1475 | u64 node_stamp; /* migration stamp */ | 1480 | u64 node_stamp; /* migration stamp */ |
| 1481 | u64 last_task_numa_placement; | ||
| 1482 | u64 last_sum_exec_runtime; | ||
| 1476 | struct callback_head numa_work; | 1483 | struct callback_head numa_work; |
| 1477 | 1484 | ||
| 1478 | struct list_head numa_entry; | 1485 | struct list_head numa_entry; |
| @@ -1483,15 +1490,22 @@ struct task_struct { | |||
| 1483 | * Scheduling placement decisions are made based on the these counts. | 1490 | * Scheduling placement decisions are made based on the these counts. |
| 1484 | * The values remain static for the duration of a PTE scan | 1491 | * The values remain static for the duration of a PTE scan |
| 1485 | */ | 1492 | */ |
| 1486 | unsigned long *numa_faults; | 1493 | unsigned long *numa_faults_memory; |
| 1487 | unsigned long total_numa_faults; | 1494 | unsigned long total_numa_faults; |
| 1488 | 1495 | ||
| 1489 | /* | 1496 | /* |
| 1490 | * numa_faults_buffer records faults per node during the current | 1497 | * numa_faults_buffer records faults per node during the current |
| 1491 | * scan window. When the scan completes, the counts in numa_faults | 1498 | * scan window. When the scan completes, the counts in |
| 1492 | * decay and these values are copied. | 1499 | * numa_faults_memory decay and these values are copied. |
| 1500 | */ | ||
| 1501 | unsigned long *numa_faults_buffer_memory; | ||
| 1502 | |||
| 1503 | /* | ||
| 1504 | * Track the nodes the process was running on when a NUMA hinting | ||
| 1505 | * fault was incurred. | ||
| 1493 | */ | 1506 | */ |
| 1494 | unsigned long *numa_faults_buffer; | 1507 | unsigned long *numa_faults_cpu; |
| 1508 | unsigned long *numa_faults_buffer_cpu; | ||
| 1495 | 1509 | ||
| 1496 | /* | 1510 | /* |
| 1497 | * numa_faults_locality tracks if faults recorded during the last | 1511 | * numa_faults_locality tracks if faults recorded during the last |
| @@ -1596,8 +1610,8 @@ extern void task_numa_fault(int last_node, int node, int pages, int flags); | |||
| 1596 | extern pid_t task_numa_group_id(struct task_struct *p); | 1610 | extern pid_t task_numa_group_id(struct task_struct *p); |
| 1597 | extern void set_numabalancing_state(bool enabled); | 1611 | extern void set_numabalancing_state(bool enabled); |
| 1598 | extern void task_numa_free(struct task_struct *p); | 1612 | extern void task_numa_free(struct task_struct *p); |
| 1599 | 1613 | extern bool should_numa_migrate_memory(struct task_struct *p, struct page *page, | |
| 1600 | extern unsigned int sysctl_numa_balancing_migrate_deferred; | 1614 | int src_nid, int dst_cpu); |
| 1601 | #else | 1615 | #else |
| 1602 | static inline void task_numa_fault(int last_node, int node, int pages, | 1616 | static inline void task_numa_fault(int last_node, int node, int pages, |
| 1603 | int flags) | 1617 | int flags) |
| @@ -1613,6 +1627,11 @@ static inline void set_numabalancing_state(bool enabled) | |||
| 1613 | static inline void task_numa_free(struct task_struct *p) | 1627 | static inline void task_numa_free(struct task_struct *p) |
| 1614 | { | 1628 | { |
| 1615 | } | 1629 | } |
| 1630 | static inline bool should_numa_migrate_memory(struct task_struct *p, | ||
| 1631 | struct page *page, int src_nid, int dst_cpu) | ||
| 1632 | { | ||
| 1633 | return true; | ||
| 1634 | } | ||
| 1616 | #endif | 1635 | #endif |
| 1617 | 1636 | ||
| 1618 | static inline struct pid *task_pid(struct task_struct *task) | 1637 | static inline struct pid *task_pid(struct task_struct *task) |
| @@ -2080,7 +2099,16 @@ static inline void sched_autogroup_exit(struct signal_struct *sig) { } | |||
| 2080 | extern bool yield_to(struct task_struct *p, bool preempt); | 2099 | extern bool yield_to(struct task_struct *p, bool preempt); |
| 2081 | extern void set_user_nice(struct task_struct *p, long nice); | 2100 | extern void set_user_nice(struct task_struct *p, long nice); |
| 2082 | extern int task_prio(const struct task_struct *p); | 2101 | extern int task_prio(const struct task_struct *p); |
| 2083 | extern int task_nice(const struct task_struct *p); | 2102 | /** |
| 2103 | * task_nice - return the nice value of a given task. | ||
| 2104 | * @p: the task in question. | ||
| 2105 | * | ||
| 2106 | * Return: The nice value [ -20 ... 0 ... 19 ]. | ||
| 2107 | */ | ||
| 2108 | static inline int task_nice(const struct task_struct *p) | ||
| 2109 | { | ||
| 2110 | return PRIO_TO_NICE((p)->static_prio); | ||
| 2111 | } | ||
| 2084 | extern int can_nice(const struct task_struct *p, const int nice); | 2112 | extern int can_nice(const struct task_struct *p, const int nice); |
| 2085 | extern int task_curr(const struct task_struct *p); | 2113 | extern int task_curr(const struct task_struct *p); |
| 2086 | extern int idle_cpu(int cpu); | 2114 | extern int idle_cpu(int cpu); |
