diff options
author | Ingo Molnar <mingo@kernel.org> | 2019-10-22 01:15:32 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-10-22 01:15:32 +0200 |
commit | aa7a7b72974a4612a85bb395a4b23b973ffc7d2b (patch) | |
tree | 35c61f29a9a2876f609a2f7827f1094c4c392dc3 /kernel | |
parent | perf/core: Fix !CONFIG_PERF_EVENTS build warnings and failures (diff) | |
parent | perf/aux: Fix tracking of auxiliary trace buffer allocation (diff) | |
download | linux-aa7a7b72974a4612a85bb395a4b23b973ffc7d2b.tar.xz linux-aa7a7b72974a4612a85bb395a4b23b973ffc7d2b.zip |
Merge branch 'perf/urgent' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/events/core.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index f9a5d4356562..5bbaabdad068 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -5619,8 +5619,10 @@ static void perf_mmap_close(struct vm_area_struct *vma) perf_pmu_output_stop(event); /* now it's safe to free the pages */ - atomic_long_sub(rb->aux_nr_pages, &mmap_user->locked_vm); - atomic64_sub(rb->aux_mmap_locked, &vma->vm_mm->pinned_vm); + if (!rb->aux_mmap_locked) + atomic_long_sub(rb->aux_nr_pages, &mmap_user->locked_vm); + else + atomic64_sub(rb->aux_mmap_locked, &vma->vm_mm->pinned_vm); /* this has to be the last one */ rb_free_aux(rb); |