diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 15:55:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 15:55:43 -0400 |
commit | bc4016f48161454a9a8e5eb209b0693c6cde9f62 (patch) | |
tree | f470f5d711e975b152eec90282f5dd30a1d5dba5 /include | |
parent | 5d70f79b5ef6ea2de4f72a37b2d96e2601e40a22 (diff) | |
parent | b7dadc38797584f6203386da1947ed5edf516646 (diff) |
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (29 commits)
sched: Export account_system_vtime()
sched: Call tick_check_idle before __irq_enter
sched: Remove irq time from available CPU power
sched: Do not account irq time to current task
x86: Add IRQ_TIME_ACCOUNTING
sched: Add IRQ_TIME_ACCOUNTING, finer accounting of irq time
sched: Add a PF flag for ksoftirqd identification
sched: Consolidate account_system_vtime extern declaration
sched: Fix softirq time accounting
sched: Drop group_capacity to 1 only if local group has extra capacity
sched: Force balancing on newidle balance if local group has capacity
sched: Set group_imb only a task can be pulled from the busiest cpu
sched: Do not consider SCHED_IDLE tasks to be cache hot
sched: Drop all load weight manipulation for RT tasks
sched: Create special class for stop/migrate work
sched: Unindent labels
sched: Comment updates: fix default latency and granularity numbers
tracing/sched: Add sched_pi_setprio tracepoint
sched: Give CPU bound RT tasks preference
sched: Try not to migrate higher priority RT tasks
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/hardirq.h | 9 | ||||
-rw-r--r-- | include/linux/sched.h | 23 | ||||
-rw-r--r-- | include/linux/topology.h | 6 | ||||
-rw-r--r-- | include/trace/events/sched.h | 29 |
4 files changed, 61 insertions, 6 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 1f4517d55b19..96c323ac44df 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 61b4ecf1da50..0383601a927c 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 64e084ff5e5c..b91a40e847d2 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!!! |
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 9208c92aeab5..f6334782a593 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
@@ -362,6 +362,35 @@ TRACE_EVENT(sched_stat_runtime, | |||
362 | (unsigned long long)__entry->vruntime) | 362 | (unsigned long long)__entry->vruntime) |
363 | ); | 363 | ); |
364 | 364 | ||
365 | /* | ||
366 | * Tracepoint for showing priority inheritance modifying a tasks | ||
367 | * priority. | ||
368 | */ | ||
369 | TRACE_EVENT(sched_pi_setprio, | ||
370 | |||
371 | TP_PROTO(struct task_struct *tsk, int newprio), | ||
372 | |||
373 | TP_ARGS(tsk, newprio), | ||
374 | |||
375 | TP_STRUCT__entry( | ||
376 | __array( char, comm, TASK_COMM_LEN ) | ||
377 | __field( pid_t, pid ) | ||
378 | __field( int, oldprio ) | ||
379 | __field( int, newprio ) | ||
380 | ), | ||
381 | |||
382 | TP_fast_assign( | ||
383 | memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); | ||
384 | __entry->pid = tsk->pid; | ||
385 | __entry->oldprio = tsk->prio; | ||
386 | __entry->newprio = newprio; | ||
387 | ), | ||
388 | |||
389 | TP_printk("comm=%s pid=%d oldprio=%d newprio=%d", | ||
390 | __entry->comm, __entry->pid, | ||
391 | __entry->oldprio, __entry->newprio) | ||
392 | ); | ||
393 | |||
365 | #endif /* _TRACE_SCHED_H */ | 394 | #endif /* _TRACE_SCHED_H */ |
366 | 395 | ||
367 | /* This part must be outside protection */ | 396 | /* This part must be outside protection */ |