linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: David Ahern <dsahern@gmail.com>
Cc: "linux-perf-use." <linux-perf-users@vger.kernel.org>,
	"William Cohen" <wcohen@redhat.com>, 大平怜 <rei.odaira@gmail.com>,
	oprofile-list <oprofile-list@lists.sourceforge.net>
Subject: Re: Issue perf attaching to processes creating many short-live threads
Date: Tue, 27 Oct 2015 11:47:46 -0300	[thread overview]
Message-ID: <20151027144746.GF9405@kernel.org> (raw)
In-Reply-To: <562F8703.7090103@gmail.com>

Em Tue, Oct 27, 2015 at 08:15:31AM -0600, David Ahern escreveu:
> On 10/27/15 6:33 AM, Arnaldo Carvalho de Melo wrote:
> >>Correlating data to user readable information is a key part of perf.

> >Indeed, as best as it can.

> >>One option that might be able to solve this problem is to have perf
> >>kernel side walk the task list and generate the task events into the
> >>ring buffer (task diag code could be leveraged). This would be a lot
> >
> >It would have to do this over multiple iterations, locklessly wrt the
> >task list, in a non-intrusive way, which, in this case, could take
> >forever, no? :-)
> 
> taskdiag struggles to keep up because netlink messages have a limited size,
> the skb's have to be pushed to userspace and ack'ed and then the walk
> proceeds to the next task.
> 
> Filenames for the maps are the biggest killer on throughput wrt kernel side
> processing.
> 
> With a multi-MB ring buffer you have a much larger buffer to fill. In
> addition perf userspace can be kicked at a low watermark so it is draining
> that buffer as fast as it can:
> 
>    kernel   --->   ring buffer  --->  perf  -->  what?
> 
> The limiter here is perf userspace draining the buffer such that the kernel
> side does not have to take much if any break.
> 
> If the "What" is a file (e.g., perf record) then file I/O becomes a limiter.
> If the "What" is processing the data (e.g., perf top) we should be able to
> come up with some design that at least pulls the data into memory so the
> buffer never fills.
> 
> Sure there would need to be some progress limiters put to keep the kernel
> side from killing a cpu but I think this kind of design has the best chance
> of getting the most information for this class of problem.
> 
> And then for all of the much smaller more typical perf use cases this kind
> of data collection is much less expensive than walking proc. taskdiag shows
> that and this design is faster and more efficient than taskdiag.

Definetely, if we can avoid looking at /proc for what we need, that
would be better. Hope you can continue working on that or that someone
else picks the baton and get that to a mergeable form.

But in extreme cases, not even that would work.

- Arnaldo

      reply	other threads:[~2015-10-27 14:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23 18:52 Issue perf attaching to processes creating many short-live threads William Cohen
2015-10-23 18:56 ` David Ahern
2015-10-23 19:27   ` William Cohen
2015-10-23 19:35     ` David Ahern
2015-10-26 19:49       ` Arnaldo Carvalho de Melo
2015-10-26 21:42         ` David Ahern
2015-10-27 12:33           ` Arnaldo Carvalho de Melo
2015-10-27 14:15             ` David Ahern
2015-10-27 14:47               ` Arnaldo Carvalho de Melo [this message]

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=20151027144746.GF9405@kernel.org \
    --to=arnaldo.melo@gmail.com \
    --cc=dsahern@gmail.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=oprofile-list@lists.sourceforge.net \
    --cc=rei.odaira@gmail.com \
    --cc=wcohen@redhat.com \
    /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).