aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/mmap.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index 6b7b1a95944b..2c1c2cb0e2e1 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -28,6 +28,7 @@
28#include <linux/mempolicy.h> 28#include <linux/mempolicy.h>
29#include <linux/rmap.h> 29#include <linux/rmap.h>
30#include <linux/mmu_notifier.h> 30#include <linux/mmu_notifier.h>
31#include <linux/perf_counter.h>
31 32
32#include <asm/uaccess.h> 33#include <asm/uaccess.h>
33#include <asm/cacheflush.h> 34#include <asm/cacheflush.h>
@@ -1219,6 +1220,9 @@ munmap_back:
1219 if (correct_wcount) 1220 if (correct_wcount)
1220 atomic_inc(&inode->i_writecount); 1221 atomic_inc(&inode->i_writecount);
1221out: 1222out:
1223 if (vm_flags & VM_EXEC)
1224 perf_counter_mmap(addr, len, pgoff, file);
1225
1222 mm->total_vm += len >> PAGE_SHIFT; 1226 mm->total_vm += len >> PAGE_SHIFT;
1223 vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT); 1227 vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT);
1224 if (vm_flags & VM_LOCKED) { 1228 if (vm_flags & VM_LOCKED) {
@@ -1752,6 +1756,12 @@ static void remove_vma_list(struct mm_struct *mm, struct vm_area_struct *vma)
1752 do { 1756 do {
1753 long nrpages = vma_pages(vma); 1757 long nrpages = vma_pages(vma);
1754 1758
1759 if (vma->vm_flags & VM_EXEC) {
1760 perf_counter_munmap(vma->vm_start,
1761 nrpages << PAGE_SHIFT,
1762 vma->vm_pgoff, vma->vm_file);
1763 }
1764
1755 mm->total_vm -= nrpages; 1765 mm->total_vm -= nrpages;
1756 vm_stat_account(mm, vma->vm_flags, vma->vm_file, -nrpages); 1766 vm_stat_account(mm, vma->vm_flags, vma->vm_file, -nrpages);
1757 vma = remove_vma(vma); 1767 vma = remove_vma(vma);