mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Liang, Kan" <kan.liang@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"eranian@google.com" <eranian@google.com>,
	"ak@linux.intel.com" <ak@linux.intel.com>
Subject: Re: [PATCH 1/1] perf, core: Use sample period avg as child event's initial period
Date: Tue, 16 Dec 2014 13:35:58 +0100	[thread overview]
Message-ID: <20141216123558.GX3337@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F0770168DAE9@SHSMSX103.ccr.corp.intel.com>

On Mon, Dec 15, 2014 at 09:17:33PM +0000, Liang, Kan wrote:
> > This doesn't seem to make any kind of sense, and its weirdly implemented.
> >
> > So why would you push anything to the original parent? Your description
> > states that the parent event usually has 1, and then you argue about fixing
> > that by using the orig parent, but then you need to update the orig parent.
> > Did you go in circles and confuse yourself? Why not push things into the
> > regular parent event if you're going to push things up.
> 
> My thought is that the original parent is the root of the tree.

No parent is the root; I thought your orig parent thing was the event
you forked from, but now I see its not.

See inherit_event(), event->parent is the root event.

> If there is an
> average sample period for nodes, it should be kept in the root node, since
> it's the only node everyone knows.

Right, but, that's also contention central..

> > Also, since you can have multiple child events, on many CPUs local64_t is
> > the wrong data type, furthermore its going to be a scalability issue on big
> > hardware.
> 
> I'd like to have avg_sample_period for each CPU. The similar usage is
> period_left in hw_perf_event.

Well, some events are per cpu, some are per task. The per task events do
not have per-cpu storage and their parent can be on whatever cpu.

> We don't need to share the avg_sample_period between CPUs, after all
> it's only a reference.

Right, some smarts are needed to avoid the worst contention there. Maybe
a jiffy timestamp and don't update more than once every HZ jiffies or
so.

  reply	other threads:[~2014-12-16 12:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-12 15:10 kan.liang
2014-12-15  9:55 ` Peter Zijlstra
2014-12-15 21:17   ` Liang, Kan
2014-12-16 12:35     ` Peter Zijlstra [this message]
2014-12-16 16:05       ` Liang, Kan

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=20141216123558.GX3337@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®