Bug 92638

Summary: [bsw] i915_gem_context_free WARN_ON(!list_empty(&ppgtt->base.active_list))
Product: DRI Reporter: Chris Wilson <chris>
Component: DRM/IntelAssignee: Intel GFX Bugs mailing list <intel-gfx-bugs>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium CC: intel-gfx-bugs
Version: DRI git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: BSW/CHT i915 features: GEM/Other

Description Chris Wilson 2015-10-23 13:18:03 UTC
Spotted whilst running igt/gem_concurrent_blit. Rare.

[   92.791996] WARNING: CPU: 0 PID: 1352 at drivers/gpu/drm/i915/i915_gem_context.c:144 i915_gem_context_free+0x1b5/0x1d0()
[   92.792010] WARN_ON(!list_empty(&ppgtt->base.active_list))
[   92.792018] CPU: 0 PID: 1352 Comm: gem_concurrent_ Not tainted 4.3.0-rc6+ #151
[   92.792034] Hardware name:                  /NUC5CPYB, BIOS PYBSWCEL.86A.0027.2015.0507.1758 05/07/2015
[   92.792047]  ffffffff818ee4f0 ffff880065e2fa88 ffffffff812602cf ffff880065e2fad0
[   92.792066]  ffff880065e2fac0 ffffffff8106b55d ffff88005386ec00 ffff880276275a00
[   92.792084]  ffff880037f34000 ffff880234822b50 ffff880275b441f8 ffff880065e2fb20
[   92.792103] Call Trace:
[   92.792115]  [<ffffffff812602cf>] dump_stack+0x44/0x55
[   92.792127]  [<ffffffff8106b55d>] warn_slowpath_common+0x7d/0xb0
[   92.792137]  [<ffffffff8106b60c>] warn_slowpath_fmt+0x4c/0x50
[   92.792147]  [<ffffffff813633b5>] i915_gem_context_free+0x1b5/0x1d0
[   92.792182]  [<ffffffff8137076b>] i915_gem_request_free+0xbb/0xc0
[   92.792193]  [<ffffffff81370d8e>] i915_gem_object_retire__read+0x1ee/0x280
[   92.792203]  [<ffffffff81372efb>] i915_gem_retire_requests_ring+0x7b/0x150
[   92.792213]  [<ffffffff813659b1>] i915_gem_execbuffer_reserve.isra.21+0x31/0x350
[   92.792225]  [<ffffffff8136680a>] i915_gem_do_execbuffer.isra.27+0x7aa/0x1330
[   92.792235]  [<ffffffff8137608d>] ? i915_gem_object_do_pin+0x47d/0xad0
[   92.792245]  [<ffffffff81377d6a>] ? i915_gem_pwrite_ioctl+0xda/0xb80
[   92.792254]  [<ffffffff81375ac9>] ? i915_gem_free_object+0x1f9/0x340
[   92.792263]  [<ffffffff81367f82>] i915_gem_execbuffer2+0xb2/0x240
[   92.792274]  [<ffffffff8131cac3>] drm_ioctl+0x143/0x510
[   92.792282]  [<ffffffff81367ed0>] ? i915_gem_execbuffer+0x2f0/0x2f0
[   92.792292]  [<ffffffff81099c63>] ? pick_next_task_fair+0x3d3/0x420
[   92.792303]  [<ffffffff811458b1>] ? __fput+0x161/0x1d0
[   92.792313]  [<ffffffff81155955>] do_vfs_ioctl+0x285/0x460
[   92.792323]  [<ffffffff81155b71>] SyS_ioctl+0x41/0x70
[   92.792334]  [<ffffffff810015a4>] ? prepare_exit_to_usermode+0x84/0xc0
[   92.792345]  [<ffffffff8150a997>] entry_SYSCALL_64_fastpath+0x12/0x6a
Comment 1 Chris Wilson 2015-10-23 13:19:35 UTC
The WARN is indeed invalid in the current codebase.
Comment 2 Tvrtko Ursulin 2015-11-05 17:27:25 UTC
For the record, proposed fix, although with a bit of disagreement on what is logical:

http://patchwork.freedesktop.org/patch/62884/
Comment 3 Chris Wilson 2016-08-10 07:59:07 UTC
commit b0decaf75bd902a11c932005c88924947ac00b8c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 4 07:52:44 2016 +0100

    drm/i915: Track active vma requests
    
    Hook the vma itself into the i915_gem_request_retire() so that we can
    accurately track when a solitary vma is inactive (as opposed to having
    to wait for the entire object to be idle). This improves the interaction
    when using multiple contexts (with full-ppgtt) and eliminates some
    frequent list walking when retiring objects after a completed request.
    
    A side-effect is that we get an active vma reference for free. The
    consequence of this is shown in the next patch...

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.