Re: [PATCH] perf/core: fix multiplexing event scheduling issue

2019-10-23 Thread Stephane Eranian
On Wed, Oct 23, 2019 at 4:02 AM Peter Zijlstra wrote: > > On Wed, Oct 23, 2019 at 12:30:03AM -0700, Stephane Eranian wrote: > > On Mon, Oct 21, 2019 at 3:21 AM Peter Zijlstra wrote: > > > > > > On Thu, Oct 17, 2019 at 05:27:46PM -0700, Stephane Eranian wrote: > > > > This patch complements the fo

Re: [PATCH] perf/core: fix multiplexing event scheduling issue

2019-10-23 Thread Peter Zijlstra
On Wed, Oct 23, 2019 at 11:37:57AM +0200, Peter Zijlstra wrote: > Further, since we set it on reschedule, I propose you change the above > like: > > if (ctx->rotate_necessary) { > int type = get_event_type(event); > /* >* comment.. >

Re: [PATCH] perf/core: fix multiplexing event scheduling issue

2019-10-23 Thread Peter Zijlstra
On Wed, Oct 23, 2019 at 12:30:03AM -0700, Stephane Eranian wrote: > On Mon, Oct 21, 2019 at 3:21 AM Peter Zijlstra wrote: > > > > On Thu, Oct 17, 2019 at 05:27:46PM -0700, Stephane Eranian wrote: > > > This patch complements the following commit: > > > 7fa343b7fdc4 ("perf/core: Fix corner case in

Re: [PATCH] perf/core: fix multiplexing event scheduling issue

2019-10-23 Thread Peter Zijlstra
On Wed, Oct 23, 2019 at 12:06:43AM -0700, Stephane Eranian wrote: > On Mon, Oct 21, 2019 at 3:06 AM Peter Zijlstra wrote: > > On Thu, Oct 17, 2019 at 05:27:46PM -0700, Stephane Eranian wrote: > > > + * others removed. There is a way to get removed and not be > > > disabled first. > > > +

Re: [PATCH] perf/core: fix multiplexing event scheduling issue

2019-10-23 Thread Stephane Eranian
On Mon, Oct 21, 2019 at 3:21 AM Peter Zijlstra wrote: > > On Thu, Oct 17, 2019 at 05:27:46PM -0700, Stephane Eranian wrote: > > This patch complements the following commit: > > 7fa343b7fdc4 ("perf/core: Fix corner case in perf_rotate_context()") > > > > The fix from Song addresses the consequences

Re: [PATCH] perf/core: fix multiplexing event scheduling issue

2019-10-23 Thread Stephane Eranian
On Mon, Oct 21, 2019 at 3:06 AM Peter Zijlstra wrote: > > On Thu, Oct 17, 2019 at 05:27:46PM -0700, Stephane Eranian wrote: > > @@ -2153,6 +2157,7 @@ __perf_remove_from_context(struct perf_event *event, > > void *info) > > { > > unsigned long flags = (unsigned long)

Re: [PATCH] perf/core: fix multiplexing event scheduling issue

2019-10-21 Thread Peter Zijlstra
On Thu, Oct 17, 2019 at 05:27:46PM -0700, Stephane Eranian wrote: > This patch complements the following commit: > 7fa343b7fdc4 ("perf/core: Fix corner case in perf_rotate_context()") > > The fix from Song addresses the consequences of the problem but > not the cause. This patch fixes the causes a

Re: [PATCH] perf/core: fix multiplexing event scheduling issue

2019-10-21 Thread Peter Zijlstra
On Thu, Oct 17, 2019 at 05:27:46PM -0700, Stephane Eranian wrote: > @@ -2153,6 +2157,7 @@ __perf_remove_from_context(struct perf_event *event, > void *info) > { > unsigned long flags = (unsigned long)info; > + int was_necessary = ctx->rotate_necessary; > >

Re: [PATCH] perf/core: fix multiplexing event scheduling issue

2019-10-17 Thread Song Liu
> On Oct 17, 2019, at 11:19 PM, Stephane Eranian wrote: > > On Thu, Oct 17, 2019 at 11:13 PM Song Liu wrote: >> >> >> >>> On Oct 17, 2019, at 5:27 PM, Stephane Eranian wrote: >>> >>> This patch complements the following commit: >>> 7fa343b7fdc4 ("perf/core: Fix corner case in perf_rotate

Re: [PATCH] perf/core: fix multiplexing event scheduling issue

2019-10-17 Thread Stephane Eranian
On Thu, Oct 17, 2019 at 11:13 PM Song Liu wrote: > > > > > On Oct 17, 2019, at 5:27 PM, Stephane Eranian wrote: > > > > This patch complements the following commit: > > 7fa343b7fdc4 ("perf/core: Fix corner case in perf_rotate_context()") > > > > The fix from Song addresses the consequences of the

Re: [PATCH] perf/core: fix multiplexing event scheduling issue

2019-10-17 Thread Song Liu
> On Oct 17, 2019, at 5:27 PM, Stephane Eranian wrote: > > This patch complements the following commit: > 7fa343b7fdc4 ("perf/core: Fix corner case in perf_rotate_context()") > > The fix from Song addresses the consequences of the problem but > not the cause. This patch fixes the causes and c

[PATCH] perf/core: fix multiplexing event scheduling issue

2019-10-17 Thread Stephane Eranian
This patch complements the following commit: 7fa343b7fdc4 ("perf/core: Fix corner case in perf_rotate_context()") The fix from Song addresses the consequences of the problem but not the cause. This patch fixes the causes and can sit on top of Song's patch. This patch fixes a scheduling problem in