From: Daniel John FitzGerald <daniel.j.fitzgerald@gmail.com>
To: linux-perf-users@vger.kernel.org
Subject: perf_event sampling ring (mmap) buffers on architectures with large pages
Date: Tue, 9 May 2017 12:23:26 -0400 [thread overview]
Message-ID: <8d792775-8e75-afdb-48bc-723ced7783b2@gmail.com> (raw)
I have a question about how to allocate and handle the mmap'd ring
buffer required by perf_event sampling on systems with potentially large
page sizes.
According to the perf_event_open man page:
When using perf_event_open() in sampled mode, asynchronous events
(like counter overflow or PROT_EXEC mmap tracking) are logged into a
ring-buffer. This ring-buffer is created and accessed through
mmap(2).
The mmap size should be 1+2^n pages, where the first page is a
metadata page (struct perf_event_mmap_page) that contains various
bits of information such as where the ring-buffer head is.
But what if the underlying architecture supports large page sizes? If
my application were running on a modern POWER processor, there is a very
real possibility that it has been configured to use 16GB page sizes. In
that case, I would be allocating a whopping 16GB of memory for the mmap
metadata page. Is there a workaround to prevent the allocation of such
a large amount of memory for the mmap metadata page?
In addition to this question, I would be interested in hearing if anyone
has had to deal with any other issues related to perf_event sampling on
a system with large pages.
--
Regards,
Dan FitzGerald
An enlightenment painter would paint a grand house on a lawn;
A romantic painter would paint it on fire.
reply other threads:[~2017-05-09 16:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=8d792775-8e75-afdb-48bc-723ced7783b2@gmail.com \
--to=daniel.j.fitzgerald@gmail.com \
--cc=linux-perf-users@vger.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;
as well as URLs for NNTP newsgroup(s).