From: Peter Zijlstra <peterz@infradead.org>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org,
Frederic Weisbecker <fweisbec@gmail.com>,
Mike Galbraith <efault@gmx.de>, Paul Mackerras <paulus@samba.org>,
Stephane Eranian <eranian@google.com>,
Andi Kleen <ak@linux.intel.com>
Subject: Re: [RFC 2/2] perf: add AUX area to ring buffer for raw data streams
Date: Tue, 20 May 2014 11:51:02 +0200 [thread overview]
Message-ID: <20140520095102.GV2485@laptop.programming.kicks-ass.net> (raw)
In-Reply-To: <87bnuuylha.fsf@ashishki-desk.ger.corp.intel.com>
On Mon, May 19, 2014 at 03:57:37PM +0300, Alexander Shishkin wrote:
> Peter Zijlstra <peterz@infradead.org> writes:
> > I'm not entirely thrilled to expose it to the PMU like this.. I realize
> > you want this in order to get physically contiguous pages.
>
> Hmm, I guess we can have code in perf core to carry out the allocation
> according to, say, contstraint flags and pass the page array down to the
> PMU if that sounds like a cleaner thing to do?
>
> > Are you aware of allocation constraints for other architectures?
>
> Somewhat. ARM's trace memory controller supports both scatter-gather and
> a plain contiguous buffer, I haven't found evidence of one being
> available while the other one isn't, so I'm inclined to assume that if
> it can write to system memory, it supports SG.
I've just added a patch from Vince Weaver:
http://lkml.kernel.org/r/alpine.DEB.2.10.1405161708060.11099@vincent-weaver-1.umelst.maine.edu
That adds pmu::capabilities, I suppose we could start with something
like:
PERF_PMU_CAP_AUX_BROKEN_SG
which would make the allocator attempt to fill the AUX buffer with as
big a chunks of contiguous memory as is available.
> > That appears to be missing a is_power_of_2(aux_size) check.
> >
> > The problem with not having that is that since
> > perf_event_mmap_page::aux_{head,tail} are of Z mod 2^64 but your actual
> > {head,tail} are of Z mod aux_size, you need aux_size to be a full
> > divider of 2^64 or otherwise you get wrapping issues at the overflow.
> >
> > Having it them all 2^n makes the divider trivial.
>
> I left it out so that the PMU callback could decide if it wants to do
> the math or not. Maybe it can also be a constraint flag or is it not
> worth it at all?
I'd start with the most constrained model -- that is add the power of
two test -- and worry about relaxing it if it turns out its really
needed.
next prev parent reply other threads:[~2014-05-20 9:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-15 15:08 [RFC 0/2] perf: add AUX space to ring_buffer Alexander Shishkin
2014-05-15 15:08 ` [RFC 1/2] perf: add data_{offset,size} to user_page Alexander Shishkin
2014-05-15 18:14 ` Robert Richter
2014-05-15 15:08 ` [RFC 2/2] perf: add AUX area to ring buffer for raw data streams Alexander Shishkin
2014-05-15 18:02 ` Robert Richter
2014-05-16 7:07 ` Alexander Shishkin
2014-05-19 8:58 ` Peter Zijlstra
2014-05-19 12:57 ` Alexander Shishkin
2014-05-20 9:51 ` Peter Zijlstra [this message]
2014-05-21 14:02 ` Alexander Shishkin
2014-06-05 11:58 ` Ingo Molnar
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=20140520095102.GV2485@laptop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=efault@gmx.de \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.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.