<div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 25, 2023 at 5:48 PM Danilo Krummrich <<a href="mailto:dakr@redhat.com">dakr@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 7/25/23 18:43, Danilo Krummrich wrote:<br>
> On 7/25/23 18:16, Faith Ekstrand wrote:<br>
>> Thanks for the detailed write-up! That would definitely explain it. If <br>
>> I remember, I'll try to do a single-threaded run or two. If your <br>
>> theory is correct, there should be no real perf difference when <br>
>> running single-threaded. Those runs will take a long time, though, so <br>
>> I'll have to run them over night. I'll let you know in a few days once <br>
>> I have the results.<br>
> <br>
> I can also push a separate branch where I just print out a warning <br>
> whenever we run into such a condition including the time we were waiting <br>
> for things to complete. I can probably push something later today.<br>
<br>
<a href="https://gitlab.freedesktop.org/nouvelles/kernel/-/tree/new-uapi-drm-next-track-stalls" rel="noreferrer" target="_blank">https://gitlab.freedesktop.org/nouvelles/kernel/-/tree/new-uapi-drm-next-track-stalls</a><br>
<br>
It prints out the duration of every wait as well as the total wait time <br>
since boot.<br>
<br>
- Danilo<br>
<br>
> <br>
>><br>
>> If this theory holds, then I'm not concerned about the performance of <br>
>> the API itself. It would still be good to see if we can find a way to <br>
>> reduce the cross-process drag in the implementation but that's a perf <br>
>> optimization we can do later.<br>
> <br>
>  From the kernel side I think the only thing we could really do is to <br>
> temporarily run a secondary drm_gpu_scheduler instance, one for VM_BINDs <br>
> and one for EXECs until we got the new page table handling in place.<br>
> <br>
> However, the UMD could avoid such conditions more effectively, since it <br>
> controls the address space. Namely, avoid re-using the same region of <br>
> the address space right away in certain cases. For instance, instead of <br>
> replacing a sparse region A[0x0, 0x4000000] with a larger sparse region <br>
> B[0x0, 0x8000000], replace it with B'[0x4000000, 0xC000000] if possible.<br>
> <br>
> However, just mentioning this for completeness. The UMD surely shouldn't <br>
> probably even temporarily work around such a kernel limitation.<br>
> <br>
> Anyway, before doing any of those, let's see if the theory holds and <br>
> we're actually running into such cases.<br>
> <br>
>><br>
>> Does it actually matter? Yes, it kinda does. No, it probably doesn't <br>
>> matter for games because you're typically only running one game at a <br>
>> time. From a development PoV, however, if it makes CI take longer then <br>
>> that slows down development and that's not good for the users, either.<br></blockquote><div><br></div><div>I've run a bunch of tests over the weekend and It's starting to look like the added CTS time might be from the newly enabled synchronization tests themselves.  We enabled timeline semaphores as well as semaphore and fence sharing along with the new uAPI and I did not expect those to be nearly that heavy-weight so I didn't think of that as a likely factor. I'm doing a couple more runs to confirm but what I'm seeing right now seems to indicate that the new API with the old feature set has about the same run time now that the submit overhead issue has been fixed.</div><div><br></div><div>I think this means that we can proceed under the assumption that there are no more serious perf issues with the new API.  I'm happy to RB/ACK the next version of the API and implementation patches, as long as it has the new NO_SHARE BO create flag and properly rejects exports of NO_SHARE BOs, even if not all of the dma_resv plumbing is fully baked.</div><div><br></div><div>~Faith<br></div></div></div>