From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Han Pingtian <phan@redhat.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@elte.hu>,
Stephane Eranian <eranian@google.com>, Stable <stable@kernel.org>
Subject: Re: [PATCH] perf: Better fit max unprivileged mlock pages for tools needs
Date: Wed, 23 Mar 2011 15:38:12 -0300 [thread overview]
Message-ID: <20110323183812.GB30553@ghostprotocols.net> (raw)
In-Reply-To: <1300904979-5508-1-git-send-email-fweisbec@gmail.com>
Em Wed, Mar 23, 2011 at 07:29:39PM +0100, Frederic Weisbecker escreveu:
> 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.
Thanks!
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> Reported-by: Han Pingtian <phan@redhat.com>
> Reported-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Stephane Eranian <eranian@google.com>
> Cc: Stable <stable@kernel.org>
> ---
> 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 3472bb1..d5943b0 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
> --
> 1.7.3.2
next prev parent reply other threads:[~2011-03-23 18:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-23 18:29 [PATCH] perf: Better fit max unprivileged mlock pages for tools needs Frederic Weisbecker
2011-03-23 18:38 ` Arnaldo Carvalho de Melo [this message]
2011-03-23 21:19 ` [tip:perf/urgent] " tip-bot for Frederic Weisbecker
2011-03-25 10:32 ` [PATCH] " Peter Zijlstra
2011-03-25 14:50 ` Frederic Weisbecker
2011-03-25 15:05 ` Peter Zijlstra
2011-03-30 14:04 ` [PATCH] perf: Rebase max unprivileged mlock threshold on top of page size Frederic Weisbecker
2011-03-30 14:40 ` Peter Zijlstra
2011-03-30 14:53 ` Frederic Weisbecker
2011-03-31 1:33 ` [PATCH 1/2 v2] " Frederic Weisbecker
2011-03-31 12:41 ` [tip:perf/urgent] " tip-bot for Frederic Weisbecker
2011-03-31 1:35 ` [PATCH 2/2] perf: Mmap 512 kiB by default Frederic Weisbecker
2011-03-31 8:09 ` Peter Zijlstra
2011-03-31 12:33 ` Frederic Weisbecker
2011-03-31 12:41 ` [tip:perf/urgent] perf: mmap " tip-bot for Frederic Weisbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110323183812.GB30553@ghostprotocols.net \
--to=acme@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=phan@redhat.com \
--cc=stable@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox