All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-kernel@vger.kernel.org,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Zhou Chengming <zhouchengming1@huawei.com>
Subject: Re: [PATCH] perf/core: fix group {cpu,task} validation
Date: Mon, 21 Aug 2017 17:53:26 +0200	[thread overview]
Message-ID: <20170821155326.bbmpn62rcr64274p@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <1498142498-15758-1-git-send-email-mark.rutland@arm.com>

On Thu, Jun 22, 2017 at 03:41:38PM +0100, Mark Rutland wrote:
> Regardless of which events form a group, it does not make sense for the
> events to target different tasks and/or CPUs, as this leaves the group
> inconsistent and impossible to schedule. The core perf code assumes that
> these are consistent across (successfully intialised) groups.
> 
> Core perf code only verifies this when moving SW events into a HW
> context. Thus, we can violate this requirement for pure SW groups and
> pure HW groups, unless the relevant PMU driver happens to perform this
> verification itself. These mismatched groups subsequently wreak havoc
> elsewhere.
> 
> For example, we handle watchpoints as SW events, and reserve watchpoint
> HW on a per-cpu basis at pmu::event_init() time to ensure that any event
> that is initialised is guaranteed to have a slot at pmu::add() time.
> However, the core code only checks the group leader's cpu filter (via
> event_filter_match()), and can thus install follower events onto CPUs
> violating thier (mismatched) CPU filters, potentially installing them
> into a CPU without sufficient reserved slots.
> 

> 
> Fix this by validating this requirement regardless of whether we're
> moving events.

Yes, and this also appears to cure your other problem:

  https://lkml.kernel.org/r/20170810173551.GD12812@leverpostej


Thanks!

  parent reply	other threads:[~2017-08-21 15:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-22 14:41 [PATCH] perf/core: fix group {cpu,task} validation Mark Rutland
2017-06-23  0:56 ` zhouchengming
2017-06-23 10:07   ` Mark Rutland
2017-08-21 15:53 ` Peter Zijlstra [this message]
2017-08-21 16:01   ` Mark Rutland
2017-08-21 16:08     ` Peter Zijlstra
2017-08-25 11:51 ` [tip:perf/core] perf/core: Fix " tip-bot for Mark Rutland

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=20170821155326.bbmpn62rcr64274p@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=zhouchengming1@huawei.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 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.