Re: [PATCH 18/30] x86, kaiser: map virtually-addressed performance monitoring buffers

2017-11-15 Thread Peter Zijlstra
On Tue, Nov 14, 2017 at 11:10:23AM -0800, Hugh Dickins wrote: > I was about to agree, but now I'm not so sure. I don't know much > about these PMC things, but at a glance it looks like what is reserved > by x86_reserve_hardware() may later be released by x86_release_hardware(), > and then later

Re: [PATCH 18/30] x86, kaiser: map virtually-addressed performance monitoring buffers

2017-11-15 Thread Peter Zijlstra
On Tue, Nov 14, 2017 at 11:10:23AM -0800, Hugh Dickins wrote: > I was about to agree, but now I'm not so sure. I don't know much > about these PMC things, but at a glance it looks like what is reserved > by x86_reserve_hardware() may later be released by x86_release_hardware(), > and then later

Re: [PATCH 18/30] x86, kaiser: map virtually-addressed performance monitoring buffers

2017-11-14 Thread Andy Lutomirski
On Tue, Nov 14, 2017 at 11:10 AM, Hugh Dickins wrote: > On Tue, 14 Nov 2017, Dave Hansen wrote: >> On 11/14/2017 10:20 AM, Peter Zijlstra wrote: >> > On Fri, Nov 10, 2017 at 11:31:39AM -0800, Dave Hansen wrote: >> >> static int alloc_ds_buffer(int cpu) >> >> { >> >> + struct

Re: [PATCH 18/30] x86, kaiser: map virtually-addressed performance monitoring buffers

2017-11-14 Thread Andy Lutomirski
On Tue, Nov 14, 2017 at 11:10 AM, Hugh Dickins wrote: > On Tue, 14 Nov 2017, Dave Hansen wrote: >> On 11/14/2017 10:20 AM, Peter Zijlstra wrote: >> > On Fri, Nov 10, 2017 at 11:31:39AM -0800, Dave Hansen wrote: >> >> static int alloc_ds_buffer(int cpu) >> >> { >> >> + struct debug_store *ds =

Re: [PATCH 18/30] x86, kaiser: map virtually-addressed performance monitoring buffers

2017-11-14 Thread Hugh Dickins
On Tue, 14 Nov 2017, Dave Hansen wrote: > On 11/14/2017 10:20 AM, Peter Zijlstra wrote: > > On Fri, Nov 10, 2017 at 11:31:39AM -0800, Dave Hansen wrote: > >> static int alloc_ds_buffer(int cpu) > >> { > >> + struct debug_store *ds = per_cpu_ptr(_debug_store, cpu); > >> > >> + memset(ds, 0,

Re: [PATCH 18/30] x86, kaiser: map virtually-addressed performance monitoring buffers

2017-11-14 Thread Hugh Dickins
On Tue, 14 Nov 2017, Dave Hansen wrote: > On 11/14/2017 10:20 AM, Peter Zijlstra wrote: > > On Fri, Nov 10, 2017 at 11:31:39AM -0800, Dave Hansen wrote: > >> static int alloc_ds_buffer(int cpu) > >> { > >> + struct debug_store *ds = per_cpu_ptr(_debug_store, cpu); > >> > >> + memset(ds, 0,

Re: [PATCH 18/30] x86, kaiser: map virtually-addressed performance monitoring buffers

2017-11-14 Thread Dave Hansen
On 11/14/2017 10:20 AM, Peter Zijlstra wrote: > On Fri, Nov 10, 2017 at 11:31:39AM -0800, Dave Hansen wrote: >> static int alloc_ds_buffer(int cpu) >> { >> +struct debug_store *ds = per_cpu_ptr(_debug_store, cpu); >> >> +memset(ds, 0, sizeof(*ds)); > Still wondering about that

Re: [PATCH 18/30] x86, kaiser: map virtually-addressed performance monitoring buffers

2017-11-14 Thread Dave Hansen
On 11/14/2017 10:20 AM, Peter Zijlstra wrote: > On Fri, Nov 10, 2017 at 11:31:39AM -0800, Dave Hansen wrote: >> static int alloc_ds_buffer(int cpu) >> { >> +struct debug_store *ds = per_cpu_ptr(_debug_store, cpu); >> >> +memset(ds, 0, sizeof(*ds)); > Still wondering about that

Re: [PATCH 18/30] x86, kaiser: map virtually-addressed performance monitoring buffers

2017-11-14 Thread Peter Zijlstra
On Fri, Nov 10, 2017 at 11:31:39AM -0800, Dave Hansen wrote: > static int alloc_ds_buffer(int cpu) > { > + struct debug_store *ds = per_cpu_ptr(_debug_store, cpu); > > + memset(ds, 0, sizeof(*ds)); Still wondering about that memset... > per_cpu(cpu_hw_events, cpu).ds = ds; >

Re: [PATCH 18/30] x86, kaiser: map virtually-addressed performance monitoring buffers

2017-11-14 Thread Peter Zijlstra
On Fri, Nov 10, 2017 at 11:31:39AM -0800, Dave Hansen wrote: > static int alloc_ds_buffer(int cpu) > { > + struct debug_store *ds = per_cpu_ptr(_debug_store, cpu); > > + memset(ds, 0, sizeof(*ds)); Still wondering about that memset... > per_cpu(cpu_hw_events, cpu).ds = ds; >

Re: [PATCH 18/30] x86, kaiser: map virtually-addressed performance monitoring buffers

2017-11-10 Thread Peter Zijlstra
On Wed, Nov 08, 2017 at 11:47:20AM -0800, Dave Hansen wrote: > +static > +DEFINE_PER_CPU_SHARED_ALIGNED_USER_MAPPED(struct debug_store, > cpu_debug_store); > + > /* The size of a BTS record in bytes: */ > #define BTS_RECORD_SIZE 24 > > @@ -278,6 +282,39 @@ void

Re: [PATCH 18/30] x86, kaiser: map virtually-addressed performance monitoring buffers

2017-11-10 Thread Peter Zijlstra
On Wed, Nov 08, 2017 at 11:47:20AM -0800, Dave Hansen wrote: > +static > +DEFINE_PER_CPU_SHARED_ALIGNED_USER_MAPPED(struct debug_store, > cpu_debug_store); > + > /* The size of a BTS record in bytes: */ > #define BTS_RECORD_SIZE 24 > > @@ -278,6 +282,39 @@ void