diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/events/core.c | 12 | ||||
-rw-r--r-- | kernel/jump_label.c | 3 | ||||
-rw-r--r-- | kernel/lockdep.c | 8 | ||||
-rw-r--r-- | kernel/printk.c | 3 | ||||
-rw-r--r-- | kernel/time/alarmtimer.c | 2 | ||||
-rw-r--r-- | kernel/timer.c | 2 | ||||
-rw-r--r-- | kernel/trace/ftrace.c | 5 | ||||
-rw-r--r-- | kernel/trace/trace_events.c | 1 | ||||
-rw-r--r-- | kernel/trace/trace_events_filter.c | 7 |
9 files changed, 30 insertions, 13 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 600c1629b64d..58690af323e4 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -2174,11 +2174,11 @@ static void perf_event_context_sched_in(struct perf_event_context *ctx, | |||
2174 | */ | 2174 | */ |
2175 | cpu_ctx_sched_out(cpuctx, EVENT_FLEXIBLE); | 2175 | cpu_ctx_sched_out(cpuctx, EVENT_FLEXIBLE); |
2176 | 2176 | ||
2177 | perf_event_sched_in(cpuctx, ctx, task); | ||
2178 | |||
2179 | if (ctx->nr_events) | 2177 | if (ctx->nr_events) |
2180 | cpuctx->task_ctx = ctx; | 2178 | cpuctx->task_ctx = ctx; |
2181 | 2179 | ||
2180 | perf_event_sched_in(cpuctx, cpuctx->task_ctx, task); | ||
2181 | |||
2182 | perf_pmu_enable(ctx->pmu); | 2182 | perf_pmu_enable(ctx->pmu); |
2183 | perf_ctx_unlock(cpuctx, ctx); | 2183 | perf_ctx_unlock(cpuctx, ctx); |
2184 | 2184 | ||
@@ -3558,9 +3558,13 @@ static void ring_buffer_wakeup(struct perf_event *event) | |||
3558 | 3558 | ||
3559 | rcu_read_lock(); | 3559 | rcu_read_lock(); |
3560 | rb = rcu_dereference(event->rb); | 3560 | rb = rcu_dereference(event->rb); |
3561 | list_for_each_entry_rcu(event, &rb->event_list, rb_entry) { | 3561 | if (!rb) |
3562 | goto unlock; | ||
3563 | |||
3564 | list_for_each_entry_rcu(event, &rb->event_list, rb_entry) | ||
3562 | wake_up_all(&event->waitq); | 3565 | wake_up_all(&event->waitq); |
3563 | } | 3566 | |
3567 | unlock: | ||
3564 | rcu_read_unlock(); | 3568 | rcu_read_unlock(); |
3565 | } | 3569 | } |
3566 | 3570 | ||
diff --git a/kernel/jump_label.c b/kernel/jump_label.c index bbdfe2a462a0..66ff7109f697 100644 --- a/kernel/jump_label.c +++ b/kernel/jump_label.c | |||
@@ -66,8 +66,9 @@ void jump_label_inc(struct jump_label_key *key) | |||
66 | return; | 66 | return; |
67 | 67 | ||
68 | jump_label_lock(); | 68 | jump_label_lock(); |
69 | if (atomic_add_return(1, &key->enabled) == 1) | 69 | if (atomic_read(&key->enabled) == 0) |
70 | jump_label_update(key, JUMP_LABEL_ENABLE); | 70 | jump_label_update(key, JUMP_LABEL_ENABLE); |
71 | atomic_inc(&key->enabled); | ||
71 | jump_label_unlock(); | 72 | jump_label_unlock(); |
72 | } | 73 | } |
73 | 74 | ||
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index e69434b070da..b2e08c932d91 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <linux/stringify.h> | 44 | #include <linux/stringify.h> |
45 | #include <linux/bitops.h> | 45 | #include <linux/bitops.h> |
46 | #include <linux/gfp.h> | 46 | #include <linux/gfp.h> |
47 | #include <linux/kmemcheck.h> | ||
47 | 48 | ||
48 | #include <asm/sections.h> | 49 | #include <asm/sections.h> |
49 | 50 | ||
@@ -2948,7 +2949,12 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this, | |||
2948 | void lockdep_init_map(struct lockdep_map *lock, const char *name, | 2949 | void lockdep_init_map(struct lockdep_map *lock, const char *name, |
2949 | struct lock_class_key *key, int subclass) | 2950 | struct lock_class_key *key, int subclass) |
2950 | { | 2951 | { |
2951 | memset(lock, 0, sizeof(*lock)); | 2952 | int i; |
2953 | |||
2954 | kmemcheck_mark_initialized(lock, sizeof(*lock)); | ||
2955 | |||
2956 | for (i = 0; i < NR_LOCKDEP_CACHING_CLASSES; i++) | ||
2957 | lock->class_cache[i] = NULL; | ||
2952 | 2958 | ||
2953 | #ifdef CONFIG_LOCK_STAT | 2959 | #ifdef CONFIG_LOCK_STAT |
2954 | lock->cpu = raw_smp_processor_id(); | 2960 | lock->cpu = raw_smp_processor_id(); |
diff --git a/kernel/printk.c b/kernel/printk.c index 1455a0d4eedd..7982a0a841ea 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -1293,10 +1293,11 @@ again: | |||
1293 | raw_spin_lock(&logbuf_lock); | 1293 | raw_spin_lock(&logbuf_lock); |
1294 | if (con_start != log_end) | 1294 | if (con_start != log_end) |
1295 | retry = 1; | 1295 | retry = 1; |
1296 | raw_spin_unlock_irqrestore(&logbuf_lock, flags); | ||
1297 | |||
1296 | if (retry && console_trylock()) | 1298 | if (retry && console_trylock()) |
1297 | goto again; | 1299 | goto again; |
1298 | 1300 | ||
1299 | raw_spin_unlock_irqrestore(&logbuf_lock, flags); | ||
1300 | if (wake_klogd) | 1301 | if (wake_klogd) |
1301 | wake_up_klogd(); | 1302 | wake_up_klogd(); |
1302 | } | 1303 | } |
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index c436e790b21b..8a46f5d64504 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c | |||
@@ -195,7 +195,7 @@ static enum hrtimer_restart alarmtimer_fired(struct hrtimer *timer) | |||
195 | struct alarm *alarm; | 195 | struct alarm *alarm; |
196 | ktime_t expired = next->expires; | 196 | ktime_t expired = next->expires; |
197 | 197 | ||
198 | if (expired.tv64 >= now.tv64) | 198 | if (expired.tv64 > now.tv64) |
199 | break; | 199 | break; |
200 | 200 | ||
201 | alarm = container_of(next, struct alarm, node); | 201 | alarm = container_of(next, struct alarm, node); |
diff --git a/kernel/timer.c b/kernel/timer.c index dbaa62422b13..9c3c62b0c4bc 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -1368,7 +1368,7 @@ SYSCALL_DEFINE0(getppid) | |||
1368 | int pid; | 1368 | int pid; |
1369 | 1369 | ||
1370 | rcu_read_lock(); | 1370 | rcu_read_lock(); |
1371 | pid = task_tgid_vnr(current->real_parent); | 1371 | pid = task_tgid_vnr(rcu_dereference(current->real_parent)); |
1372 | rcu_read_unlock(); | 1372 | rcu_read_unlock(); |
1373 | 1373 | ||
1374 | return pid; | 1374 | return pid; |
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 900b409543db..b1e8943fed1d 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -152,7 +152,6 @@ void clear_ftrace_function(void) | |||
152 | ftrace_pid_function = ftrace_stub; | 152 | ftrace_pid_function = ftrace_stub; |
153 | } | 153 | } |
154 | 154 | ||
155 | #undef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST | ||
156 | #ifndef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST | 155 | #ifndef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST |
157 | /* | 156 | /* |
158 | * For those archs that do not test ftrace_trace_stop in their | 157 | * For those archs that do not test ftrace_trace_stop in their |
@@ -1212,7 +1211,9 @@ ftrace_hash_move(struct ftrace_ops *ops, int enable, | |||
1212 | if (!src->count) { | 1211 | if (!src->count) { |
1213 | free_ftrace_hash_rcu(*dst); | 1212 | free_ftrace_hash_rcu(*dst); |
1214 | rcu_assign_pointer(*dst, EMPTY_HASH); | 1213 | rcu_assign_pointer(*dst, EMPTY_HASH); |
1215 | return 0; | 1214 | /* still need to update the function records */ |
1215 | ret = 0; | ||
1216 | goto out; | ||
1216 | } | 1217 | } |
1217 | 1218 | ||
1218 | /* | 1219 | /* |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 581876f9f387..c212a7f934ec 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -1078,7 +1078,6 @@ event_subsystem_dir(const char *name, struct dentry *d_events) | |||
1078 | /* First see if we did not already create this dir */ | 1078 | /* First see if we did not already create this dir */ |
1079 | list_for_each_entry(system, &event_subsystems, list) { | 1079 | list_for_each_entry(system, &event_subsystems, list) { |
1080 | if (strcmp(system->name, name) == 0) { | 1080 | if (strcmp(system->name, name) == 0) { |
1081 | __get_system(system); | ||
1082 | system->nr_events++; | 1081 | system->nr_events++; |
1083 | return system->entry; | 1082 | return system->entry; |
1084 | } | 1083 | } |
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index d6e7926dcd26..95dc31efd6dd 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c | |||
@@ -1649,7 +1649,9 @@ static int replace_system_preds(struct event_subsystem *system, | |||
1649 | */ | 1649 | */ |
1650 | err = replace_preds(call, NULL, ps, filter_string, true); | 1650 | err = replace_preds(call, NULL, ps, filter_string, true); |
1651 | if (err) | 1651 | if (err) |
1652 | goto fail; | 1652 | call->flags |= TRACE_EVENT_FL_NO_SET_FILTER; |
1653 | else | ||
1654 | call->flags &= ~TRACE_EVENT_FL_NO_SET_FILTER; | ||
1653 | } | 1655 | } |
1654 | 1656 | ||
1655 | list_for_each_entry(call, &ftrace_events, list) { | 1657 | list_for_each_entry(call, &ftrace_events, list) { |
@@ -1658,6 +1660,9 @@ static int replace_system_preds(struct event_subsystem *system, | |||
1658 | if (strcmp(call->class->system, system->name) != 0) | 1660 | if (strcmp(call->class->system, system->name) != 0) |
1659 | continue; | 1661 | continue; |
1660 | 1662 | ||
1663 | if (call->flags & TRACE_EVENT_FL_NO_SET_FILTER) | ||
1664 | continue; | ||
1665 | |||
1661 | filter_item = kzalloc(sizeof(*filter_item), GFP_KERNEL); | 1666 | filter_item = kzalloc(sizeof(*filter_item), GFP_KERNEL); |
1662 | if (!filter_item) | 1667 | if (!filter_item) |
1663 | goto fail_mem; | 1668 | goto fail_mem; |