Skip to contentSkip to conversation

drm/i915: Fix memleak in runtime wakeref tracking

CI Mika Kuoppala 3 participants 4 messages Jul 1, 2019 – Jul 2, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

If we untrack wakerefs, the actual count may reach zero. However the krealloced owners array is still there and needs to be taken care of. Free the owners unconditionally to fix the leak.

Fixes bd780f37a361 ("drm/i915: Track all held rpm wakerefs")
Cc Juha-Pekka Heikkila <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/intel_runtime_pm.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_runtime_pm.c +4 -6
index 502c54428570..8d1aebc3e857 100644
@@ -221,13 +221,11 @@ __untrack_all_wakerefs(struct intel_runtime_pm_debug *debug,
 static void
 dump_and_free_wakeref_tracking(struct intel_runtime_pm_debug *debug)
 {
-	struct drm_printer p;
+	if (debug->count) {
+		struct drm_printer p = drm_debug_printer("i915");
 
-	if (!debug->count)
-		return;
-
-	p = drm_debug_printer("i915");
-	__print_intel_runtime_pm_wakeref(&p, debug);
+		__print_intel_runtime_pm_wakeref(&p, debug);
+	}
 
 	kfree(debug->owners);
 }
Signature · 6 lines
2.17.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✓ Fi.CI.BAT: success for drm/i915: Fix memleak in runtime wakeref tracking

== Series Details ==

== Series Details ==

Series: drm/i915: Fix memleak in runtime wakeref tracking
URL : https://patchwork.freedesktop.org/series/63031/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6390 -> Patchwork_13479
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/

Known issues
------------

Here are the changes found in Patchwork_13479 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_ctx_create@basic-files:
- fi-icl-dsi: [PASS][1] -> [INCOMPLETE][2] ([fdo#107713] / [fdo#109100])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/fi-icl-dsi/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/fi-icl-dsi/igt@[email protected]

* igt@gem_mmap_gtt@basic:
- fi-icl-u3: [PASS][3] -> [DMESG-WARN][4] ([fdo#107724])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/fi-icl-u3/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/fi-icl-u3/igt@[email protected]

#### Possible fixes ####

* igt@gem_mmap_gtt@basic-copy:
- fi-icl-u3: [DMESG-WARN][5] ([fdo#107724]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/fi-icl-u3/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/fi-icl-u3/igt@[email protected]

* igt@i915_pm_rpm@module-reload:
- fi-skl-6770hq: [FAIL][7] ([fdo#108511]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/fi-skl-6770hq/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/fi-skl-6770hq/igt@[email protected]

* igt@i915_selftest@live_blt:
- fi-skl-iommu: [INCOMPLETE][9] ([fdo#108602]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/fi-skl-iommu/igt@i915_selftest@live_blt.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/fi-skl-iommu/igt@i915_selftest@live_blt.html

* igt@kms_busy@basic-flip-c:
- fi-skl-6770hq: [SKIP][11] ([fdo#109271] / [fdo#109278]) -> [PASS][12] +2 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/fi-skl-6770hq/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/fi-skl-6770hq/igt@[email protected]

* igt@kms_flip@basic-flip-vs-dpms:
- fi-skl-6770hq: [SKIP][13] ([fdo#109271]) -> [PASS][14] +23 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/fi-skl-6770hq/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/fi-skl-6770hq/igt@[email protected]

[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#108511]: https://bugs.freedesktop.org/show_bug.cgi?id=108511
[fdo#108602]: https://bugs.freedesktop.org/show_bug.cgi?id=108602
[fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278

Participating hosts (52 -> 45)
------------------------------

Additional (1): fi-kbl-7567u
Missing (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus

Build changes
-------------

* Linux: CI_DRM_6390 -> Patchwork_13479

CI_DRM_6390: 4c6c23fdf450ab43bb4046ac1fb1439ebf176564 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5075: 03779dd3de8a57544f124d9952a6d2b3e34e34ca @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13479: f128b90828024dc966d64a6e8496ed7c88f5c2f4 @ git://anongit.freedesktop.org/gfx-ci/linux

== Kernel 32bit build ==

Warning: Kernel 32bit buildtest failed:
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/build_32bit.log

  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  CHK     include/generated/compile.h

Kernel: arch/x86/boot/bzImage is ready (#1)
Building modules, stage 2.
MODPOST 112 modules
ERROR: "__udivdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: "__divdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! scripts/Makefile.modpost:91: recipe for target '__modpost' failed make[1]: *** [__modpost] Error 1
Makefile:1287: recipe for target 'modules' failed
make: *** [modules] Error 2

== Linux commits ==

f128b9082802 drm/i915: Fix memleak in runtime wakeref tracking

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✓ Fi.CI.IGT: success for drm/i915: Fix memleak in runtime wakeref tracking

In reply to Mika Kuoppala
== Series Details ==

== Series Details ==

Series: drm/i915: Fix memleak in runtime wakeref tracking
URL : https://patchwork.freedesktop.org/series/63031/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6390_full -> Patchwork_13479_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Known issues
------------

Here are the changes found in Patchwork_13479_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_workarounds@suspend-resume-context:
- shard-apl: [PASS][1] -> [DMESG-WARN][2] ([fdo#108566]) +5 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-apl7/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-apl4/igt@[email protected]

* igt@i915_pm_rpm@i2c:
- shard-hsw: [PASS][3] -> [FAIL][4] ([fdo#104097])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-hsw8/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-hsw1/igt@[email protected]

* igt@i915_suspend@sysfs-reader:
- shard-skl: [PASS][5] -> [INCOMPLETE][6] ([fdo#104108])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-skl3/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-skl8/igt@[email protected]

* igt@kms_color@pipe-b-legacy-gamma-reset:
- shard-snb: [PASS][7] -> [SKIP][8] ([fdo#109271])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-snb5/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-snb1/igt@[email protected]

* igt@kms_cursor_crc@pipe-a-cursor-64x64-random:
- shard-hsw: [PASS][9] -> [INCOMPLETE][10] ([fdo#103540])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-hsw4/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-hsw2/igt@[email protected]

* igt@kms_cursor_crc@pipe-b-cursor-suspend:
- shard-skl: [PASS][11] -> [INCOMPLETE][12] ([fdo#110741])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-skl1/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-skl9/igt@[email protected]

* igt@kms_cursor_edge_walk@pipe-a-64x64-bottom-edge:
- shard-snb: [PASS][13] -> [SKIP][14] ([fdo#109271] / [fdo#109278])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-snb5/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-snb1/igt@[email protected]

* igt@kms_flip@basic-flip-vs-modeset:
- shard-kbl: [PASS][15] -> [DMESG-WARN][16] ([fdo#103313] / [fdo#105345])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-kbl3/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-kbl2/igt@[email protected]

* igt@kms_flip@flip-vs-absolute-wf_vblank-interruptible:
- shard-iclb: [PASS][17] -> [INCOMPLETE][18] ([fdo#107713])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-iclb4/igt@kms_flip@flip-vs-absolute-wf_vblank-interruptible.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-iclb7/igt@kms_flip@flip-vs-absolute-wf_vblank-interruptible.html

* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-iclb: [PASS][19] -> [FAIL][20] ([fdo#103167]) +4 similar issues
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-iclb6/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-iclb7/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
- shard-skl: [PASS][21] -> [FAIL][22] ([fdo#108145]) +1 similar issue
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-skl7/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-skl7/igt@[email protected]

* igt@kms_psr2_su@page_flip:
- shard-iclb: [PASS][23] -> [SKIP][24] ([fdo#109642])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-iclb2/igt@kms_psr2_su@page_flip.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-iclb6/igt@kms_psr2_su@page_flip.html

* igt@kms_psr@psr2_primary_page_flip:
- shard-iclb: [PASS][25] -> [SKIP][26] ([fdo#109441])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-iclb8/igt@kms_psr@psr2_primary_page_flip.html

* igt@kms_sysfs_edid_timing:
- shard-iclb: [PASS][27] -> [FAIL][28] ([fdo#100047])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-iclb5/igt@kms_sysfs_edid_timing.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-iclb2/igt@kms_sysfs_edid_timing.html

#### Possible fixes ####

* igt@gem_exec_balancer@smoke:
- shard-iclb: [SKIP][29] ([fdo#110854]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-iclb5/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-iclb2/igt@[email protected]

* igt@gem_exec_schedule@preemptive-hang-vebox:
- shard-iclb: [INCOMPLETE][31] ([fdo#107713]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-iclb7/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-iclb2/igt@[email protected]

* igt@i915_selftest@mock_requests:
- shard-skl: [INCOMPLETE][33] ([fdo#110550]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-skl2/igt@i915_selftest@mock_requests.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-skl3/igt@i915_selftest@mock_requests.html
- shard-glk: [INCOMPLETE][35] ([fdo#103359] / [k.org#198133]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-glk6/igt@i915_selftest@mock_requests.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-glk2/igt@i915_selftest@mock_requests.html

* igt@kms_flip@flip-vs-expired-vblank:
- shard-skl: [FAIL][37] ([fdo#105363]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-skl5/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-skl1/igt@[email protected]

* igt@kms_flip@flip-vs-suspend:
- shard-apl: [DMESG-WARN][39] ([fdo#108566]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-apl6/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-apl5/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render:
- shard-iclb: [FAIL][41] ([fdo#103167]) -> [PASS][42] +2 similar issues
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-iclb5/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-iclb8/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render.html

* igt@kms_plane_lowres@pipe-a-tiling-y:
- shard-iclb: [FAIL][43] ([fdo#103166]) -> [PASS][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-iclb5/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-iclb4/igt@[email protected]

* igt@kms_psr@no_drrs:
- shard-iclb: [FAIL][45] ([fdo#108341]) -> [PASS][46]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-iclb1/igt@kms_psr@no_drrs.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-iclb4/igt@kms_psr@no_drrs.html

* igt@kms_psr@psr2_primary_mmap_cpu:
- shard-iclb: [SKIP][47] ([fdo#109441]) -> [PASS][48] +2 similar issues
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-iclb3/igt@kms_psr@psr2_primary_mmap_cpu.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html

* igt@perf@blocking:
- shard-skl: [FAIL][49] ([fdo#110728]) -> [PASS][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6390/shard-skl10/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/shard-skl8/igt@[email protected]

[fdo#100047]: https://bugs.freedesktop.org/show_bug.cgi?id=100047
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103313]: https://bugs.freedesktop.org/show_bug.cgi?id=103313
[fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
[fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
[fdo#104097]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#105345]: https://bugs.freedesktop.org/show_bug.cgi?id=105345
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108341]: https://bugs.freedesktop.org/show_bug.cgi?id=108341
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#110550]: https://bugs.freedesktop.org/show_bug.cgi?id=110550
[fdo#110728]: https://bugs.freedesktop.org/show_bug.cgi?id=110728
[fdo#110741]: https://bugs.freedesktop.org/show_bug.cgi?id=110741
[fdo#110854]: https://bugs.freedesktop.org/show_bug.cgi?id=110854
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133

Participating hosts (10 -> 10)
------------------------------

No changes in participating hosts

Build changes
-------------

* Linux: CI_DRM_6390 -> Patchwork_13479

CI_DRM_6390: 4c6c23fdf450ab43bb4046ac1fb1439ebf176564 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5075: 03779dd3de8a57544f124d9952a6d2b3e34e34ca @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13479: f128b90828024dc966d64a6e8496ed7c88f5c2f4 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13479/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
In reply to Mika Kuoppala

Quoting Mika Kuoppala (2019-07-01 11:44:42)

Quoted 11 lines

If we untrack wakerefs, the actual count may reach zero. However the krealloced owners array is still there and needs to be taken care of. Free the owners unconditionally to fix the leak.

Fixes bd780f37a361 ("drm/i915: Track all held rpm wakerefs")
Cc Juha-Pekka Heikkila <[email protected]>
Cc Chris Wilson <[email protected]>

And pushed so that we can rule out any undue influence elsewhere in CI. Thanks for catching my mistake,
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx