[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-880f57318450dbead6a03f9e31a1468924d6dd88@git.kernel.org>
Date: Wed, 23 Mar 2011 21:19:09 GMT
From: tip-bot for Frederic Weisbecker <fweisbec@...il.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, eranian@...gle.com, acme@...hat.com,
hpa@...or.com, mingo@...hat.com, a.p.zijlstra@...llo.nl,
fweisbec@...il.com, phan@...hat.com, stable@...nel.org,
tglx@...utronix.de, mingo@...e.hu
Subject: [tip:perf/urgent] perf: Better fit max unprivileged mlock pages for tools needs
Commit-ID: 880f57318450dbead6a03f9e31a1468924d6dd88
Gitweb: http://git.kernel.org/tip/880f57318450dbead6a03f9e31a1468924d6dd88
Author: Frederic Weisbecker <fweisbec@...il.com>
AuthorDate: Wed, 23 Mar 2011 19:29:39 +0100
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Wed, 23 Mar 2011 20:57:04 +0100
perf: Better fit max unprivileged mlock pages for tools needs
The maximum kilobytes of locked memory that an unprivileged user
can reserve is of 512 kB = 128 pages by default, scaled to the
number of onlined CPUs, which fits well with the tools that use
128 data pages by default.
However tools actually use 129 pages, because they need one more
for the user control page. Thus the default mlock threshold is
not sufficient for the default tools needs and we always end up
to evaluate the constant mlock rlimit policy, which doesn't have
this scaling with the number of online CPUs.
Hence, on systems that have more than 16 CPUs, we overlap the
rlimit threshold and fail to mmap:
$ perf record ls
Error: failed to mmap with 1 (Operation not permitted)
Just increase the max unprivileged mlock threshold by one page
so that it supports well perf tools even after 16 CPUs.
Reported-by: Han Pingtian <phan@...hat.com>
Reported-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Reported-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Acked-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Stable <stable@...nel.org>
LKML-Reference: <1300904979-5508-1-git-send-email-fweisbec@...il.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/perf_event.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 0c71422..c75925c 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -145,7 +145,8 @@ static struct srcu_struct pmus_srcu;
*/
int sysctl_perf_event_paranoid __read_mostly = 1;
-int sysctl_perf_event_mlock __read_mostly = 512; /* 'free' kb per user */
+/* Minimum for 128 pages + 1 for the user control page */
+int sysctl_perf_event_mlock __read_mostly = 516; /* 'free' kb per user */
/*
* max perf event sample rate
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists