diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/hardirq.h | 9 | ||||
-rw-r--r-- | include/linux/sched.h | 23 | ||||
-rw-r--r-- | include/linux/topology.h | 6 |
3 files changed, 32 insertions, 6 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 1f4517d55b1..96c323ac44d 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -64,6 +64,8 @@ | |||
64 | #define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT) | 64 | #define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT) |
65 | #define NMI_OFFSET (1UL << NMI_SHIFT) | 65 | #define NMI_OFFSET (1UL << NMI_SHIFT) |
66 | 66 | ||
67 | #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET) | ||
68 | |||
67 | #ifndef PREEMPT_ACTIVE | 69 | #ifndef PREEMPT_ACTIVE |
68 | #define PREEMPT_ACTIVE_BITS 1 | 70 | #define PREEMPT_ACTIVE_BITS 1 |
69 | #define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS) | 71 | #define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS) |
@@ -82,10 +84,13 @@ | |||
82 | /* | 84 | /* |
83 | * Are we doing bottom half or hardware interrupt processing? | 85 | * Are we doing bottom half or hardware interrupt processing? |
84 | * Are we in a softirq context? Interrupt context? | 86 | * Are we in a softirq context? Interrupt context? |
87 | * in_softirq - Are we currently processing softirq or have bh disabled? | ||
88 | * in_serving_softirq - Are we currently processing softirq? | ||
85 | */ | 89 | */ |
86 | #define in_irq() (hardirq_count()) | 90 | #define in_irq() (hardirq_count()) |
87 | #define in_softirq() (softirq_count()) | 91 | #define in_softirq() (softirq_count()) |
88 | #define in_interrupt() (irq_count()) | 92 | #define in_interrupt() (irq_count()) |
93 | #define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET) | ||
89 | 94 | ||
90 | /* | 95 | /* |
91 | * Are we in NMI context? | 96 | * Are we in NMI context? |
@@ -132,10 +137,12 @@ extern void synchronize_irq(unsigned int irq); | |||
132 | 137 | ||
133 | struct task_struct; | 138 | struct task_struct; |
134 | 139 | ||
135 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | 140 | #if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING) |
136 | static inline void account_system_vtime(struct task_struct *tsk) | 141 | static inline void account_system_vtime(struct task_struct *tsk) |
137 | { | 142 | { |
138 | } | 143 | } |
144 | #else | ||
145 | extern void account_system_vtime(struct task_struct *tsk); | ||
139 | #endif | 146 | #endif |
140 | 147 | ||
141 | #if defined(CONFIG_NO_HZ) | 148 | #if defined(CONFIG_NO_HZ) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 61b4ecf1da5..0383601a927 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -875,6 +875,7 @@ enum sched_domain_level { | |||
875 | SD_LV_NONE = 0, | 875 | SD_LV_NONE = 0, |
876 | SD_LV_SIBLING, | 876 | SD_LV_SIBLING, |
877 | SD_LV_MC, | 877 | SD_LV_MC, |
878 | SD_LV_BOOK, | ||
878 | SD_LV_CPU, | 879 | SD_LV_CPU, |
879 | SD_LV_NODE, | 880 | SD_LV_NODE, |
880 | SD_LV_ALLNODES, | 881 | SD_LV_ALLNODES, |
@@ -1690,8 +1691,7 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t * | |||
1690 | /* | 1691 | /* |
1691 | * Per process flags | 1692 | * Per process flags |
1692 | */ | 1693 | */ |
1693 | #define PF_ALIGNWARN 0x00000001 /* Print alignment warning msgs */ | 1694 | #define PF_KSOFTIRQD 0x00000001 /* I am ksoftirqd */ |
1694 | /* Not implemented yet, only for 486*/ | ||
1695 | #define PF_STARTING 0x00000002 /* being created */ | 1695 | #define PF_STARTING 0x00000002 /* being created */ |
1696 | #define PF_EXITING 0x00000004 /* getting shut down */ | 1696 | #define PF_EXITING 0x00000004 /* getting shut down */ |
1697 | #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ | 1697 | #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ |
@@ -1837,6 +1837,19 @@ extern void sched_clock_idle_sleep_event(void); | |||
1837 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); | 1837 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); |
1838 | #endif | 1838 | #endif |
1839 | 1839 | ||
1840 | #ifdef CONFIG_IRQ_TIME_ACCOUNTING | ||
1841 | /* | ||
1842 | * An i/f to runtime opt-in for irq time accounting based off of sched_clock. | ||
1843 | * The reason for this explicit opt-in is not to have perf penalty with | ||
1844 | * slow sched_clocks. | ||
1845 | */ | ||
1846 | extern void enable_sched_clock_irqtime(void); | ||
1847 | extern void disable_sched_clock_irqtime(void); | ||
1848 | #else | ||
1849 | static inline void enable_sched_clock_irqtime(void) {} | ||
1850 | static inline void disable_sched_clock_irqtime(void) {} | ||
1851 | #endif | ||
1852 | |||
1840 | extern unsigned long long | 1853 | extern unsigned long long |
1841 | task_sched_runtime(struct task_struct *task); | 1854 | task_sched_runtime(struct task_struct *task); |
1842 | extern unsigned long long thread_group_sched_runtime(struct task_struct *task); | 1855 | extern unsigned long long thread_group_sched_runtime(struct task_struct *task); |
@@ -2378,9 +2391,9 @@ extern int __cond_resched_lock(spinlock_t *lock); | |||
2378 | 2391 | ||
2379 | extern int __cond_resched_softirq(void); | 2392 | extern int __cond_resched_softirq(void); |
2380 | 2393 | ||
2381 | #define cond_resched_softirq() ({ \ | 2394 | #define cond_resched_softirq() ({ \ |
2382 | __might_sleep(__FILE__, __LINE__, SOFTIRQ_OFFSET); \ | 2395 | __might_sleep(__FILE__, __LINE__, SOFTIRQ_DISABLE_OFFSET); \ |
2383 | __cond_resched_softirq(); \ | 2396 | __cond_resched_softirq(); \ |
2384 | }) | 2397 | }) |
2385 | 2398 | ||
2386 | /* | 2399 | /* |
diff --git a/include/linux/topology.h b/include/linux/topology.h index 64e084ff5e5..b91a40e847d 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -201,6 +201,12 @@ int arch_update_cpu_topology(void); | |||
201 | .balance_interval = 64, \ | 201 | .balance_interval = 64, \ |
202 | } | 202 | } |
203 | 203 | ||
204 | #ifdef CONFIG_SCHED_BOOK | ||
205 | #ifndef SD_BOOK_INIT | ||
206 | #error Please define an appropriate SD_BOOK_INIT in include/asm/topology.h!!! | ||
207 | #endif | ||
208 | #endif /* CONFIG_SCHED_BOOK */ | ||
209 | |||
204 | #ifdef CONFIG_NUMA | 210 | #ifdef CONFIG_NUMA |
205 | #ifndef SD_NODE_INIT | 211 | #ifndef SD_NODE_INIT |
206 | #error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! | 212 | #error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! |