All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: Fix inheritance of aux_output groups
@ 2019-10-04 12:57 Alexander Shishkin
  2019-10-07 14:49 ` Ingo Molnar
  2019-10-07 14:55 ` [tip: perf/urgent] perf/core: " tip-bot2 for Alexander Shishkin
  0 siblings, 2 replies; 4+ messages in thread
From: Alexander Shishkin @ 2019-10-04 12:57 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, linux-kernel, Alexander Shishkin

Commit

  b43762ef010 ("perf: Allow normal events to output AUX data")

forgets to configure aux_output relation in the inherited groups, which
results in child PEBS events forever failing to schedule.

Fix this by setting up the AUX output link in the inheritance path.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 kernel/events/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index f5bb2557d5f6..761995f21b30 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -12024,6 +12024,10 @@ static int inherit_group(struct perf_event *parent_event,
 					    child, leader, child_ctx);
 		if (IS_ERR(child_ctr))
 			return PTR_ERR(child_ctr);
+
+		if (sub->aux_event == parent_event &&
+		    !perf_get_aux_event(child_ctr, leader))
+			return -EINVAL;
 	}
 	return 0;
 }
-- 
2.23.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf: Fix inheritance of aux_output groups
  2019-10-04 12:57 [PATCH] perf: Fix inheritance of aux_output groups Alexander Shishkin
@ 2019-10-07 14:49 ` Ingo Molnar
  2019-10-07 15:01   ` Alexander Shishkin
  2019-10-07 14:55 ` [tip: perf/urgent] perf/core: " tip-bot2 for Alexander Shishkin
  1 sibling, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2019-10-07 14:49 UTC (permalink / raw)
  To: Alexander Shishkin
  Cc: Peter Zijlstra, Arnaldo Carvalho de Melo, Ingo Molnar, linux-kernel


* Alexander Shishkin <alexander.shishkin@linux.intel.com> wrote:

> Commit
> 
>   b43762ef010 ("perf: Allow normal events to output AUX data")

Missing 'a', the proper SHA1 is:

    ab43762ef010 ("perf: Allow normal events to output AUX data")

:-)

> forgets to configure aux_output relation in the inherited groups, which
> results in child PEBS events forever failing to schedule.
> 
> Fix this by setting up the AUX output link in the inheritance path.
> 
> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> ---
>  kernel/events/core.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index f5bb2557d5f6..761995f21b30 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -12024,6 +12024,10 @@ static int inherit_group(struct perf_event *parent_event,
>  					    child, leader, child_ctx);
>  		if (IS_ERR(child_ctr))
>  			return PTR_ERR(child_ctr);
> +
> +		if (sub->aux_event == parent_event &&
> +		    !perf_get_aux_event(child_ctr, leader))
> +			return -EINVAL;

Could this explain weird 'perf top' failures I'm seeing on my desktop, 
which I was just about to debug and report?

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip: perf/urgent] perf/core: Fix inheritance of aux_output groups
  2019-10-04 12:57 [PATCH] perf: Fix inheritance of aux_output groups Alexander Shishkin
  2019-10-07 14:49 ` Ingo Molnar
@ 2019-10-07 14:55 ` tip-bot2 for Alexander Shishkin
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot2 for Alexander Shishkin @ 2019-10-07 14:55 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Alexander Shishkin, Arnaldo Carvalho de Melo, Linus Torvalds,
	Peter Zijlstra, Peter Zijlstra, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, linux-kernel

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     f733c6b508bcaa3441ba1eacf16efb9abd47489f
Gitweb:        https://git.kernel.org/tip/f733c6b508bcaa3441ba1eacf16efb9abd47489f
Author:        Alexander Shishkin <alexander.shishkin@linux.intel.com>
AuthorDate:    Fri, 04 Oct 2019 15:57:29 +03:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 07 Oct 2019 16:50:42 +02:00

perf/core: Fix inheritance of aux_output groups

Commit:

  ab43762ef010 ("perf: Allow normal events to output AUX data")

forgets to configure aux_output relation in the inherited groups, which
results in child PEBS events forever failing to schedule.

Fix this by setting up the AUX output link in the inheritance path.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20191004125729.32397-1-alexander.shishkin@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/events/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 3f0cb82..f953dd1 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -11862,6 +11862,10 @@ static int inherit_group(struct perf_event *parent_event,
 					    child, leader, child_ctx);
 		if (IS_ERR(child_ctr))
 			return PTR_ERR(child_ctr);
+
+		if (sub->aux_event == parent_event &&
+		    !perf_get_aux_event(child_ctr, leader))
+			return -EINVAL;
 	}
 	return 0;
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf: Fix inheritance of aux_output groups
  2019-10-07 14:49 ` Ingo Molnar
@ 2019-10-07 15:01   ` Alexander Shishkin
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Shishkin @ 2019-10-07 15:01 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Peter Zijlstra, Arnaldo Carvalho de Melo, Ingo Molnar,
	linux-kernel, alexander.shishkin

Ingo Molnar <mingo@kernel.org> writes:

> * Alexander Shishkin <alexander.shishkin@linux.intel.com> wrote:
>
>> Commit
>> 
>>   b43762ef010 ("perf: Allow normal events to output AUX data")
>
> Missing 'a', the proper SHA1 is:
>
>     ab43762ef010 ("perf: Allow normal events to output AUX data")
>
> :-)

Ouch, sorry about that.

> Could this explain weird 'perf top' failures I'm seeing on my desktop, 
> which I was just about to debug and report?

Unlikely; to trigger the above you'd have to manually enable the
aux_output thingy and that would require HW support to begin with.

Thanks,
--
Alex

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-07 15:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-04 12:57 [PATCH] perf: Fix inheritance of aux_output groups Alexander Shishkin
2019-10-07 14:49 ` Ingo Molnar
2019-10-07 15:01   ` Alexander Shishkin
2019-10-07 14:55 ` [tip: perf/urgent] perf/core: " tip-bot2 for Alexander Shishkin

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.