From: kan.liang@linux.intel.com
To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
linux-kernel@vger.kernel.org
Cc: mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
jolsa@redhat.com, eranian@google.com, ak@linux.intel.com,
dave.hansen@intel.com, kirill.shutemov@linux.intel.com,
mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org,
Kan Liang <kan.liang@linux.intel.com>
Subject: [PATCH V7 0/4] Add the page size in the perf record (kernel)
Date: Thu, 17 Sep 2020 06:52:33 -0700 [thread overview]
Message-ID: <20200917135237.2857-1-kan.liang@linux.intel.com> (raw)
From: Kan Liang <kan.liang@linux.intel.com>
Changes since V6
- Return the MMU page size of a given virtual address, not the kernel
software page size
- Add PERF_SAMPLE_DATA_PAGE_SIZE support for Power
- Allow large PEBS for PERF_SAMPLE_CODE_PAGE_SIZE
- Only include the kernel patches. The perf tool patches will be posted
later separately once the kernel patches are accepted.
Changes since V5
- Introduce a new universal page walker for the page size in the perf
subsystem.
- Rebased on Peter's tree.
Current perf can report both virtual addresses and physical addresses,
but not the page size. Without the page size information of the utilized
page, users cannot decide whether to promote/demote large pages to
optimize memory usage.
The patch set was submitted a year ago.
https://lkml.kernel.org/r/1549648509-12704-1-git-send-email-kan.liang@linux.intel.com
It introduced a __weak function, perf_get_page_size(), aim to retrieve
the page size via a given virtual address in the generic code, and
implemented a x86 specific version of perf_get_page_size().
However, the proposal was rejected, because it's a pure x86
implementation.
https://lkml.kernel.org/r/20190208200731.GN32511@hirez.programming.kicks-ass.net
At that time, it's not easy to support perf_get_page_size() universally,
because some key functions, e.g., p?d_large, are not supported by some
architectures.
Now, the generic p?d_leaf() functions are added in the latest kernel.
https://lkml.kernel.org/r/20191218162402.45610-2-steven.price@arm.com
Starts from V6, a new universal perf_get_page_size() function is
implemented based on the generic p?d_leaf() functions.
On some platforms, e.g., X86, the page walker is invoked in an NMI
handler. So the page walker must be NMI-safe and low overhead. Besides,
the page walker should work for both user and kernel virtual address.
The existing generic page walker, e.g., walk_page_range_novma(), is a
little bit complex and doesn't guarantee the NMI-safe. The follow_page()
is only for the user-virtual address. So a simpler page walk function is
implemented here.
Kan Liang (3):
perf/core: Add PERF_SAMPLE_DATA_PAGE_SIZE
perf/x86/intel: Support PERF_SAMPLE_DATA_PAGE_SIZE
powerpc/perf: Support PERF_SAMPLE_DATA_PAGE_SIZE
Stephane Eranian (1):
perf/core: Add support for PERF_SAMPLE_CODE_PAGE_SIZE
arch/powerpc/perf/core-book3s.c | 6 +-
arch/x86/events/intel/ds.c | 11 ++-
arch/x86/events/perf_event.h | 2 +-
include/linux/perf_event.h | 2 +
include/uapi/linux/perf_event.h | 6 +-
kernel/events/core.c | 114 +++++++++++++++++++++++++++++++-
6 files changed, 133 insertions(+), 8 deletions(-)
--
2.17.1
next reply other threads:[~2020-09-17 14:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-17 13:52 kan.liang [this message]
2020-09-17 13:52 ` [PATCH V7 1/4] perf/core: Add PERF_SAMPLE_DATA_PAGE_SIZE kan.liang
2020-09-17 19:00 ` Dave Hansen
2020-09-17 21:16 ` Liang, Kan
[not found] ` <04f59f3b-2e53-8774-8333-63dfc5b8e6a9@intel.com>
2020-09-17 21:58 ` Liang, Kan
2020-09-17 22:02 ` Dave Hansen
2020-09-17 22:16 ` Liang, Kan
2020-09-17 13:52 ` [PATCH V7 2/4] perf/x86/intel: Support PERF_SAMPLE_DATA_PAGE_SIZE kan.liang
2020-09-17 13:52 ` [PATCH V7 3/4] powerpc/perf: " kan.liang
2020-09-17 13:52 ` [PATCH V7 4/4] perf/core: Add support for PERF_SAMPLE_CODE_PAGE_SIZE kan.liang
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=20200917135237.2857-1-kan.liang@linux.intel.com \
--to=kan.liang@linux.intel.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=benh@kernel.crashing.org \
--cc=dave.hansen@intel.com \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.