diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2011-08-27 09:43:54 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2011-08-27 10:06:11 -0400 |
commit | 7b1bb388bc879ffcc6c69b567816d5c354afe42b (patch) | |
tree | 5a217fdfb0b5e5a327bdcd624506337c1ae1fe32 /include/linux/smp.h | |
parent | 7d754596756240fa918b94cd0c3011c77a638987 (diff) | |
parent | 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe (diff) |
Merge 'Linux v3.0' into Litmus
Some notes:
* Litmus^RT scheduling class is the topmost scheduling class
(above stop_sched_class).
* scheduler_ipi() function (e.g., in smp_reschedule_interrupt())
may increase IPI latencies.
* Added path into schedule() to quickly re-evaluate scheduling
decision without becoming preemptive again. This used to be
a standard path before the removal of BKL.
Conflicts:
Makefile
arch/arm/kernel/calls.S
arch/arm/kernel/smp.c
arch/x86/include/asm/unistd_32.h
arch/x86/kernel/smp.c
arch/x86/kernel/syscall_table_32.S
include/linux/hrtimer.h
kernel/printk.c
kernel/sched.c
kernel/sched_fair.c
Diffstat (limited to 'include/linux/smp.h')
-rw-r--r-- | include/linux/smp.h | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/include/linux/smp.h b/include/linux/smp.h index f86d40768e7f..53b1beef27ad 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -10,12 +10,14 @@ | |||
10 | #include <linux/types.h> | 10 | #include <linux/types.h> |
11 | #include <linux/list.h> | 11 | #include <linux/list.h> |
12 | #include <linux/cpumask.h> | 12 | #include <linux/cpumask.h> |
13 | #include <linux/init.h> | ||
13 | 14 | ||
14 | extern void cpu_idle(void); | 15 | extern void cpu_idle(void); |
15 | 16 | ||
17 | typedef void (*smp_call_func_t)(void *info); | ||
16 | struct call_single_data { | 18 | struct call_single_data { |
17 | struct list_head list; | 19 | struct list_head list; |
18 | void (*func) (void *info); | 20 | smp_call_func_t func; |
19 | void *info; | 21 | void *info; |
20 | u16 flags; | 22 | u16 flags; |
21 | u16 priv; | 23 | u16 priv; |
@@ -24,8 +26,8 @@ struct call_single_data { | |||
24 | /* total number of cpus in this system (may exceed NR_CPUS) */ | 26 | /* total number of cpus in this system (may exceed NR_CPUS) */ |
25 | extern unsigned int total_cpus; | 27 | extern unsigned int total_cpus; |
26 | 28 | ||
27 | int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, | 29 | int smp_call_function_single(int cpuid, smp_call_func_t func, void *info, |
28 | int wait); | 30 | int wait); |
29 | 31 | ||
30 | #ifdef CONFIG_SMP | 32 | #ifdef CONFIG_SMP |
31 | 33 | ||
@@ -69,15 +71,15 @@ extern void smp_cpus_done(unsigned int max_cpus); | |||
69 | /* | 71 | /* |
70 | * Call a function on all other processors | 72 | * Call a function on all other processors |
71 | */ | 73 | */ |
72 | int smp_call_function(void(*func)(void *info), void *info, int wait); | 74 | int smp_call_function(smp_call_func_t func, void *info, int wait); |
73 | void smp_call_function_many(const struct cpumask *mask, | 75 | void smp_call_function_many(const struct cpumask *mask, |
74 | void (*func)(void *info), void *info, bool wait); | 76 | smp_call_func_t func, void *info, bool wait); |
75 | 77 | ||
76 | void __smp_call_function_single(int cpuid, struct call_single_data *data, | 78 | void __smp_call_function_single(int cpuid, struct call_single_data *data, |
77 | int wait); | 79 | int wait); |
78 | 80 | ||
79 | int smp_call_function_any(const struct cpumask *mask, | 81 | int smp_call_function_any(const struct cpumask *mask, |
80 | void (*func)(void *info), void *info, int wait); | 82 | smp_call_func_t func, void *info, int wait); |
81 | 83 | ||
82 | /* | 84 | /* |
83 | * sends a 'pull timer' event to a remote CPU | 85 | * sends a 'pull timer' event to a remote CPU |
@@ -88,28 +90,21 @@ extern void smp_send_pull_timers(int cpu); | |||
88 | * Generic and arch helpers | 90 | * Generic and arch helpers |
89 | */ | 91 | */ |
90 | #ifdef CONFIG_USE_GENERIC_SMP_HELPERS | 92 | #ifdef CONFIG_USE_GENERIC_SMP_HELPERS |
93 | void __init call_function_init(void); | ||
91 | void generic_smp_call_function_single_interrupt(void); | 94 | void generic_smp_call_function_single_interrupt(void); |
92 | void generic_smp_call_function_interrupt(void); | 95 | void generic_smp_call_function_interrupt(void); |
93 | void ipi_call_lock(void); | 96 | void ipi_call_lock(void); |
94 | void ipi_call_unlock(void); | 97 | void ipi_call_unlock(void); |
95 | void ipi_call_lock_irq(void); | 98 | void ipi_call_lock_irq(void); |
96 | void ipi_call_unlock_irq(void); | 99 | void ipi_call_unlock_irq(void); |
100 | #else | ||
101 | static inline void call_function_init(void) { } | ||
97 | #endif | 102 | #endif |
98 | 103 | ||
99 | /* | 104 | /* |
100 | * Call a function on all processors | 105 | * Call a function on all processors |
101 | */ | 106 | */ |
102 | int on_each_cpu(void (*func) (void *info), void *info, int wait); | 107 | int on_each_cpu(smp_call_func_t func, void *info, int wait); |
103 | |||
104 | #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ | ||
105 | #define MSG_ALL 0x8001 | ||
106 | |||
107 | #define MSG_INVALIDATE_TLB 0x0001 /* Remote processor TLB invalidate */ | ||
108 | #define MSG_STOP_CPU 0x0002 /* Sent to shut down slave CPU's | ||
109 | * when rebooting | ||
110 | */ | ||
111 | #define MSG_RESCHEDULE 0x0003 /* Reschedule request from master CPU*/ | ||
112 | #define MSG_CALL_FUNCTION 0x0004 /* Call function on all other CPUs */ | ||
113 | 108 | ||
114 | /* | 109 | /* |
115 | * Mark the boot cpu "online" so that it can call console drivers in | 110 | * Mark the boot cpu "online" so that it can call console drivers in |
@@ -118,6 +113,8 @@ int on_each_cpu(void (*func) (void *info), void *info, int wait); | |||
118 | void smp_prepare_boot_cpu(void); | 113 | void smp_prepare_boot_cpu(void); |
119 | 114 | ||
120 | extern unsigned int setup_max_cpus; | 115 | extern unsigned int setup_max_cpus; |
116 | extern void __init setup_nr_cpu_ids(void); | ||
117 | extern void __init smp_init(void); | ||
121 | 118 | ||
122 | #else /* !SMP */ | 119 | #else /* !SMP */ |
123 | 120 | ||
@@ -127,7 +124,7 @@ static inline void smp_send_stop(void) { } | |||
127 | * These macros fold the SMP functionality into a single CPU system | 124 | * These macros fold the SMP functionality into a single CPU system |
128 | */ | 125 | */ |
129 | #define raw_smp_processor_id() 0 | 126 | #define raw_smp_processor_id() 0 |
130 | static inline int up_smp_call_function(void (*func)(void *), void *info) | 127 | static inline int up_smp_call_function(smp_call_func_t func, void *info) |
131 | { | 128 | { |
132 | return 0; | 129 | return 0; |
133 | } | 130 | } |
@@ -145,10 +142,10 @@ static inline void smp_send_reschedule(int cpu) { } | |||
145 | #define smp_prepare_boot_cpu() do {} while (0) | 142 | #define smp_prepare_boot_cpu() do {} while (0) |
146 | #define smp_call_function_many(mask, func, info, wait) \ | 143 | #define smp_call_function_many(mask, func, info, wait) \ |
147 | (up_smp_call_function(func, info)) | 144 | (up_smp_call_function(func, info)) |
148 | static inline void init_call_single_data(void) { } | 145 | static inline void call_function_init(void) { } |
149 | 146 | ||
150 | static inline int | 147 | static inline int |
151 | smp_call_function_any(const struct cpumask *mask, void (*func)(void *info), | 148 | smp_call_function_any(const struct cpumask *mask, smp_call_func_t func, |
152 | void *info, int wait) | 149 | void *info, int wait) |
153 | { | 150 | { |
154 | return smp_call_function_single(0, func, info, wait); | 151 | return smp_call_function_single(0, func, info, wait); |