Re: perf: WARNING: kernel/events/core.c:4893 perf_mmap_close

From: Will Deacon
Date: Tue Aug 23 2016 - 11:12:47 EST


Hi Alexander,

On Fri, Aug 12, 2016 at 08:54:49PM +0300, Alexander Shishkin wrote:
> Yes, I tracked to a race between unmapping and set_output, trying to
> come up with a good fix now.

Did you get anywhere with this? I think I just hit the same issue with
the intel-pt driver on my broadwell laptop with -rc3+PREEMPT (dump
below) and I'm more than happy to test a fix.

Will

--->8

[ 64.827521] ------------[ cut here ]------------
[ 64.827527] WARNING: CPU: 1 PID: 1762 at /home/kernel/COD/linux/kernel/events/ring_buffer.c:539 __rb_free_aux+0x10c/0x120
[ 64.827528] Modules linked in: fuse binfmt_misc intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp nls_utf8 nls_cp437 kvm_intel iwlwifi vfat kvm fat irqbypass crct10dif_pclmul snd_soc_rt298 dell_laptop crc32_pclmul dell_wmi cfg80211 snd_soc_rt286 dell_led ghash_clmulni_intel dell_smbios dcdbas rtsx_pci_ms snd_hda_codec_realtek snd_hda_codec_hdmi snd_hda_codec_generic snd_soc_rl6347a snd_soc_ssm4567 rfkill memstick snd_soc_core elan_i2c snd_hda_intel aesni_intel snd_compress snd_pcm_dmaengine snd_hda_codec aes_x86_64 lrw snd_hda_core gf128mul glue_helper snd_hwdep ablk_helper cryptd snd_pcm intel_cstate intel_rapl_perf videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 snd_seq_midi videobuf2_core snd_seq_midi_event videodev joydev hid_multitouch efi_pstore media serio_raw snd_rawmidi efivars
[ 64.827556] snd_seq sg snd_seq_device snd_timer intel_pch_thermal mei_me snd soundcore mei shpchp lpc_ich battery intel_vbtn sparse_keymap soc_button_array int3403_thermal dw_dmac dw_dmac_core snd_soc_sst_acpi int3400_thermal i2c_designware_platform snd_soc_sst_match acpi_pad acpi_als int3406_thermal int3402_thermal acpi_thermal_rel i2c_designware_core ac evdev kfifo_buf processor_thermal_device int340x_thermal_zone intel_soc_dts_iosf industrialio tpm_tis tpm_tis_core tpm parport_pc ppdev lp parport efivarfs autofs4 ext4 crc16 jbd2 fscrypto mbcache sd_mod usbhid rtsx_pci_sdmmc i915 xhci_pci ehci_pci xhci_hcd ahci ehci_hcd psmouse crc32c_intel libahci usbcore libata i2c_algo_bit drm_kms_helper scsi_mod usb_common drm rtsx_pci mfd_core thermal fan wmi sdhci_acpi sdhci mmc_core video i2c_hid hid fjes
[ 64.827587] button
[ 64.827589] CPU: 1 PID: 1762 Comm: pt-poker Tainted: G D W 4.8.0-040800rc3-lowlatency #201608212032
[ 64.827590] Hardware name: Dell Inc. XPS 13 9343/0F5KF3, BIOS A07 11/11/2015
[ 64.827592] 0000000000000286 00000000cf433edf ffffffffa7148112 0000000000000000
[ 64.827594] 0000000000000000 ffffffffa6e801fe ffff932a8d941000 ffff932a8f349a80
[ 64.827595] ffff932a8f349800 ffff932a8d940db0 ffff932a8d941000 ffffffffa7a40e00
[ 64.827597] Call Trace:
[ 64.827600] [<ffffffffa7148112>] ? dump_stack+0x5c/0x7a
[ 64.827602] [<ffffffffa6e801fe>] ? __warn+0xbe/0xe0
[ 64.827604] [<ffffffffa6f8368c>] ? __rb_free_aux+0x10c/0x120
[ 64.827606] [<ffffffffa6f810b7>] ? perf_mmap_close+0x2c7/0x310
[ 64.827607] [<ffffffffa6f795b0>] ? perf_iterate_ctx+0x150/0x150
[ 64.827609] [<ffffffffa6fcbec5>] ? remove_vma+0x25/0x60
[ 64.827610] [<ffffffffa6fce3c3>] ? exit_mmap+0xe3/0x150
[ 64.827612] [<ffffffffa6e7d04a>] ? mmput+0x4a/0xf0
[ 64.827613] [<ffffffffa6e84463>] ? do_exit+0x273/0xb70
[ 64.827614] [<ffffffffa6e84dda>] ? do_group_exit+0x3a/0xa0
[ 64.827616] [<ffffffffa6e901cc>] ? get_signal+0x27c/0x690
[ 64.827617] [<ffffffffa6e2e5a6>] ? do_signal+0x36/0x6f0
[ 64.827619] [<ffffffffa6e2d751>] ? __switch_to+0x2c1/0x810
[ 64.827620] [<ffffffffa6ea6711>] ? finish_task_switch+0x71/0x1e0
[ 64.827622] [<ffffffffa74288e4>] ? __schedule+0x264/0x740
[ 64.827624] [<ffffffffa6e032b5>] ? exit_to_usermode_loop+0x85/0xc0
[ 64.827626] [<ffffffffa6e03b51>] ? prepare_exit_to_usermode+0x21/0x30
[ 64.827627] [<ffffffffa742dde5>] ? retint_user+0x8/0x10
[ 64.827628] ---[ end trace 928bce4cbac61bf3 ]---
[ 64.827643] BUG: scheduling while atomic: pt-poker/1762/0x00000002