On 12/10/21 18:10, Zebediah Figura wrote:
One possible optimization that Paul and I had discussed a while back was to allow for the possibility of "masked" or "uninterruptible" syscalls, that is, syscalls that cannot be directly interrupted with SuspendThread(). The idea is that instead of saving the whole nonvolatile context up front, you instead set a flag in the syscall dispatcher (when SIGUSR1 is received) that tells the restore path to save the whole context and break into the suspend handler.
This would only be usable for calls which don't sleep (or don't sleep for a meaningful amount of time), but as I understand that could include most Vulkan calls, including vkUpdateDescriptorSets and other important ones.
I think we should have that kind of optimization, and a better understanding of the xsavec64 issue and mitigation, before adding syscall overhead to more functions. Especially when we don't have a very clear view on on how they are used.