Comment by perching_aix
23 days ago
Nice dig. Could you share more about how you narrowed it down in the end? Is it a known issue and you just had to confirm it applies, or did you identify all of this yourself?
23 days ago
Nice dig. Could you share more about how you narrowed it down in the end? Is it a known issue and you just had to confirm it applies, or did you identify all of this yourself?
`perf` to get go from the "it's stuttering" to "it's spending a very long time in the gpu driver". GDB and printf debugging to get to "the sort in the driver is taking a long time because there are an excessively large amount of TTM buffer objects, not because we are calling it too much". I could have made that leap faster, and I will the next time, but this time that step took me a couple of hours. From there it was a question of who is making those buffer objects, and so it was back to GDB to find nothing in sway/wlroots.
That was where I sort of ran out of good ideas. I have never worked with Wayland before. I figured it's a "protocol" so it must have a way to inspect it, and it does. `WAYLAND_DEBUG=1` allows you to dump the wayland messages, which I then manually inspected to find a discrepancy between allocations and dealloctions. That's a client (aka firefox) bug, so I looked through their issue tracker where I found a somewhat similar bug[1]. I reported my findings there.
Since then I've checked out the firefox code (which I've also never worked with before). Back in GDB and the logs, and I think I know what's going wrong. You can read the bugzilla for that though.
[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1999636
Unexpected side quests are so much more enticing when equipped with the skill set to dig deep – but also, much more time-consuming.. Thanks for sharing! : )