linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Song Liu <songliubraving@fb.com>
Cc: open list <linux-kernel@vger.kernel.org>,
	Kernel Team <Kernel-team@fb.com>,
	"acme@kernel.org" <acme@kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Alexey Budankov <alexey.budankov@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>, Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH v6] perf: Sharing PMU counters across compatible events
Date: Tue, 5 Nov 2019 21:16:23 +0100	[thread overview]
Message-ID: <20191105201623.GG3079@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <98A6264C-B833-4930-95A0-2A3186519D87@fb.com>

On Tue, Nov 05, 2019 at 05:11:08PM +0000, Song Liu wrote:

> > I think we can use one of the event as master. We need to be careful when
> > the master event is removed, but it should be doable. Let me try. 
> 
> Actually, there is a bigger issue when we use one event as the master: what
> shall we do if the master event is not running? Say it is an cgroup event, 
> and the cgroup is not running on this cpu. An extra master (and all these
> array hacks) help us get O(1) complexity in such scenario. 
> 
> Do you have suggestions on how to solve this problem? Maybe we can keep the 
> extra master, and try get rid of the double alloc? 

Right, you have to consider scope when sharing. The master should be the
largest scope event and any slaves should be complete subsets.

Without much thought this seems a fairly straight forward constraint;
that is, given cgroups I'm not immediately seeing how we can violate
that.

Basically, pick the cgroup event nearest to the root as the master.
We have to have logic to re-elect the master anyway for deletion, so
changing it on add shouldn't be different.

(obviously the root-cgroup is cpu-wide and always on, and if you have
two events from disjoint subtrees they have no overlap, so it doesn't
make sense to share anyway)


  reply	other threads:[~2019-11-05 20:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-19  5:23 [PATCH v6] perf: Sharing PMU counters across compatible events Song Liu
2019-09-30  5:36 ` Song Liu
2019-10-31 12:43 ` Peter Zijlstra
2019-10-31 16:29   ` Song Liu
2019-11-05 17:11     ` Song Liu
2019-11-05 20:16       ` Peter Zijlstra [this message]
2019-11-05 23:06         ` Song Liu
2019-11-06  9:14           ` Peter Zijlstra
2019-11-06 17:40             ` Song Liu
2019-11-06 20:44               ` Peter Zijlstra
2019-11-06 22:23                 ` Song Liu
2019-11-05 23:51 ` Song Liu
2019-11-06  8:56   ` Peter Zijlstra

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=20191105201623.GG3079@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=Kernel-team@fb.com \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=alexey.budankov@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=songliubraving@fb.com \
    --cc=tj@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;
as well as URLs for NNTP newsgroup(s).