* [PATCH] perf: Clarify the use of page::private for high-order AUX allocations
@ 2015-07-28 6:00 Alexander Shishkin
2015-08-12 12:33 ` [tip:perf/core] perf/ring-buffer: Clarify the use of page:: private " tip-bot for Alexander Shishkin
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Shishkin @ 2015-07-28 6:00 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Ingo Molnar, linux-kernel, Arnaldo Carvalho de Melo,
Mathieu Poirier, Alexander Shishkin
A question [1] was raised about the use of page::private in AUX buffer
allocations, so let's add a clarification about its intended use.
The private field and flag are used by perf's rb_alloc_aux() path to
tell the pmu driver the size of each high-order allocation, so that the
driver can program those appropriately into its hardware. This only
matters for pmus that don't support hardware scatter tables. Otherwise,
every page in the buffer is just a page.
This patch adds a comment about the private field to the aux buffer
allocation path.
[1] http://marc.info/?l=linux-kernel&m=143803696607968
Reported-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
kernel/events/ring_buffer.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
index 9c01d531ee..1c892fa034 100644
--- a/kernel/events/ring_buffer.c
+++ b/kernel/events/ring_buffer.c
@@ -472,7 +472,10 @@ static struct page *rb_alloc_aux_page(int node, int order)
if (page && order) {
/*
- * Communicate the allocation size to the driver
+ * Communicate the allocation size to the driver:
+ * if we managed to secure a high-order allocation,
+ * set its first page's private to this order;
+ * !PagePrivate(page) means it's just a normal page.
*/
split_page(page, order);
SetPagePrivate(page);
--
2.4.6
^ permalink raw reply [flat|nested] 2+ messages in thread* [tip:perf/core] perf/ring-buffer: Clarify the use of page:: private for high-order AUX allocations
2015-07-28 6:00 [PATCH] perf: Clarify the use of page::private for high-order AUX allocations Alexander Shishkin
@ 2015-08-12 12:33 ` tip-bot for Alexander Shishkin
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Alexander Shishkin @ 2015-08-12 12:33 UTC (permalink / raw)
To: linux-tip-commits
Cc: torvalds, tglx, mathieu.poirier, peterz, linux-kernel,
alexander.shishkin, mingo, acme, hpa
Commit-ID: c2ad6b51efc5f27d70ce952decd2a15679b83600
Gitweb: http://git.kernel.org/tip/c2ad6b51efc5f27d70ce952decd2a15679b83600
Author: Alexander Shishkin <alexander.shishkin@linux.intel.com>
AuthorDate: Tue, 28 Jul 2015 09:00:04 +0300
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 12 Aug 2015 11:43:20 +0200
perf/ring-buffer: Clarify the use of page::private for high-order AUX allocations
A question [1] was raised about the use of page::private in AUX buffer
allocations, so let's add a clarification about its intended use.
The private field and flag are used by perf's rb_alloc_aux() path to
tell the pmu driver the size of each high-order allocation, so that the
driver can program those appropriately into its hardware. This only
matters for PMUs that don't support hardware scatter tables. Otherwise,
every page in the buffer is just a page.
This patch adds a comment about the private field to the AUX buffer
allocation path.
[1] http://marc.info/?l=linux-kernel&m=143803696607968
Reported-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1438063204-665-1-git-send-email-alexander.shishkin@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/events/ring_buffer.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
index c8aa3f7..182bc30 100644
--- a/kernel/events/ring_buffer.c
+++ b/kernel/events/ring_buffer.c
@@ -437,7 +437,10 @@ static struct page *rb_alloc_aux_page(int node, int order)
if (page && order) {
/*
- * Communicate the allocation size to the driver
+ * Communicate the allocation size to the driver:
+ * if we managed to secure a high-order allocation,
+ * set its first page's private to this order;
+ * !PagePrivate(page) means it's just a normal page.
*/
split_page(page, order);
SetPagePrivate(page);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-12 12:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-28 6:00 [PATCH] perf: Clarify the use of page::private for high-order AUX allocations Alexander Shishkin
2015-08-12 12:33 ` [tip:perf/core] perf/ring-buffer: Clarify the use of page:: private " tip-bot for Alexander Shishkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome