public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: kan.liang@intel.com, mingo@redhat.com,
	linux-kernel@vger.kernel.org, acme@kernel.org,
	tglx@linutronix.de, alexander.shishkin@linux.intel.com,
	vince@deater.net, eranian@google.com, andi@firstfloor.org
Subject: Re: [PATCH] perf/core: introduce context per CPU event list
Date: Thu, 10 Nov 2016 14:10:37 +0000	[thread overview]
Message-ID: <20161110141037.GE4418@leverpostej> (raw)
In-Reply-To: <20161110125804.GT3117@twins.programming.kicks-ass.net>

On Thu, Nov 10, 2016 at 01:58:04PM +0100, Peter Zijlstra wrote:
> On Thu, Nov 10, 2016 at 12:26:18PM +0000, Mark Rutland wrote:
> > On Thu, Nov 10, 2016 at 01:12:53PM +0100, Peter Zijlstra wrote:
> 
> > > Ah, so the tree would in fact only contain 'INACTIVE' events :-)
> > 
> > Ah. :)
> > 
> > That explains some of the magic, but...
> > 
> > > That is, when no events are on the hardware, all events (if there are
> > > any) are INACTIVE.
> > > 
> > > Then on sched-in, we find the relevant subtree, and linearly try and
> > > program all events from that subtree onto the PMU. Once adding an event
> > > fails programming, we stop (like we do now).
> > > 
> > > These programmed events transition from INACTIVE to ACTIVE, and we take
> > > them out of the tree.
> > > 
> > > Then on sched-out, we remove all events from the hardware, increase the
> > > events their runtime value by however long they were ACTIVE, flip them
> > > to INACTIVE and stuff them back in the tree.
> > 
> > ... per the above, won't the tree also contain 'OFF' events (and
> > 'ERROR', etc)?
> > 
> > ... or do we keep them somewhere else (another list or sub-tree)?
> 
> I don't think those need be tracked at all, they're immaterial for
> actual scheduling. Once we ioctl() them back to life we can insert them
> into the tree.

Sure, that sounds fine for scheduling (including big.LITTLE).

I might still be misunderstanding something, but I don't think that
helps Kan's case: since INACTIVE events which will fail their filters
(including the CPU check) will still be in the tree, they will still
have to be iterated over.

That is, unless we also sort the tree by event->cpu, or if in those
cases we only care about ACTIVE events and can use an active list.

Thanks,
Mark.

  reply	other threads:[~2016-11-10 14:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-09 19:04 [PATCH] perf/core: introduce context per CPU event list kan.liang
2016-11-10  8:33 ` Peter Zijlstra
2016-11-10 11:05   ` Mark Rutland
2016-11-10 11:37     ` Peter Zijlstra
2016-11-10 12:04       ` Mark Rutland
2016-11-10 12:12         ` Peter Zijlstra
2016-11-10 12:26           ` Mark Rutland
2016-11-10 12:58             ` Peter Zijlstra
2016-11-10 14:10               ` Mark Rutland [this message]
2016-11-10 14:31                 ` Liang, Kan
2016-11-10 16:26                 ` Peter Zijlstra
2016-11-10 17:01                   ` Mark Rutland
     [not found] ` <1483302059-4334-1-git-send-email-davidcc@google.com>
2017-01-01 21:18   ` David Carrillo-Cisneros
2017-01-03 12:00     ` Mark Rutland
2017-01-04  0:39       ` David Carrillo-Cisneros

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=20161110141037.GE4418@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=eranian@google.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=vince@deater.net \
    /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