diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-05-24 03:02:37 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-24 03:02:37 -0400 |
commit | a3862d3f814ce7dfca9eed56ac23d29db3aee8d5 (patch) | |
tree | 5cbc8c2cb9b11acb5bc21009d27da3978c1c0db2 /kernel/perf_counter.c | |
parent | c2990a2a582d73562d4dcf2502c39892a19a691d (diff) |
perf_counter: Increase mmap limit
In a default 'perf top' run the tool will create a counter for
each online CPU. With enough CPUs this will eventually exhaust
the default limit.
So scale it up with the number of online CPUs.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r-- | kernel/perf_counter.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index cb4062559b47..6cdf8248eda2 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
@@ -1704,6 +1704,12 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma) | |||
1704 | 1704 | ||
1705 | user_extra = nr_pages + 1; | 1705 | user_extra = nr_pages + 1; |
1706 | user_lock_limit = sysctl_perf_counter_mlock >> (PAGE_SHIFT - 10); | 1706 | user_lock_limit = sysctl_perf_counter_mlock >> (PAGE_SHIFT - 10); |
1707 | |||
1708 | /* | ||
1709 | * Increase the limit linearly with more CPUs: | ||
1710 | */ | ||
1711 | user_lock_limit *= num_online_cpus(); | ||
1712 | |||
1707 | user_locked = atomic_long_read(&user->locked_vm) + user_extra; | 1713 | user_locked = atomic_long_read(&user->locked_vm) + user_extra; |
1708 | 1714 | ||
1709 | extra = 0; | 1715 | extra = 0; |