Re: [PATCH 1/3] perf: Optimize perf_install_in_event()

2019-10-23 Thread Peter Zijlstra
On Wed, Oct 23, 2019 at 03:44:44PM +0200, Peter Zijlstra wrote: > On Wed, Oct 23, 2019 at 03:30:27PM +0300, Alexander Shishkin wrote: > > Peter Zijlstra writes: > > > > > + /* > > > + * perf_event_attr::disabled events will not run and can be initialized > > > + * without IPI. Except when this

Re: [PATCH 1/3] perf: Optimize perf_install_in_event()

2019-10-23 Thread Peter Zijlstra
On Wed, Oct 23, 2019 at 03:30:27PM +0300, Alexander Shishkin wrote: > Peter Zijlstra writes: > > > + /* > > +* perf_event_attr::disabled events will not run and can be initialized > > +* without IPI. Except when this is the first event for the context, in > > +* that case we need

Re: [PATCH 1/3] perf: Optimize perf_install_in_event()

2019-10-23 Thread Alexander Shishkin
Peter Zijlstra writes: > + /* > + * perf_event_attr::disabled events will not run and can be initialized > + * without IPI. Except when this is the first event for the context, in > + * that case we need the magic of the IPI to set ctx->is_active. > + * > + * The

Re: [PATCH 1/3] perf: Optimize perf_install_in_event()

2019-10-22 Thread Peter Zijlstra
On Tue, Oct 22, 2019 at 11:20:18AM +0200, Peter Zijlstra wrote: > Andi reported that when creating a lot of events, a lot of time is > spend in IPIs and asked if it would be possible to elide some of that. > > Now when, as for example the perf-tool always does, events are created > disabled, then

[PATCH 1/3] perf: Optimize perf_install_in_event()

2019-10-22 Thread Peter Zijlstra
Andi reported that when creating a lot of events, a lot of time is spend in IPIs and asked if it would be possible to elide some of that. Now when, as for example the perf-tool always does, events are created disabled, then these events will not need to be scheduled when added to the context