Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1346208

RE: [BUG] Core2 cpu triggers hard lockup with perf test

From "Liang, Kan" <kan.liang@intel.com>
Newsgroups linux.kernel
Subject RE: [BUG] Core2 cpu triggers hard lockup with perf test
Date 2016-02-29 23:20 +0100
Message-ID <r7Eky-tv-19@gated-at.bofh.it> (permalink)
References <r6Mka-2Wn-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



> 
> I can't find what's special about Core2 CPU PEBS setup, it seems that oher
> CPUs are ok (tried on ivb/snb/hsw).
> 
> reverting the 156174999dd1 fixed the issue for me
> 
> ideas? thanks,

I think we may just disable the multiple pebs support for core2
as the patch below.

In SDM "18.4.4.4 Re-configuring PEBS Facilities" it mentioned that
a quiescent period is needed between stopping the prior event counting and
setting up a new PEBS event when software needs to reconfigure PEBS facilities.
The quiescent period is to allow any latent residual PEBS records to complete
its capture at their previously specified buffer address
That requirement only can be found in Core Microarchitecture. 

I think it may implies that there is some observed delay in writing PEBS buffer.
So if perf record precise hw event with very small period, the slow PEBS writing
may lockup the CPU. If so, I think disabling the multiple pebs should be a good
way.


---
 arch/x86/events/intel/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 8fddb02..a56230f 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -2577,8 +2577,8 @@ static int intel_pmu_hw_config(struct perf_event *event)
 	if (event->attr.precise_ip) {
 		if (!event->attr.freq) {
 			event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD;
-			if (!(event->attr.sample_type &
-			      ~intel_pmu_free_running_flags(event)))
+			if ((x86_pmu.intel_cap.pebs_format > 0) &&
+			    !(event->attr.sample_type & ~intel_pmu_free_running_flags(event)))
 				event->hw.flags |= PERF_X86_EVENT_FREERUNNING;
 		}
 		if (x86_pmu.pebs_aliases)
-- 
2.5.0

Thanks,
Kan

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[BUG] Core2 cpu triggers hard lockup with perf test Jiri Olsa <jolsa@redhat.com> - 2016-02-27 13:40 +0100
  Re: [BUG] Core2 cpu triggers hard lockup with perf test Peter Zijlstra <peterz@infradead.org> - 2016-02-27 15:50 +0100
  Re: [BUG] Core2 cpu triggers hard lockup with perf test Andi Kleen <andi@firstfloor.org> - 2016-02-27 16:50 +0100
  RE: [BUG] Core2 cpu triggers hard lockup with perf test "Liang, Kan" <kan.liang@intel.com> - 2016-02-29 23:20 +0100
    Re: [BUG] Core2 cpu triggers hard lockup with perf test Jiri Olsa <jolsa@redhat.com> - 2016-03-01 08:00 +0100
    Re: [BUG] Core2 cpu triggers hard lockup with perf test Peter Zijlstra <peterz@infradead.org> - 2016-03-01 10:20 +0100
      Re: [BUG] Core2 cpu triggers hard lockup with perf test Jiri Olsa <jolsa@redhat.com> - 2016-03-01 12:10 +0100
        Re: [BUG] Core2 cpu triggers hard lockup with perf test Peter Zijlstra <peterz@infradead.org> - 2016-03-01 12:30 +0100
        Re: [BUG] Core2 cpu triggers hard lockup with perf test Andi Kleen <andi@firstfloor.org> - 2016-03-01 16:00 +0100
          Re: [BUG] Core2 cpu triggers hard lockup with perf test Peter Zijlstra <peterz@infradead.org> - 2016-03-01 16:00 +0100
            Re: [BUG] Core2 cpu triggers hard lockup with perf test Jiri Olsa <jolsa@redhat.com> - 2016-03-01 18:20 +0100
              Re: [BUG] Core2 cpu triggers hard lockup with perf test Andi Kleen <andi@firstfloor.org> - 2016-03-01 18:40 +0100
              Re: [BUG] Core2 cpu triggers hard lockup with perf test Peter Zijlstra <peterz@infradead.org> - 2016-03-01 18:50 +0100
                Re: [BUG] Core2 cpu triggers hard lockup with perf test Jiri Olsa <jolsa@redhat.com> - 2016-03-01 19:10 +0100
                Re: [BUG] Core2 cpu triggers hard lockup with perf test Peter Zijlstra <peterz@infradead.org> - 2016-03-01 19:20 +0100
              Re: [BUG] Core2 cpu triggers hard lockup with perf test Peter Zijlstra <peterz@infradead.org> - 2016-03-01 19:20 +0100
                [PATCH] perf x86: Use PAGE_SIZE for PEBS buffer size on Core2 Jiri Olsa <jolsa@redhat.com> - 2016-03-01 20:10 +0100

csiph-web