Join Nostr
2024-08-30 15:28:45 UTC
in reply to

Hoshino Lina (星乃リナ) 🩵 3D Yuri Wedding 2026!!! on Nostr: The conflict on the ML happened around two related patches: First, I fixed a bug ...

The conflict on the ML happened around two related patches:

First, I fixed a bug where the scheduler job completion fence had some debug callbacks that would dereference the scheduler object itself. That would mean that the scheduler would have to outlive its fences. This makes *no sense* because fences are long-lived objects: your fence might be attached to a buffer shared to another driver entirely and could be alive forever. Introducing this job completion fence -> scheduler lifetime dependency is silly, because the scheduler is an object owned by one driver. That means that driver, and the structures it associates with a scheduler, might be blocked from cleaning up forever. And this all just due to some debug pretty-print name callbacks! It wasn't even critical core functionality or some deep design decision, just some debug code. But the maintainer blocked it because he believed it was required, and sensible, to have the scheduler outlive its completion fence.

But wait, how do you even do that? If it's the driver's job to ensure that lifetime, but the completion fence is owned by the scheduler, how would that even work?

The answer is that the job completion fence *holds a reference to the hw fence*, even after the latter completes. And *that reference is supposed to cause the driver to keep the scheduler alive*.

So now we have a lifetime chain of job completion fence -> hw fence -> scheduler.