Re: [PATCH v2 2/5] perf: Free aux pages in unmap path

2016-03-23 Thread Peter Zijlstra
On Thu, Mar 17, 2016 at 03:05:42PM +0200, Alexander Shishkin wrote: > > We should be able to send IPIs with rcu_read_lock() held; > Ok, so how about this one instead. Looks good, thanks!

Re: [PATCH v2 2/5] perf: Free aux pages in unmap path

2016-03-23 Thread Peter Zijlstra
On Thu, Mar 17, 2016 at 03:05:42PM +0200, Alexander Shishkin wrote: > > We should be able to send IPIs with rcu_read_lock() held; > Ok, so how about this one instead. Looks good, thanks!

Re: [PATCH v2 2/5] perf: Free aux pages in unmap path

2016-03-19 Thread Alexander Shishkin
Peter Zijlstra writes: > On Mon, Mar 14, 2016 at 04:04:44PM +0200, Alexander Shishkin wrote: >> Peter Zijlstra writes: > >> >> +static void perf_pmu_output_stop(struct perf_event *event) >> >> +{ >> >> + int cpu, err; >> >> + >> >> + /* better be

Re: [PATCH v2 2/5] perf: Free aux pages in unmap path

2016-03-19 Thread Alexander Shishkin
Peter Zijlstra writes: > On Mon, Mar 14, 2016 at 04:04:44PM +0200, Alexander Shishkin wrote: >> Peter Zijlstra writes: > >> >> +static void perf_pmu_output_stop(struct perf_event *event) >> >> +{ >> >> + int cpu, err; >> >> + >> >> + /* better be thorough */ >> >> + get_online_cpus(); >> >>

Re: [PATCH v2 2/5] perf: Free aux pages in unmap path

2016-03-14 Thread Peter Zijlstra
On Mon, Mar 14, 2016 at 04:04:44PM +0200, Alexander Shishkin wrote: > Peter Zijlstra writes: > >> +static void perf_pmu_output_stop(struct perf_event *event) > >> +{ > >> + int cpu, err; > >> + > >> + /* better be thorough */ > >> + get_online_cpus(); > >> +restart: > >>

Re: [PATCH v2 2/5] perf: Free aux pages in unmap path

2016-03-14 Thread Peter Zijlstra
On Mon, Mar 14, 2016 at 04:04:44PM +0200, Alexander Shishkin wrote: > Peter Zijlstra writes: > >> +static void perf_pmu_output_stop(struct perf_event *event) > >> +{ > >> + int cpu, err; > >> + > >> + /* better be thorough */ > >> + get_online_cpus(); > >> +restart: > >> +

Re: [PATCH v2 2/5] perf: Free aux pages in unmap path

2016-03-14 Thread Alexander Shishkin
Peter Zijlstra writes: > On Fri, Mar 04, 2016 at 03:42:46PM +0200, Alexander Shishkin wrote: >> @@ -4649,10 +4679,22 @@ static void perf_mmap_close(struct vm_area_struct >> *vma) >> */ >> if (rb_has_aux(rb) && vma->vm_pgoff == rb->aux_pgoff && >>

Re: [PATCH v2 2/5] perf: Free aux pages in unmap path

2016-03-14 Thread Alexander Shishkin
Peter Zijlstra writes: > On Fri, Mar 04, 2016 at 03:42:46PM +0200, Alexander Shishkin wrote: >> @@ -4649,10 +4679,22 @@ static void perf_mmap_close(struct vm_area_struct >> *vma) >> */ >> if (rb_has_aux(rb) && vma->vm_pgoff == rb->aux_pgoff && >>

Re: [PATCH v2 2/5] perf: Free aux pages in unmap path

2016-03-14 Thread Peter Zijlstra
On Fri, Mar 04, 2016 at 03:42:46PM +0200, Alexander Shishkin wrote: > @@ -4649,10 +4679,22 @@ static void perf_mmap_close(struct vm_area_struct > *vma) >*/ > if (rb_has_aux(rb) && vma->vm_pgoff == rb->aux_pgoff && > atomic_dec_and_mutex_lock(>aux_mmap_count, >mmap_mutex))

Re: [PATCH v2 2/5] perf: Free aux pages in unmap path

2016-03-14 Thread Peter Zijlstra
On Fri, Mar 04, 2016 at 03:42:46PM +0200, Alexander Shishkin wrote: > @@ -4649,10 +4679,22 @@ static void perf_mmap_close(struct vm_area_struct > *vma) >*/ > if (rb_has_aux(rb) && vma->vm_pgoff == rb->aux_pgoff && > atomic_dec_and_mutex_lock(>aux_mmap_count, >mmap_mutex))

[PATCH v2 2/5] perf: Free aux pages in unmap path

2016-03-04 Thread Alexander Shishkin
Now that we can ensure that when ring buffer's aux area is on the way to getting unmapped new transactions won't start, we only need to stop all events that can potentially be writing aux data to our ring buffer. Having done that, we can safely free the aux pages and corresponding pmu data, as

[PATCH v2 2/5] perf: Free aux pages in unmap path

2016-03-04 Thread Alexander Shishkin
Now that we can ensure that when ring buffer's aux area is on the way to getting unmapped new transactions won't start, we only need to stop all events that can potentially be writing aux data to our ring buffer. Having done that, we can safely free the aux pages and corresponding pmu data, as