lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-800cd25c12981c99e5401c3551ffffd99f1c6c85@git.kernel.org>
Date:	Thu, 31 Mar 2011 12:41:31 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, paulus@...ba.org,
	acme@...hat.com, hpa@...or.com, mingo@...hat.com,
	a.p.zijlstra@...llo.nl, fweisbec@...il.com, tglx@...utronix.de,
	mingo@...e.hu
Subject: [tip:perf/urgent] perf: mmap 512 kiB by default

Commit-ID:  800cd25c12981c99e5401c3551ffffd99f1c6c85
Gitweb:     http://git.kernel.org/tip/800cd25c12981c99e5401c3551ffffd99f1c6c85
Author:     Frederic Weisbecker <fweisbec@...il.com>
AuthorDate: Thu, 31 Mar 2011 03:35:24 +0200
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Thu, 31 Mar 2011 13:02:55 +0200

perf: mmap 512 kiB by default

The default setting of perf record is to mmap 128 pages if the user
did not override with -m.

However the page size may vary accross different architecture
settings, giving different default size between each.

Moreover the kernel side still has a default max number of mlocked
pages of 512 kiB + 1 page for unprivileged users. 128 + 1 pages
with page size > 4096 overlaps this threshold.

Thus, better adapt to this limitation and set the default number of
pages to fit those 512 kiB + 1 page.

Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Stephane Eranian <eranian@...gle.com>
LKML-Reference: <1301535324-9735-1-git-send-email-fweisbec@...il.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
 tools/perf/builtin-record.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index db6adec..17d1dcb 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -41,7 +41,7 @@ static u64			user_interval			= ULLONG_MAX;
 static u64			default_interval		=      0;
 
 static unsigned int		page_size;
-static unsigned int		mmap_pages			=    128;
+static unsigned int		mmap_pages			= UINT_MAX;
 static unsigned int		user_freq 			= UINT_MAX;
 static int			freq				=   1000;
 static int			output;
@@ -513,6 +513,10 @@ static int __cmd_record(int argc, const char **argv)
 	if (have_tracepoints(&evsel_list->entries))
 		perf_header__set_feat(&session->header, HEADER_TRACE_INFO);
 
+	/* 512 kiB: default amount of unprivileged mlocked memory */
+	if (mmap_pages == UINT_MAX)
+		mmap_pages = (512 * 1024) / page_size;
+
 	if (forks) {
 		child_pid = fork();
 		if (child_pid < 0) {
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ