diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/futex.c | 7 | ||||
| -rw-r--r-- | kernel/rcutiny.c | 3 | ||||
| -rw-r--r-- | kernel/srcu.c | 15 | ||||
| -rw-r--r-- | kernel/time/clocksource.c | 8 | ||||
| -rw-r--r-- | kernel/time/timekeeping.c | 4 | ||||
| -rw-r--r-- | kernel/trace/trace_syscalls.c | 33 |
6 files changed, 36 insertions, 34 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index 52075633373f..b766d28accd6 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
| @@ -826,10 +826,9 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this) | |||
| 826 | new_owner = rt_mutex_next_owner(&pi_state->pi_mutex); | 826 | new_owner = rt_mutex_next_owner(&pi_state->pi_mutex); |
| 827 | 827 | ||
| 828 | /* | 828 | /* |
| 829 | * This happens when we have stolen the lock and the original | 829 | * It is possible that the next waiter (the one that brought |
| 830 | * pending owner did not enqueue itself back on the rt_mutex. | 830 | * this owner to the kernel) timed out and is no longer |
| 831 | * Thats not a tragedy. We know that way, that a lock waiter | 831 | * waiting on the lock. |
| 832 | * is on the fly. We make the futex_q waiter the pending owner. | ||
| 833 | */ | 832 | */ |
| 834 | if (!new_owner) | 833 | if (!new_owner) |
| 835 | new_owner = this->task; | 834 | new_owner = this->task; |
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c index 034493724749..0c343b9a46d5 100644 --- a/kernel/rcutiny.c +++ b/kernel/rcutiny.c | |||
| @@ -189,7 +189,8 @@ static int rcu_kthread(void *arg) | |||
| 189 | unsigned long flags; | 189 | unsigned long flags; |
| 190 | 190 | ||
| 191 | for (;;) { | 191 | for (;;) { |
| 192 | wait_event(rcu_kthread_wq, have_rcu_kthread_work != 0); | 192 | wait_event_interruptible(rcu_kthread_wq, |
| 193 | have_rcu_kthread_work != 0); | ||
| 193 | morework = rcu_boost(); | 194 | morework = rcu_boost(); |
| 194 | local_irq_save(flags); | 195 | local_irq_save(flags); |
| 195 | work = have_rcu_kthread_work; | 196 | work = have_rcu_kthread_work; |
diff --git a/kernel/srcu.c b/kernel/srcu.c index 98d8c1e80edb..73ce23feaea9 100644 --- a/kernel/srcu.c +++ b/kernel/srcu.c | |||
| @@ -156,6 +156,16 @@ void __srcu_read_unlock(struct srcu_struct *sp, int idx) | |||
| 156 | EXPORT_SYMBOL_GPL(__srcu_read_unlock); | 156 | EXPORT_SYMBOL_GPL(__srcu_read_unlock); |
| 157 | 157 | ||
| 158 | /* | 158 | /* |
| 159 | * We use an adaptive strategy for synchronize_srcu() and especially for | ||
| 160 | * synchronize_srcu_expedited(). We spin for a fixed time period | ||
| 161 | * (defined below) to allow SRCU readers to exit their read-side critical | ||
| 162 | * sections. If there are still some readers after 10 microseconds, | ||
| 163 | * we repeatedly block for 1-millisecond time periods. This approach | ||
| 164 | * has done well in testing, so there is no need for a config parameter. | ||
| 165 | */ | ||
| 166 | #define SYNCHRONIZE_SRCU_READER_DELAY 10 | ||
| 167 | |||
| 168 | /* | ||
| 159 | * Helper function for synchronize_srcu() and synchronize_srcu_expedited(). | 169 | * Helper function for synchronize_srcu() and synchronize_srcu_expedited(). |
| 160 | */ | 170 | */ |
| 161 | static void __synchronize_srcu(struct srcu_struct *sp, void (*sync_func)(void)) | 171 | static void __synchronize_srcu(struct srcu_struct *sp, void (*sync_func)(void)) |
| @@ -207,11 +217,12 @@ static void __synchronize_srcu(struct srcu_struct *sp, void (*sync_func)(void)) | |||
| 207 | * will have finished executing. We initially give readers | 217 | * will have finished executing. We initially give readers |
| 208 | * an arbitrarily chosen 10 microseconds to get out of their | 218 | * an arbitrarily chosen 10 microseconds to get out of their |
| 209 | * SRCU read-side critical sections, then loop waiting 1/HZ | 219 | * SRCU read-side critical sections, then loop waiting 1/HZ |
| 210 | * seconds per iteration. | 220 | * seconds per iteration. The 10-microsecond value has done |
| 221 | * very well in testing. | ||
| 211 | */ | 222 | */ |
| 212 | 223 | ||
| 213 | if (srcu_readers_active_idx(sp, idx)) | 224 | if (srcu_readers_active_idx(sp, idx)) |
| 214 | udelay(CONFIG_SRCU_SYNCHRONIZE_DELAY); | 225 | udelay(SYNCHRONIZE_SRCU_READER_DELAY); |
| 215 | while (srcu_readers_active_idx(sp, idx)) | 226 | while (srcu_readers_active_idx(sp, idx)) |
| 216 | schedule_timeout_interruptible(1); | 227 | schedule_timeout_interruptible(1); |
| 217 | 228 | ||
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index c50a034de30f..6519cf62d9cd 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c | |||
| @@ -113,7 +113,7 @@ EXPORT_SYMBOL_GPL(timecounter_cyc2time); | |||
| 113 | * @shift: pointer to shift variable | 113 | * @shift: pointer to shift variable |
| 114 | * @from: frequency to convert from | 114 | * @from: frequency to convert from |
| 115 | * @to: frequency to convert to | 115 | * @to: frequency to convert to |
| 116 | * @minsec: guaranteed runtime conversion range in seconds | 116 | * @maxsec: guaranteed runtime conversion range in seconds |
| 117 | * | 117 | * |
| 118 | * The function evaluates the shift/mult pair for the scaled math | 118 | * The function evaluates the shift/mult pair for the scaled math |
| 119 | * operations of clocksources and clockevents. | 119 | * operations of clocksources and clockevents. |
| @@ -122,7 +122,7 @@ EXPORT_SYMBOL_GPL(timecounter_cyc2time); | |||
| 122 | * NSEC_PER_SEC == 1GHz and @from is the counter frequency. For clock | 122 | * NSEC_PER_SEC == 1GHz and @from is the counter frequency. For clock |
| 123 | * event @to is the counter frequency and @from is NSEC_PER_SEC. | 123 | * event @to is the counter frequency and @from is NSEC_PER_SEC. |
| 124 | * | 124 | * |
| 125 | * The @minsec conversion range argument controls the time frame in | 125 | * The @maxsec conversion range argument controls the time frame in |
| 126 | * seconds which must be covered by the runtime conversion with the | 126 | * seconds which must be covered by the runtime conversion with the |
| 127 | * calculated mult and shift factors. This guarantees that no 64bit | 127 | * calculated mult and shift factors. This guarantees that no 64bit |
| 128 | * overflow happens when the input value of the conversion is | 128 | * overflow happens when the input value of the conversion is |
| @@ -131,7 +131,7 @@ EXPORT_SYMBOL_GPL(timecounter_cyc2time); | |||
| 131 | * factors. | 131 | * factors. |
| 132 | */ | 132 | */ |
| 133 | void | 133 | void |
| 134 | clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec) | 134 | clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 maxsec) |
| 135 | { | 135 | { |
| 136 | u64 tmp; | 136 | u64 tmp; |
| 137 | u32 sft, sftacc= 32; | 137 | u32 sft, sftacc= 32; |
| @@ -140,7 +140,7 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec) | |||
| 140 | * Calculate the shift factor which is limiting the conversion | 140 | * Calculate the shift factor which is limiting the conversion |
| 141 | * range: | 141 | * range: |
| 142 | */ | 142 | */ |
| 143 | tmp = ((u64)minsec * from) >> 32; | 143 | tmp = ((u64)maxsec * from) >> 32; |
| 144 | while (tmp) { | 144 | while (tmp) { |
| 145 | tmp >>=1; | 145 | tmp >>=1; |
| 146 | sftacc--; | 146 | sftacc--; |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 5536aaf3ba36..d27c7562902c 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
| @@ -49,7 +49,7 @@ struct timekeeper { | |||
| 49 | u32 mult; | 49 | u32 mult; |
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | struct timekeeper timekeeper; | 52 | static struct timekeeper timekeeper; |
| 53 | 53 | ||
| 54 | /** | 54 | /** |
| 55 | * timekeeper_setup_internals - Set up internals to use clocksource clock. | 55 | * timekeeper_setup_internals - Set up internals to use clocksource clock. |
| @@ -164,7 +164,7 @@ static struct timespec total_sleep_time; | |||
| 164 | /* | 164 | /* |
| 165 | * The raw monotonic time for the CLOCK_MONOTONIC_RAW posix clock. | 165 | * The raw monotonic time for the CLOCK_MONOTONIC_RAW posix clock. |
| 166 | */ | 166 | */ |
| 167 | struct timespec raw_time; | 167 | static struct timespec raw_time; |
| 168 | 168 | ||
| 169 | /* flag for if timekeeping is suspended */ | 169 | /* flag for if timekeeping is suspended */ |
| 170 | int __read_mostly timekeeping_suspended; | 170 | int __read_mostly timekeeping_suspended; |
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index bac752f0cfb5..b706529b4fc7 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
| @@ -23,9 +23,6 @@ static int syscall_exit_register(struct ftrace_event_call *event, | |||
| 23 | static int syscall_enter_define_fields(struct ftrace_event_call *call); | 23 | static int syscall_enter_define_fields(struct ftrace_event_call *call); |
| 24 | static int syscall_exit_define_fields(struct ftrace_event_call *call); | 24 | static int syscall_exit_define_fields(struct ftrace_event_call *call); |
| 25 | 25 | ||
| 26 | /* All syscall exit events have the same fields */ | ||
| 27 | static LIST_HEAD(syscall_exit_fields); | ||
| 28 | |||
| 29 | static struct list_head * | 26 | static struct list_head * |
| 30 | syscall_get_enter_fields(struct ftrace_event_call *call) | 27 | syscall_get_enter_fields(struct ftrace_event_call *call) |
| 31 | { | 28 | { |
| @@ -34,34 +31,28 @@ syscall_get_enter_fields(struct ftrace_event_call *call) | |||
| 34 | return &entry->enter_fields; | 31 | return &entry->enter_fields; |
| 35 | } | 32 | } |
| 36 | 33 | ||
| 37 | static struct list_head * | ||
| 38 | syscall_get_exit_fields(struct ftrace_event_call *call) | ||
| 39 | { | ||
| 40 | return &syscall_exit_fields; | ||
| 41 | } | ||
| 42 | |||
| 43 | struct trace_event_functions enter_syscall_print_funcs = { | 34 | struct trace_event_functions enter_syscall_print_funcs = { |
| 44 | .trace = print_syscall_enter, | 35 | .trace = print_syscall_enter, |
| 45 | }; | 36 | }; |
| 46 | 37 | ||
| 47 | struct trace_event_functions exit_syscall_print_funcs = { | 38 | struct trace_event_functions exit_syscall_print_funcs = { |
| 48 | .trace = print_syscall_exit, | 39 | .trace = print_syscall_exit, |
| 49 | }; | 40 | }; |
| 50 | 41 | ||
| 51 | struct ftrace_event_class event_class_syscall_enter = { | 42 | struct ftrace_event_class event_class_syscall_enter = { |
| 52 | .system = "syscalls", | 43 | .system = "syscalls", |
| 53 | .reg = syscall_enter_register, | 44 | .reg = syscall_enter_register, |
| 54 | .define_fields = syscall_enter_define_fields, | 45 | .define_fields = syscall_enter_define_fields, |
| 55 | .get_fields = syscall_get_enter_fields, | 46 | .get_fields = syscall_get_enter_fields, |
| 56 | .raw_init = init_syscall_trace, | 47 | .raw_init = init_syscall_trace, |
| 57 | }; | 48 | }; |
| 58 | 49 | ||
| 59 | struct ftrace_event_class event_class_syscall_exit = { | 50 | struct ftrace_event_class event_class_syscall_exit = { |
| 60 | .system = "syscalls", | 51 | .system = "syscalls", |
| 61 | .reg = syscall_exit_register, | 52 | .reg = syscall_exit_register, |
| 62 | .define_fields = syscall_exit_define_fields, | 53 | .define_fields = syscall_exit_define_fields, |
| 63 | .get_fields = syscall_get_exit_fields, | 54 | .fields = LIST_HEAD_INIT(event_class_syscall_exit.fields), |
| 64 | .raw_init = init_syscall_trace, | 55 | .raw_init = init_syscall_trace, |
| 65 | }; | 56 | }; |
| 66 | 57 | ||
| 67 | extern unsigned long __start_syscalls_metadata[]; | 58 | extern unsigned long __start_syscalls_metadata[]; |
