From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Jiri Olsa <jolsa@kernel.org>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Andi Kleen <ak@linux.intel.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Kan Liang <kan.liang@intel.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Stephane Eranian <eranian@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Vince Weaver <vincent.weaver@maine.edu>,
Wang Nan <wangnan0@huawei.com>, Ingo Molnar <mingo@kernel.org>
Subject: [PATCH 3.14 75/76] perf/x86/intel: Use PAGE_SIZE for PEBS buffer size on Core2
Date: Sun, 10 Apr 2016 11:37:23 -0700 [thread overview]
Message-ID: <20160410183518.804821365@linuxfoundation.org> (raw)
In-Reply-To: <20160410183516.090999097@linuxfoundation.org>
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Olsa <jolsa@redhat.com>
commit 3135a66b768c5ee84c8a98b21d0330dc1c1234b4 upstream.
Using PAGE_SIZE buffers makes the WRMSR to PERF_GLOBAL_CTRL in
intel_pmu_enable_all() mysteriously hang on Core2. As a workaround, we
don't do this.
The hard lockup is easily triggered by running 'perf test attr'
repeatedly. Most of the time it gets stuck on sample session with
small periods.
# perf test attr -vv
14: struct perf_event_attr setup :
--- start ---
...
'PERF_TEST_ATTR=/tmp/tmpuEKz3B /usr/bin/perf record -o /tmp/tmpuEKz3B/perf.data -c 123 kill >/dev/null 2>&1' ret 1
Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20160301190352.GA8355@krava.redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kernel/cpu/perf_event.h | 1 +
arch/x86/kernel/cpu/perf_event_intel_ds.c | 13 +++++++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
--- a/arch/x86/kernel/cpu/perf_event.h
+++ b/arch/x86/kernel/cpu/perf_event.h
@@ -445,6 +445,7 @@ struct x86_pmu {
pebs_active :1,
pebs_broken :1;
int pebs_record_size;
+ int pebs_buffer_size;
void (*drain_pebs)(struct pt_regs *regs);
struct event_constraint *pebs_constraints;
void (*pebs_aliases)(struct perf_event *event);
--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -241,7 +241,7 @@ static int alloc_pebs_buffer(int cpu)
if (!x86_pmu.pebs)
return 0;
- buffer = kzalloc_node(PEBS_BUFFER_SIZE, GFP_KERNEL, node);
+ buffer = kzalloc_node(x86_pmu.pebs_buffer_size, GFP_KERNEL, node);
if (unlikely(!buffer))
return -ENOMEM;
@@ -258,7 +258,7 @@ static int alloc_pebs_buffer(int cpu)
per_cpu(insn_buffer, cpu) = ibuffer;
}
- max = PEBS_BUFFER_SIZE / x86_pmu.pebs_record_size;
+ max = x86_pmu.pebs_buffer_size / x86_pmu.pebs_record_size;
ds->pebs_buffer_base = (u64)(unsigned long)buffer;
ds->pebs_index = ds->pebs_buffer_base;
@@ -1047,6 +1047,7 @@ void intel_ds_init(void)
x86_pmu.bts = boot_cpu_has(X86_FEATURE_BTS);
x86_pmu.pebs = boot_cpu_has(X86_FEATURE_PEBS);
+ x86_pmu.pebs_buffer_size = PEBS_BUFFER_SIZE;
if (x86_pmu.pebs) {
char pebs_type = x86_pmu.intel_cap.pebs_trap ? '+' : '-';
int format = x86_pmu.intel_cap.pebs_format;
@@ -1055,6 +1056,14 @@ void intel_ds_init(void)
case 0:
printk(KERN_CONT "PEBS fmt0%c, ", pebs_type);
x86_pmu.pebs_record_size = sizeof(struct pebs_record_core);
+ /*
+ * Using >PAGE_SIZE buffers makes the WRMSR to
+ * PERF_GLOBAL_CTRL in intel_pmu_enable_all()
+ * mysteriously hang on Core2.
+ *
+ * As a workaround, we don't do this.
+ */
+ x86_pmu.pebs_buffer_size = PAGE_SIZE;
x86_pmu.drain_pebs = intel_pmu_drain_pebs_core;
break;
next prev parent reply other threads:[~2016-04-10 19:19 UTC|newest]
Thread overview: 84+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-10 18:36 [PATCH 3.14 00/76] 3.14.66-stable review Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 01/76] target: Drop incorrect ABORT_TASK put for completed commands Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 02/76] USB: serial: add Google simple serial SubClass support Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 04/76] KVM: fix spin_lock_init order on x86 Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 05/76] KVM: VMX: avoid guest hang on invalid invept instruction Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 06/76] EDAC, amd64_edac: Shift wrapping issue in f1x_get_norm_dct_addr() Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 07/76] PCI: Disable IO/MEM decoding for devices with non-compliant BARs Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 08/76] x86/apic: Fix suspicious RCU usage in smp_trace_call_function_interrupt() Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 09/76] x86/iopl: Fix iopl capability check on Xen PV Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 10/76] sg: fix dxferp in from_to case Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 11/76] aacraid: Fix memory leak in aac_fib_map_free Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 12/76] be2iscsi: set the boot_kset pointer to NULL in case of failure Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 13/76] usb: retry reset if a device times out Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 14/76] usb: hub: fix a typo in hub_port_init() leading to wrong logic Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 15/76] USB: uas: Reduce can_queue to MAX_CMNDS Greg Kroah-Hartman
2016-04-11 11:52 ` Jiri Slaby
2016-04-12 14:14 ` Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 16/76] USB: cdc-acm: more sanity checking Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 17/76] USB: iowarrior: fix oops with malicious USB descriptors Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 18/76] USB: usb_driver_claim_interface: add sanity checking Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 19/76] USB: mct_u232: add sanity checking in probe Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 20/76] USB: digi_acceleport: do sanity checking for the number of ports Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 21/76] USB: cypress_m8: add endpoint sanity check Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 22/76] USB: serial: cp210x: Adding GE Healthcare Device ID Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 23/76] USB: serial: ftdi_sio: Add support for ICP DAS I-756xU devices Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 25/76] [media] pwc: Add USB id for Philips Spc880nc webcam Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 26/76] Input: powermate - fix oops with malicious USB descriptors Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 27/76] ALSA: usb-audio: Fix NULL dereference in create_fixed_stream_quirk() Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 28/76] ALSA: usb-audio: Add sanity checks for endpoint accesses Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 29/76] ALSA: usb-audio: Minor code cleanup in create_fixed_stream_quirk() Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 30/76] ALSA: usb-audio: Fix double-free in error paths after snd_usb_add_audio_stream() call Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 31/76] Bluetooth: btusb: Add new AR3012 ID 13d3:3395 Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 32/76] Bluetooth: btusb: Add a new AR3012 ID 04ca:3014 Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 33/76] Bluetooth: btusb: Add a new AR3012 ID 13d3:3472 Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 34/76] crypto: ccp - Add hash state import and export support Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 35/76] crypto: ccp - Limit the amount of information exported Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 36/76] crypto: ccp - Dont assume export/import areas are aligned Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 37/76] crypto: ccp - memset request context to zero during import Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 38/76] HID: logitech: fix Dual Action gamepad support Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 39/76] net: irda: Fix use-after-free in irtty_open() Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 40/76] 8250: use callbacks to access UART_DLL/UART_DLM Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 41/76] [media] saa7134: Fix bytesperline not being set correctly for planar formats Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 42/76] [media] adv7511: TX_EDID_PRESENT is still 1 after a disconnect Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 43/76] [media] bttv: Width must be a multiple of 16 when capturing planar formats Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 44/76] [media] media: v4l2-compat-ioctl32: fix missing length copy in put_v4l2_buffer32 Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 45/76] ALSA: intel8x0: Add clock quirk entry for AD1981B on IBM ThinkPad X41 Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 46/76] ALSA: hda - Fix unconditional GPIO toggle via automute Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 47/76] jbd2: fix FS corruption possibility in jbd2_journal_destroy() on umount path Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 48/76] bcache: fix cache_set_flush() NULL pointer dereference on OOM Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 49/76] watchdog: rc32434_wdt: fix ioctl error handling Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 50/76] Bluetooth: Add new AR3012 ID 0489:e095 Greg Kroah-Hartman
2016-04-10 18:36 ` [PATCH 3.14 51/76] splice: handle zero nr_pages in splice_to_pipe() Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 52/76] xtensa: ISS: dont hang if stdin EOF is reached Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 53/76] xtensa: clear all DBREAKC registers on start Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 54/76] xfs: fix two memory leaks in xfs_attr_list.c error paths Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 55/76] md/raid5: Compare apples to apples (or sectors to sectors) Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 56/76] md: multipath: dont hardcopy bio in .make_request path Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 57/76] fs/coredump: prevent fsuid=0 dumps into user-controlled directories Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 58/76] rapidio/rionet: fix deadlock on SMP Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 59/76] ipr: Fix out-of-bounds null overwrite Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 60/76] ipr: Fix regression when loading firmware Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 61/76] drm/radeon: Dont drop DP 2.7 Ghz link setup on some cards Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 62/76] tracing: Have preempt(irqs)off trace preempt disabled functions Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 63/76] tracing: Fix crash from reading trace_pipe with sendfile Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 64/76] tracing: Fix trace_printk() to print when not using bprintk() Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 65/76] bitops: Do not default to __clear_bit() for __clear_bit_unlock() Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 66/76] scripts/coccinelle: modernize & Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 67/76] kbuild/mkspec: fix grub2 installkernel issue Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 68/76] target: Fix target_release_cmd_kref shutdown comp leak Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 69/76] Input: ims-pcu - sanity check against missing interfaces Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 70/76] Input: ati_remote2 - fix crashes on detecting device with invalid descriptor Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 71/76] ocfs2/dlm: fix race between convert and recovery Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 72/76] ocfs2/dlm: fix BUG in dlm_move_lockres_to_recovery_list Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 73/76] mtd: onenand: fix deadlock in onenand_block_markbad Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 74/76] sched/cputime: Fix steal time accounting vs. CPU hotplug Greg Kroah-Hartman
2016-04-10 18:37 ` Greg Kroah-Hartman [this message]
2016-04-11 7:01 ` [PATCH 3.14 75/76] perf/x86/intel: Use PAGE_SIZE for PEBS buffer size on Core2 Jiri Slaby
2016-04-12 14:14 ` Greg Kroah-Hartman
2016-04-10 18:37 ` [PATCH 3.14 76/76] perf/x86/intel: Fix PEBS data source interpretation on Nehalem/Westmere Greg Kroah-Hartman
2016-04-10 20:01 ` [PATCH 3.14 00/76] 3.14.66-stable review Guenter Roeck
2016-04-10 20:38 ` Greg Kroah-Hartman
2016-04-11 3:14 ` Guenter Roeck
2016-04-12 14:14 ` Greg Kroah-Hartman
2016-04-11 17:27 ` shuahkh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160410183518.804821365@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=acme@redhat.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=eranian@google.com \
--cc=jolsa@kernel.org \
--cc=jolsa@redhat.com \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vincent.weaver@maine.edu \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).