Re: perf: race with automatic rdpmc() disabling

2017-03-15 Thread Vince Weaver
On Wed, 15 Mar 2017, Andy Lutomirski wrote: > Can you give this a try: > > https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?h=x86/fixes=9edb8154863ba1a7f6f1f15ffe6aecf3cf32bf21 > > (The link doesn't work yet but it should in a minute or two.) I've tested it and I am

Re: perf: race with automatic rdpmc() disabling

2017-03-15 Thread Vince Weaver
On Wed, 15 Mar 2017, Andy Lutomirski wrote: > Can you give this a try: > > https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?h=x86/fixes=9edb8154863ba1a7f6f1f15ffe6aecf3cf32bf21 > > (The link doesn't work yet but it should in a minute or two.) I've tested it and I am

Re: perf: race with automatic rdpmc() disabling

2017-03-15 Thread Andy Lutomirski
On Tue, Mar 14, 2017 at 9:45 AM, Vince Weaver wrote: > On Tue, 14 Mar 2017, Andy Lutomirski wrote: > >> On Mon, Mar 13, 2017 at 2:05 PM, Andy Lutomirski wrote: >> > On Mon, Mar 13, 2017 at 9:55 AM, Peter Zijlstra >> > wrote: >>

Re: perf: race with automatic rdpmc() disabling

2017-03-15 Thread Andy Lutomirski
On Tue, Mar 14, 2017 at 9:45 AM, Vince Weaver wrote: > On Tue, 14 Mar 2017, Andy Lutomirski wrote: > >> On Mon, Mar 13, 2017 at 2:05 PM, Andy Lutomirski wrote: >> > On Mon, Mar 13, 2017 at 9:55 AM, Peter Zijlstra >> > wrote: >> >> On Mon, Mar 13, 2017 at 09:44:02AM -0700, Andy Lutomirski

Re: perf: race with automatic rdpmc() disabling

2017-03-14 Thread Vince Weaver
On Tue, 14 Mar 2017, Andy Lutomirski wrote: > On Mon, Mar 13, 2017 at 2:05 PM, Andy Lutomirski wrote: > > On Mon, Mar 13, 2017 at 9:55 AM, Peter Zijlstra > > wrote: > >> On Mon, Mar 13, 2017 at 09:44:02AM -0700, Andy Lutomirski wrote: > >>> static void

Re: perf: race with automatic rdpmc() disabling

2017-03-14 Thread Vince Weaver
On Tue, 14 Mar 2017, Andy Lutomirski wrote: > On Mon, Mar 13, 2017 at 2:05 PM, Andy Lutomirski wrote: > > On Mon, Mar 13, 2017 at 9:55 AM, Peter Zijlstra > > wrote: > >> On Mon, Mar 13, 2017 at 09:44:02AM -0700, Andy Lutomirski wrote: > >>> static void x86_pmu_event_mapped(struct perf_event

Re: perf: race with automatic rdpmc() disabling

2017-03-14 Thread Andy Lutomirski
On Mon, Mar 13, 2017 at 2:05 PM, Andy Lutomirski wrote: > On Mon, Mar 13, 2017 at 9:55 AM, Peter Zijlstra wrote: >> On Mon, Mar 13, 2017 at 09:44:02AM -0700, Andy Lutomirski wrote: >>> static void x86_pmu_event_mapped(struct perf_event *event) >>> { >>>

Re: perf: race with automatic rdpmc() disabling

2017-03-14 Thread Andy Lutomirski
On Mon, Mar 13, 2017 at 2:05 PM, Andy Lutomirski wrote: > On Mon, Mar 13, 2017 at 9:55 AM, Peter Zijlstra wrote: >> On Mon, Mar 13, 2017 at 09:44:02AM -0700, Andy Lutomirski wrote: >>> static void x86_pmu_event_mapped(struct perf_event *event) >>> { >>> if (!(event->hw.flags &

Re: perf: race with automatic rdpmc() disabling

2017-03-13 Thread Andy Lutomirski
On Mon, Mar 13, 2017 at 9:55 AM, Peter Zijlstra wrote: > On Mon, Mar 13, 2017 at 09:44:02AM -0700, Andy Lutomirski wrote: >> static void x86_pmu_event_mapped(struct perf_event *event) >> { >> if (!(event->hw.flags & PERF_X86_EVENT_RDPMC_ALLOWED)) >> return; >> >>

Re: perf: race with automatic rdpmc() disabling

2017-03-13 Thread Andy Lutomirski
On Mon, Mar 13, 2017 at 9:55 AM, Peter Zijlstra wrote: > On Mon, Mar 13, 2017 at 09:44:02AM -0700, Andy Lutomirski wrote: >> static void x86_pmu_event_mapped(struct perf_event *event) >> { >> if (!(event->hw.flags & PERF_X86_EVENT_RDPMC_ALLOWED)) >> return; >> >> if

Re: perf: race with automatic rdpmc() disabling

2017-03-13 Thread Peter Zijlstra
On Mon, Mar 13, 2017 at 09:44:02AM -0700, Andy Lutomirski wrote: > static void x86_pmu_event_mapped(struct perf_event *event) > { > if (!(event->hw.flags & PERF_X86_EVENT_RDPMC_ALLOWED)) > return; > > if (atomic_inc_return(>mm->context.perf_rdpmc_allowed) == 1) > > <-- thread 1

Re: perf: race with automatic rdpmc() disabling

2017-03-13 Thread Peter Zijlstra
On Mon, Mar 13, 2017 at 09:44:02AM -0700, Andy Lutomirski wrote: > static void x86_pmu_event_mapped(struct perf_event *event) > { > if (!(event->hw.flags & PERF_X86_EVENT_RDPMC_ALLOWED)) > return; > > if (atomic_inc_return(>mm->context.perf_rdpmc_allowed) == 1) > > <-- thread 1

Re: perf: race with automatic rdpmc() disabling

2017-03-13 Thread Andy Lutomirski
On Mon, Mar 13, 2017 at 6:58 AM, Vince Weaver wrote: > Hello > > I've been trying to track this issue down for a few days and haven't been > able to isolate it. So maybe someone who understands low-level perf mmap > reference counting can help here. > > As you might

Re: perf: race with automatic rdpmc() disabling

2017-03-13 Thread Andy Lutomirski
On Mon, Mar 13, 2017 at 6:58 AM, Vince Weaver wrote: > Hello > > I've been trying to track this issue down for a few days and haven't been > able to isolate it. So maybe someone who understands low-level perf mmap > reference counting can help here. > > As you might recall,

perf: race with automatic rdpmc() disabling

2017-03-13 Thread Vince Weaver
Hello I've been trying to track this issue down for a few days and haven't been able to isolate it. So maybe someone who understands low-level perf mmap reference counting can help here. As you might recall, 7911d3f7af14a614617e38245fedf98a724e46a9 introduced automatic disabling of userspace

perf: race with automatic rdpmc() disabling

2017-03-13 Thread Vince Weaver
Hello I've been trying to track this issue down for a few days and haven't been able to isolate it. So maybe someone who understands low-level perf mmap reference counting can help here. As you might recall, 7911d3f7af14a614617e38245fedf98a724e46a9 introduced automatic disabling of userspace