diff options
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r-- | kernel/perf_event.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 3472bb1a070c..c75925c4d1e2 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -145,7 +145,8 @@ static struct srcu_struct pmus_srcu; | |||
145 | */ | 145 | */ |
146 | int sysctl_perf_event_paranoid __read_mostly = 1; | 146 | int sysctl_perf_event_paranoid __read_mostly = 1; |
147 | 147 | ||
148 | int sysctl_perf_event_mlock __read_mostly = 512; /* 'free' kb per user */ | 148 | /* Minimum for 128 pages + 1 for the user control page */ |
149 | int sysctl_perf_event_mlock __read_mostly = 516; /* 'free' kb per user */ | ||
149 | 150 | ||
150 | /* | 151 | /* |
151 | * max perf event sample rate | 152 | * max perf event sample rate |
@@ -941,6 +942,7 @@ static void perf_group_attach(struct perf_event *event) | |||
941 | static void | 942 | static void |
942 | list_del_event(struct perf_event *event, struct perf_event_context *ctx) | 943 | list_del_event(struct perf_event *event, struct perf_event_context *ctx) |
943 | { | 944 | { |
945 | struct perf_cpu_context *cpuctx; | ||
944 | /* | 946 | /* |
945 | * We can have double detach due to exit/hot-unplug + close. | 947 | * We can have double detach due to exit/hot-unplug + close. |
946 | */ | 948 | */ |
@@ -949,8 +951,17 @@ list_del_event(struct perf_event *event, struct perf_event_context *ctx) | |||
949 | 951 | ||
950 | event->attach_state &= ~PERF_ATTACH_CONTEXT; | 952 | event->attach_state &= ~PERF_ATTACH_CONTEXT; |
951 | 953 | ||
952 | if (is_cgroup_event(event)) | 954 | if (is_cgroup_event(event)) { |
953 | ctx->nr_cgroups--; | 955 | ctx->nr_cgroups--; |
956 | cpuctx = __get_cpu_context(ctx); | ||
957 | /* | ||
958 | * if there are no more cgroup events | ||
959 | * then cler cgrp to avoid stale pointer | ||
960 | * in update_cgrp_time_from_cpuctx() | ||
961 | */ | ||
962 | if (!ctx->nr_cgroups) | ||
963 | cpuctx->cgrp = NULL; | ||
964 | } | ||
954 | 965 | ||
955 | ctx->nr_events--; | 966 | ctx->nr_events--; |
956 | if (event->attr.inherit_stat) | 967 | if (event->attr.inherit_stat) |