Bug 103739 - [IGT] gem_shrink@mmap-cpu-userptr has dmesg-warn: WARNING: CPU: 1 PID: 7983 at kernel/workqueue.c:2434 check_flush_dependency+0x7f/0x110
Summary: [IGT] gem_shrink@mmap-cpu-userptr has dmesg-warn: WARNING: CPU: 1 PID: 7983 a...
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: DRI git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
: 104240 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-11-14 17:16 UTC by Hector Velazquez
Modified: 2018-03-02 15:06 UTC (History)
2 users (show)

See Also:
i915 platform: CFL
i915 features:


Attachments
dmesg-warn (5.16 KB, text/plain)
2017-11-14 17:16 UTC, Hector Velazquez
no flags Details

Description Hector Velazquez 2017-11-14 17:16:44 UTC
Created attachment 135453 [details]
dmesg-warn
Comment 1 Hector Velazquez 2017-11-14 17:16:50 UTC
This test have a dmesg-warn on CFL QA

igt@gem_shrink@mmap-cpu-userptr

====================================================
dmesg-warn 
====================================================
	
[62530.869510] workqueue: PF_MEMALLOC task 7983(gem_shrink) is flushing !WQ_MEM_RECLAIM i915-userptr-release:          (null)
[62530.869515] ------------[ cut here ]------------
[62530.869519] WARNING: CPU: 1 PID: 7983 at kernel/workqueue.c:2434 check_flush_dependency+0x7f/0x110
[62530.869519] Modules linked in: pegasus mii ip6table_filter ip6_tables bnep iptable_filter snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic binfmt_misc nls_iso8859_1 intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_intel snd_hda_codec kvm_intel snd_hda_core snd_hwdep kvm snd_pcm irqbypass snd_seq_midi snd_seq_midi_event snd_rawmidi crct10dif_pclmul crc32_pclmul 8250_dw ghash_clmulni_intel snd_seq pcbc snd_seq_device snd_timer btusb aesni_intel btrtl btbcm aes_x86_64 iwlwifi btintel crypto_simd glue_helper cryptd bluetooth snd intel_cstate input_leds idma64 intel_rapl_perf ecdh_generic serio_raw soundcore cfg80211 wmi_bmof virt_dma intel_lpss_pci intel_lpss acpi_als kfifo_buf industrialio winbond_cir soc_button_array rc_core spidev tpm_crb intel_hid acpi_pad mac_hid sparse_keymap
[62530.869546]  parport_pc ppdev lp parport ip_tables x_tables autofs4 hid_generic usbhid i915 i2c_algo_bit prime_numbers drm_kms_helper syscopyarea e1000e sysfillrect sysimgblt fb_sys_fops ahci ptp pps_core libahci drm wmi video i2c_hid hid
[62530.869557] CPU: 1 PID: 7983 Comm: gem_shrink Tainted: G     U  W    L  4.14.0-rc8-drm-tip-ww45-commit-1342299+ #1
[62530.869558] Hardware name: Intel Corporation CoffeeLake Client Platform/CoffeeLake H DDR4 RVP, BIOS CNLSFWR1.R00.X098.A00.1707301945 07/30/2017
[62530.869559] task: ffffa1049dbeec80 task.stack: ffffae7d05c44000
[62530.869560] RIP: 0010:check_flush_dependency+0x7f/0x110
[62530.869561] RSP: 0018:ffffae7d05c473a0 EFLAGS: 00010286
[62530.869562] RAX: 000000000000006e RBX: ffffa1049540f400 RCX: ffffffffa3e55788
[62530.869562] RDX: 0000000000000000 RSI: 0000000000000092 RDI: 0000000000000202
[62530.869563] RBP: ffffae7d05c473c0 R08: 000000000000006e R09: 000000000038bb0e
[62530.869563] R10: 0000000000000000 R11: 000000000000006e R12: ffffa1049dbeec80
[62530.869564] R13: 0000000000000000 R14: 0000000000000000 R15: ffffae7d05c473e0
[62530.869565] FS:  00007f621b129880(0000) GS:ffffa1050b240000(0000) knlGS:0000000000000000
[62530.869566] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[62530.869566] CR2: 00007f6214400000 CR3: 0000000353a17003 CR4: 00000000003606e0
[62530.869567] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[62530.869567] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[62530.869568] Call Trace:
[62530.869570]  flush_workqueue+0x115/0x3d0
[62530.869573]  ? wake_up_process+0x15/0x20
[62530.869596]  i915_gem_userptr_mn_invalidate_range_start+0x12f/0x160 [i915]
[62530.869614]  ? i915_gem_userptr_mn_invalidate_range_start+0x12f/0x160 [i915]
[62530.869616]  __mmu_notifier_invalidate_range_start+0x55/0x80
[62530.869618]  try_to_unmap_one+0x791/0x8b0
[62530.869620]  ? call_rwsem_down_read_failed+0x18/0x30
[62530.869622]  rmap_walk_anon+0x10b/0x260
[62530.869624]  rmap_walk+0x48/0x60
[62530.869625]  try_to_unmap+0x93/0xf0
[62530.869626]  ? page_remove_rmap+0x2a0/0x2a0
[62530.869627]  ? page_not_mapped+0x20/0x20
[62530.869629]  ? page_get_anon_vma+0x90/0x90
[62530.869630]  ? invalid_mkclean_vma+0x20/0x20
[62530.869631]  migrate_pages+0x946/0xaa0
[62530.869633]  ? __ClearPageMovable+0x10/0x10
[62530.869635]  ? isolate_freepages_block+0x3c0/0x3c0
[62530.869636]  compact_zone+0x22f/0x970
[62530.869638]  compact_zone_order+0xa3/0xd0
[62530.869640]  try_to_compact_pages+0x1a5/0x2a0
[62530.869641]  ? try_to_compact_pages+0x1a5/0x2a0
[62530.869643]  __alloc_pages_direct_compact+0x50/0x110
[62530.869644]  __alloc_pages_slowpath+0x4da/0xf30
[62530.869646]  __alloc_pages_nodemask+0x262/0x280
[62530.869648]  alloc_pages_vma+0x165/0x1e0
[62530.869649]  shmem_alloc_hugepage+0xd0/0x130
[62530.869651]  ? __radix_tree_insert+0x45/0x230
[62530.869652]  ? __vm_enough_memory+0x29/0x130
[62530.869654]  shmem_alloc_and_acct_page+0x10d/0x1e0
[62530.869655]  shmem_getpage_gfp+0x426/0xc00
[62530.869657]  shmem_fault+0xa0/0x1e0
[62530.869659]  ? file_update_time+0x60/0x110
[62530.869660]  __do_fault+0x1e/0xc0
[62530.869661]  __handle_mm_fault+0xa35/0x1170
[62530.869662]  handle_mm_fault+0xcc/0x1c0
[62530.869664]  __do_page_fault+0x262/0x4f0
[62530.869666]  do_page_fault+0x2e/0xe0
[62530.869667]  page_fault+0x22/0x30
[62530.869668] RIP: 0033:0x404335
[62530.869669] RSP: 002b:00007fff7829e420 EFLAGS: 00010216
[62530.869670] RAX: 00007f6210400000 RBX: 0000000000000004 RCX: 0000000000b80000
[62530.869670] RDX: 0000000000002e01 RSI: 0000000000008000 RDI: 0000000000000004
[62530.869671] RBP: 0000000000000019 R08: 0000000000000002 R09: 0000000000000000
[62530.869671] R10: 0000000000000559 R11: 0000000000000246 R12: 0000000008000000
[62530.869672] R13: 00000000004042f0 R14: 0000000000000004 R15: 000000000000007e
[62530.869673] Code: 00 8b b0 18 05 00 00 48 8d 8b b0 00 00 00 48 8d 90 c0 06 00 00 4d 89 f0 48 c7 c7 40 c0 c8 a3 c6 05 68 c5 e8 00 01 e8 c2 68 04 00 <0f> ff 4d 85 ed 74 18 49 8b 45 20 48 8b 70 08 8b 86 00 01 00 00 
[62530.869691] ---[ end trace 01e01ad0ff5781f8 ]---


This is my configuration:

======================================
	Graphic stack
======================================
Component: drm
    tag: libdrm-2.4.81-96-g931f019
    commit: 931f01964a2f2a75e8563feccc70ac2eb0296d99

Component: cairo
    tag: 1.15.6-82-g164be89
    commit: 164be896603ceb419c5bc47c7348781f791f70e4

Component: intel-gpu-tools
    tag: intel-gpu-tools-1.19-481-g7d75119
    commit: 7d75119b7f23fb49af52463da9bcd62e64fe6a6f

Component: piglit
    tag: piglit-v1
    commit: 733e3ab212fcce735f47ed9f8659ccdf6f625a70

======================================
	     Software
======================================
kernel version              : 4.14.0-rc8-drm-tip-ww45-commit-1342299+
hostname                    : gfx-desktop
architecture                : x86_64
os version                  : Ubuntu 16.10
os codename                 : yakkety
kernel driver               : i915
bios revision               : 98.0
bios release date           : 07/30/2017
ksc                         : 1.5
hardware acceleration       : disabled
swap partition              : enabled on (/dev/sda3)

======================================
	Graphic drivers
======================================
libdrm                      : 2.4.88
cairo                       : 1.15.9
intel-gpu-tools (tag)       : intel-gpu-tools-1.19-481-g7d75119
intel-gpu-tools (commit)    : 7d75119

======================================
	     Hardware
======================================
motherboard model          : CoffeeLakeClientPlatform
motherboard id             : CoffeeLakeHDDR4RVP
form factor                : Laptop
manufacturer               : IntelCorporation
cpu family                 : Other
cpu family id              : 6
cpu information            : Genuine Intel(R) CPU 0000 @ 2.80GHz
gpu card                   : Intel Corporation Device 3e9b (prog-if 00 [VGA controller])
memory ram                 : 31.3 GB
max memory ram             : 32 GB
cpu thread                 : 12
cpu core                   : 6
cpu model                  : 158
cpu stepping               : 10
socket                     : Other
hard drive                 : 74GiB (80GB)
current cd clock frequency : 337500 kHz
maximum cd clock frequency : 675000 kHz
displays connected         : DP-1 DP-2 DP-3

======================================
	     Firmware
======================================
dmc fw loaded             : yes
dmc version               : 1.1
guc fw loaded             : fetch SUCCESS, load SUCCESS
guc version wanted        : wanted 9.14, found 9.14
guc version found         : wanted 9.14, found 9.14

======================================
	     kernel parameters
======================================
quiet splash drm.debug=0xe intel_iommu=igfx_off i915.alpha_support=1 i915.enable_guc_loading=2 i915.enable_guc_submission=2 resume=/dev/sda3
Comment 2 Chris Wilson 2017-11-17 11:01:25 UTC
commit 41729bf2248bc8593e5103d43974079cc269524c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Nov 14 17:35:20 2017 +0000

    drm/i915: Mark the userptr invalidate workqueue as WQ_MEM_RECLAIM
    
    Commit  21cc6431e0c2 ("drm/i915: Mark the userptr invalidate workqueue
    as WQ_MEM_RECLAIM") tried to fixup the check_flush_dependency warning
    for hitting i915_gem_userptr_mn_invalidate_range_start from within the
    shrinker, but I failed to notice userptr has 2 similarly named
    workqueues. I marked up i915-userptr-acquire as WQ_MEM_RECLAIM whereas
    we only wait upon i915-userptr-release from inside the reclaim paths.
    
    [62530.869510] workqueue: PF_MEMALLOC task 7983(gem_shrink) is flushing !WQ_MEM_RECLAIM i915-userptr-release:          (null)
    [62530.869515] ------------[ cut here ]------------
    [62530.869519] WARNING: CPU: 1 PID: 7983 at kernel/workqueue.c:2434 check_flush_dependency+0x7f/0x110
    [62530.869519] Modules linked in: pegasus mii ip6table_filter ip6_tables bnep iptable_filter snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic binfmt_misc nls_iso885
9_1 intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_intel snd_hda_codec kvm_intel snd_hda_core snd_hwdep kvm snd_pcm irqbypass snd_seq_midi snd_seq_midi_event snd_r
awmidi crct10dif_pclmul crc32_pclmul
 8250_dw ghash_clmulni_intel snd_seq pcbc snd_seq_device snd_timer btusb aesni_intel btrtl btbcm aes_x86_64 iwlwifi btintel crypto_simd glue_helper cryptd bluetooth snd intel_cstate input_leds idma64 intel_rapl_perf ecdh_generic serio_raw soundcore cfg80211 wmi_bmof virt_dma intel_lpss_pci intel_lpss acpi_als kfifo_buf industrialio winbond_cir soc_button_array rc_core spidev tpm_crb intel_hid acpi_pad mac_hid sparse_keymap
    [62530.869546]  parport_pc ppdev lp parport ip_tables x_tables autofs4 hid_generic usbhid i915 i2c_algo_bit prime_numbers drm_kms_helper syscopyarea e1000e sysfillrect sysimgblt fb_sys_fops ahci ptp pps_core libahci drm wmi video i2c_hid hid
    [62530.869557] CPU: 1 PID: 7983 Comm: gem_shrink Tainted: G     U  W    L  4.14.0-rc8-drm-tip-ww45-commit-1342299+ #1
    [62530.869558] Hardware name: Intel Corporation CoffeeLake Client Platform/CoffeeLake H DDR4 RVP, BIOS CNLSFWR1.R00.X098.A00.1707301945 07/30/2017
    [62530.869559] task: ffffa1049dbeec80 task.stack: ffffae7d05c44000
    [62530.869560] RIP: 0010:check_flush_dependency+0x7f/0x110
    [62530.869561] RSP: 0018:ffffae7d05c473a0 EFLAGS: 00010286
    [62530.869562] RAX: 000000000000006e RBX: ffffa1049540f400 RCX: ffffffffa3e55788
    [62530.869562] RDX: 0000000000000000 RSI: 0000000000000092 RDI: 0000000000000202
    [62530.869563] RBP: ffffae7d05c473c0 R08: 000000000000006e R09: 000000000038bb0e
    [62530.869563] R10: 0000000000000000 R11: 000000000000006e R12: ffffa1049dbeec80
    [62530.869564] R13: 0000000000000000 R14: 0000000000000000 R15: ffffae7d05c473e0
    [62530.869565] FS:  00007f621b129880(0000) GS:ffffa1050b240000(0000) knlGS:0000000000000000
    [62530.869566] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [62530.869566] CR2: 00007f6214400000 CR3: 0000000353a17003 CR4: 00000000003606e0
    [62530.869567] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [62530.869567] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    [62530.869568] Call Trace:
    [62530.869570]  flush_workqueue+0x115/0x3d0
    [62530.869573]  ? wake_up_process+0x15/0x20
    [62530.869596]  i915_gem_userptr_mn_invalidate_range_start+0x12f/0x160 [i915]
    [62530.869614]  ? i915_gem_userptr_mn_invalidate_range_start+0x12f/0x160 [i915]
    [62530.869616]  __mmu_notifier_invalidate_range_start+0x55/0x80
    [62530.869618]  try_to_unmap_one+0x791/0x8b0
    [62530.869620]  ? call_rwsem_down_read_failed+0x18/0x30
    [62530.869622]  rmap_walk_anon+0x10b/0x260
    [62530.869624]  rmap_walk+0x48/0x60
    [62530.869625]  try_to_unmap+0x93/0xf0
    [62530.869626]  ? page_remove_rmap+0x2a0/0x2a0
    [62530.869627]  ? page_not_mapped+0x20/0x20
    [62530.869629]  ? page_get_anon_vma+0x90/0x90
    [62530.869630]  ? invalid_mkclean_vma+0x20/0x20
    [62530.869631]  migrate_pages+0x946/0xaa0
    [62530.869633]  ? __ClearPageMovable+0x10/0x10
    [62530.869635]  ? isolate_freepages_block+0x3c0/0x3c0
    [62530.869636]  compact_zone+0x22f/0x970
    [62530.869638]  compact_zone_order+0xa3/0xd0
    [62530.869640]  try_to_compact_pages+0x1a5/0x2a0
    [62530.869641]  ? try_to_compact_pages+0x1a5/0x2a0
    [62530.869643]  __alloc_pages_direct_compact+0x50/0x110
    [62530.869644]  __alloc_pages_slowpath+0x4da/0xf30
    [62530.869646]  __alloc_pages_nodemask+0x262/0x280
    [62530.869648]  alloc_pages_vma+0x165/0x1e0
    [62530.869649]  shmem_alloc_hugepage+0xd0/0x130
    [62530.869651]  ? __radix_tree_insert+0x45/0x230
    [62530.869652]  ? __vm_enough_memory+0x29/0x130
    [62530.869654]  shmem_alloc_and_acct_page+0x10d/0x1e0
    [62530.869655]  shmem_getpage_gfp+0x426/0xc00
    [62530.869657]  shmem_fault+0xa0/0x1e0
    [62530.869659]  ? file_update_time+0x60/0x110
    [62530.869660]  __do_fault+0x1e/0xc0
    [62530.869661]  __handle_mm_fault+0xa35/0x1170
    [62530.869662]  handle_mm_fault+0xcc/0x1c0
    [62530.869664]  __do_page_fault+0x262/0x4f0
    [62530.869666]  do_page_fault+0x2e/0xe0
    [62530.869667]  page_fault+0x22/0x30
    [62530.869668] RIP: 0033:0x404335
    [62530.869669] RSP: 002b:00007fff7829e420 EFLAGS: 00010216
    [62530.869670] RAX: 00007f6210400000 RBX: 0000000000000004 RCX: 0000000000b80000
    [62530.869670] RDX: 0000000000002e01 RSI: 0000000000008000 RDI: 0000000000000004
    [62530.869671] RBP: 0000000000000019 R08: 0000000000000002 R09: 0000000000000000
    [62530.869671] R10: 0000000000000559 R11: 0000000000000246 R12: 0000000008000000
    [62530.869672] R13: 00000000004042f0 R14: 0000000000000004 R15: 000000000000007e
    [62530.869673] Code: 00 8b b0 18 05 00 00 48 8d 8b b0 00 00 00 48 8d 90 c0 06 00 00 4d 89 f0 48 c7 c7 40 c0 c8 a3 c6 05 68 c5 e8 00 01 e8 c2 68 04 00 <0f> ff 4d 85 ed 74 18 49 8b 45 20 48 8b 70 08 8b 86 00 01 00 00
    [62530.869691] ---[ end trace 01e01ad0ff5781f8 ]---
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103739
    Fixes: 21cc6431e0c2 ("drm/i915: Mark the userptr invalidate workqueue as WQ_MEM_RECLAIM")
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Cc: Michał Winiarski <michal.winiarski@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20171114173520.8829-1-chris@chris-wilson.co.uk
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Comment 3 Hector Velazquez 2017-11-17 18:27:29 UTC
This test has the same dmesg-warning on GLK QA

igt@gem_userptr_blits@mlocked-sync-interruptible

IGT-Version: 1.20-g88d6550 (x86_64) (Linux: 4.14.0-drm-tip-ww46-commit-1fc4fe8+ x86_64)
fastfeedback-nov-ww46-thursday-07-03-33-code-179785857
Comment 4 Hector Velazquez 2017-11-17 20:08:14 UTC
his test has the same dmesg-warning on GLK QA

igt@gem_shrink@mmap-cpu-userptr

IGT-Version: 1.20-g88d6550 (x86_64) (Linux: 4.14.0-drm-tip-ww46-commit-1fc4fe8+ x86_64)
fastfeedback-nov-ww46-thursday-07-03-33-code-179785857
Comment 5 Chris Wilson 2017-12-13 12:56:42 UTC
*** Bug 104240 has been marked as a duplicate of this bug. ***
Comment 6 Armando Antonio 2018-01-10 18:00:34 UTC
This test igt@gem_shrink@mmap-cpu-userptr is working fine.

======================================
             Software
======================================
kernel version              : 4.15.0-rc7-drm-tip-ww2-commit-4269b88+
hostname                    : testrunner-CoffeeLake-Client-Platform

======================================
             Hardware
======================================
motherboard model          : CoffeeLakeClientPlatform
motherboard id             : CoffeeLakeHDDR4RVP
cpu family id              : 6


Creating new bug for igt@gem_userptr_blits@mlocked-sync-interruptible
Comment 7 Elizabeth 2018-03-02 15:06:52 UTC
Closing old verified.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.