Skip to contentSkip to conversation

drm: More debug info for fb leaks in mode_config_cleanup

PATCH Applied Daniel Vetter 5 participants 9 messages Dec 7, 2017 – Apr 25, 2018

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

PATCH 1/1 drm: More debug info for fb leaks in mode_config_cleanup

We're spotting this very rarely in CI, but have no idea. Let's add more debug info about what's going on here.

References: https://bugs.freedesktop.org/show_bug.cgi?id=102707

---
 drivers/gpu/drm/drm_mode_config.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_mode_config.c +3 -0
index cc78b3d9e5e4..6ffe952142e6 100644
@@ -469,6 +469,9 @@ void drm_mode_config_cleanup(struct drm_device *dev)
 	 */
 	WARN_ON(!list_empty(&dev->mode_config.fb_list));
 	list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head) {
+		struct drm_printer p = drm_debug_printer("[leaked fb]");
+		drm_printf(&p, "framebuffer[%u]:\n", fb->base.id);
+		drm_framebuffer_print_info(&p, 1, fb);
 		drm_framebuffer_free(&fb->base.refcount);
 	}
 
Signature · 6 lines
2.15.0

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

Den 07.12.2017 15.49, skrev Daniel Vetter:

Quoted 6 lines

We're spotting this very rarely in CI, but have no idea. Let's add more debug info about what's going on here.

References: https://bugs.freedesktop.org/show_bug.cgi?id=102707

---

Quoted 8 lines
  drivers/gpu/drm/drm_mode_config.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_mode_config.c +0 -0
index cc78b3d9e5e4..6ffe952142e6 100644

drivers/gpu/drm/drm_mode_config.c void drm_mode_config_cleanup(struct drm_device *dev) · line 477

Quoted 9 lines
drivers/gpu/drm/drm_mode_config.c +3 -0
@@ -469,6 +469,9 @@ void drm_mode_config_cleanup(struct drm_device *dev)
  	 */
  	WARN_ON(!list_empty(&dev->mode_config.fb_list));
  	list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head) {
+		struct drm_printer p = drm_debug_printer("[leaked fb]");
+		drm_printf(&p, "framebuffer[%u]:\n", fb->base.id);
+		drm_framebuffer_print_info(&p, 1, fb);
  		drm_framebuffer_free(&fb->base.refcount);
  	}
 

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

#2 lore raw
Quoted 10 lines · Noralf Trønnes

Den 07.12.2017 15.49, skrev Daniel Vetter:

Quoted 6 lines

We're spotting this very rarely in CI, but have no idea. Let's add more debug info about what's going on here.

References: https://bugs.freedesktop.org/show_bug.cgi?id=102707

---

Applied, thanks for taking a look!
-Daniel

Quoted 18 lines
Quoted 17 lines
  drivers/gpu/drm/drm_mode_config.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_mode_config.c +3 -0
index cc78b3d9e5e4..6ffe952142e6 100644
@@ -469,6 +469,9 @@ void drm_mode_config_cleanup(struct drm_device *dev)
  	 */
  	WARN_ON(!list_empty(&dev->mode_config.fb_list));
  	list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head) {
+		struct drm_printer p = drm_debug_printer("[leaked fb]");
+		drm_printf(&p, "framebuffer[%u]:\n", fb->base.id);
+		drm_framebuffer_print_info(&p, 1, fb);
  		drm_framebuffer_free(&fb->base.refcount);
  	}
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

✓ Fi.CI.BAT: success for drm: More debug info for fb leaks in mode_config_cleanup

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: drm: More debug info for fb leaks in mode_config_cleanup
URL : https://patchwork.freedesktop.org/series/35038/
State : success

== Summary ==

Series 35038v1 drm: More debug info for fb leaks in mode_config_cleanup
https://patchwork.freedesktop.org/api/1.0/series/35038/revisions/1/mbox/

Test kms_pipe_crc_basic:

        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:438s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:385s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:532s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:283s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:493s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:509s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:495s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:470s
fi-elk-e7500     total:224  pass:163  dwarn:15  dfail:0   fail:0   skip:45 
fi-gdg-551       total:288  pass:178  dwarn:1   dfail:0   fail:1   skip:108 time:269s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:537s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:360s
fi-hsw-4770r     total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  time:260s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:392s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:484s
fi-ivb-3770      total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:443s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:490s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:526s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:474s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:532s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:593s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:457s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:544s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:564s
fi-skl-6700k     total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:516s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:496s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:451s
fi-snb-2520m     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:550s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:415s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:622s
fi-cnl-y         total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:651s
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:492s

bdf9b36fd601c2aa06fb191b31d0bac1197db8d0 drm-tip: 2017y-12m-07d-14h-56m-01s UTC integration manifest 19c16ca706d0 drm: More debug info for fb leaks in mode_config_cleanup

== Logs ==

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

#4 lore raw

✓ Fi.CI.IGT: success for drm: More debug info for fb leaks in mode_config_cleanup

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: drm: More debug info for fb leaks in mode_config_cleanup
URL : https://patchwork.freedesktop.org/series/35038/
State : success

== Summary ==

Test drv_suspend:

        Subgroup forcewake:
                skip       -> PASS       (shard-hsw)
Test kms_cursor_crc:
        Subgroup cursor-256x256-suspend:
                pass       -> SKIP       (shard-hsw) fdo#103375
        Subgroup cursor-64x64-suspend:
                skip       -> PASS       (shard-snb) fdo#102365
Test gem_tiled_swapping:
        Subgroup non-threaded:
                incomplete -> PASS       (shard-hsw) fdo#104009
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-offscren-pri-shrfb-draw-render:
                pass       -> FAIL       (shard-snb) fdo#101623

fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#104009 https://bugs.freedesktop.org/show_bug.cgi?id=104009
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623

shard-hsw        total:2679 pass:1534 dwarn:2   dfail:0   fail:10  skip:1133 time:9384s
shard-snb        total:2679 pass:1307 dwarn:2   dfail:0   fail:12  skip:1358 time:8033s
Blacklisted hosts:
shard-apl        total:2657 pass:1655 dwarn:1   dfail:0   fail:22  skip:977 time:13311s
shard-kbl        total:2599 pass:1748 dwarn:2   dfail:0   fail:22  skip:825 time:10296s

== Logs ==

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

#5 lore raw
In reply to Daniel Vetter

Hi!

Quoted 14 lines · Daniel Vetter

We're spotting this very rarely in CI, but have no idea. Let's add more debug info about what's going on here.

References:https://bugs.freedesktop.org/show_bug.cgi?id=102707

---
  drivers/gpu/drm/drm_mode_config.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_mode_config.c +0 -0
index cc78b3d9e5e4..6ffe952142e6 100644

drivers/gpu/drm/drm_mode_config.c void drm_mode_config_cleanup(struct drm_device *dev) · line 477

Quoted 9 lines
drivers/gpu/drm/drm_mode_config.c +3 -0
@@ -469,6 +469,9 @@ void drm_mode_config_cleanup(struct drm_device *dev)
  	 */
  	WARN_ON(!list_empty(&dev->mode_config.fb_list));
  	list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head) {
+		struct drm_printer p = drm_debug_printer("[leaked fb]");
+		drm_printf(&p, "framebuffer[%u]:\n", fb->base.id);
+		drm_framebuffer_print_info(&p, 1, fb);
  		drm_framebuffer_free(&fb->base.refcount);
  	}
 

Did we ever get to the bottom of what's causing this? We've seen occasional framebuffer leaks when transitioning from one to two screens and back again with vmwgfx on older drms, but I can't seem to reproduce that with the latest upstream code?

Thanks,

Thomas

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
In reply to Daniel Vetter

Hi,

Quoted 14 lines · Daniel Vetter

We're spotting this very rarely in CI, but have no idea. Let's add more debug info about what's going on here.

References: https://bugs.freedesktop.org/show_bug.cgi?id=102707

---
  drivers/gpu/drm/drm_mode_config.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_mode_config.c +0 -0
index cc78b3d9e5e4..6ffe952142e6 100644

drivers/gpu/drm/drm_mode_config.c void drm_mode_config_cleanup(struct drm_device *dev) · line 477

Quoted 9 lines
drivers/gpu/drm/drm_mode_config.c +3 -0
@@ -469,6 +469,9 @@ void drm_mode_config_cleanup(struct drm_device *dev)
  	 */
  	WARN_ON(!list_empty(&dev->mode_config.fb_list));
  	list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head) {
+		struct drm_printer p = drm_debug_printer("[leaked fb]");
+		drm_printf(&p, "framebuffer[%u]:\n", fb->base.id);
+		drm_framebuffer_print_info(&p, 1, fb);
  		drm_framebuffer_free(&fb->base.refcount);
  	}
 

Did we ever get to the bottom of what's causing those framebuffer leaks? We've seen sporadic framebuffer leaks when transitioning between one and two screens, but can't seem to repro with the latest drm-fixes branch?

Thanks,

Thomas

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
Quoted 26 lines · Thomas Hellstrom

Hi,

Quoted 23 lines · Daniel Vetter

We're spotting this very rarely in CI, but have no idea. Let's add more debug info about what's going on here.

References: https://bugs.freedesktop.org/show_bug.cgi?id=102707

---
  drivers/gpu/drm/drm_mode_config.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_mode_config.c +3 -0
index cc78b3d9e5e4..6ffe952142e6 100644
@@ -469,6 +469,9 @@ void drm_mode_config_cleanup(struct drm_device *dev)
         */
        WARN_ON(!list_empty(&dev->mode_config.fb_list));
        list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head)
 {
+               struct drm_printer p = drm_debug_printer("[leaked fb]");
+               drm_printf(&p, "framebuffer[%u]:\n", fb->base.id);
+               drm_framebuffer_print_info(&p, 1, fb);
Quoted 8 lines

drivers/gpu/drm/drm_mode_config.c void drm_mode_config_cleanup(struct drm_device *dev) · line 476

Quoted 3 lines
drivers/gpu/drm/drm_mode_config.c +0 -0
                drm_framebuffer_free(&fb->base.refcount);
        }

Did we ever get to the bottom of what's causing those framebuffer leaks? We've seen sporadic framebuffer leaks when transitioning between one and two screens, but can't seem to repro with the latest drm-fixes branch?

https://bugs.freedesktop.org/show_bug.cgi?id=102707#c16

claims the fixes, but that was incomplete. Ville's recent work to restructure the legacy fb refcounting is meant to plug this leak once and for all. Given that vmwgfx also has some custom code (for the fbdev stuff) could very well be that you have such issues too. See:

commit 5e9cfeba6abb7e1a3f240bd24eb29178f0b83716

Author: Ville Syrjälä <[email protected]>
Date:   Thu Mar 22 17:22:51 2018 +0200
    drm/atomic-helper: Drop plane->fb references only for

drm_atomic_helper_shutdown()

Note that this stuff is only in -fixes, so probably not what you're looking for. -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw
Quoted 35 lines · Daniel Vetter
Quoted 24 lines · Thomas Hellstrom

Hi,

Quoted 21 lines · Daniel Vetter

We're spotting this very rarely in CI, but have no idea. Let's add more debug info about what's going on here.

References: https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.freedesktop.org_show-5Fbug.cgi-3Fid-3D102707&d=DwIFaQ&c=uilaK90D4TOVoH58JNXRgQ&r=wnSlgOCqfpNS4d02vP68_E9q2BNMCwfD2OZ_6dCFVQQ&m=HsUZYQaNMPVelJaUQrEYq1PTFDeRDixr0sJ9o5o5NNA&s=Fy9UT786mIt80SvkAKRdBU4Dy-_cr4ita_RmTA4Lqyk&e=

---
   drivers/gpu/drm/drm_mode_config.c | 3 +++
   1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_mode_config.c +2 -0
index cc78b3d9e5e4..6ffe952142e6 100644
@@ -469,6 +469,9 @@ void drm_mode_config_cleanup(struct drm_device *dev)
          */
         WARN_ON(!list_empty(&dev->mode_config.fb_list));
         list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head)
 {
+               struct drm_printer p = drm_debug_printer("[leaked fb]");
+               drm_printf(&p, "framebuffer[%u]:\n", fb->base.id);
Quoted 8 lines

drivers/gpu/drm/drm_mode_config.c void drm_mode_config_cleanup(struct drm_device *dev) · line 476

Quoted 4 lines
drivers/gpu/drm/drm_mode_config.c +1 -0
+               drm_framebuffer_print_info(&p, 1, fb);
                 drm_framebuffer_free(&fb->base.refcount);
         }

Did we ever get to the bottom of what's causing those framebuffer leaks? We've seen sporadic framebuffer leaks when transitioning between one and two screens, but can't seem to repro with the latest drm-fixes branch?

Quoted 4 lines

claims the fixes, but that was incomplete. Ville's recent work to restructure the legacy fb refcounting is meant to plug this leak once and for all. Given that vmwgfx also has some custom code (for the fbdev stuff) could very well be that you have such issues too. See:

Yes, hmm, the above doesn't fix our particular issue. I'll keep digging.

Thanks,
Thomas

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