<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 12/10/21 6:10 PM, Zebediah Figura
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1ea2c8e4-ac88-fdcb-416b-00ce1bad0cde@codeweavers.com">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.
<br>
<br>
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.
<br>
</blockquote>
<p><br>
</p>
<p>Note that it's not just SuspendThread() that would be affected,
but also system APCs.</p>
<p><br>
</p>
<p>In cases like internal Vulkan syscalls we have a bit less
compatibility constrains than in ntdll, because those are not
syscalls called directly by applications. If xsave is causing a
problem, we can put CPU into a state when it's cheaper. We
discussed earlier doing <span class="mx_EventTile_body"
dir="auto">vzeroupper, we could reset even more parts of the
context to make xstor cheaper.</span></p>
<p><span class="mx_EventTile_body" dir="auto"><br>
</span></p>
<p><span class="mx_EventTile_body" dir="auto">That, however, can
help only with context store part of syscalls. There are other
things like %fs base switching on the horizon.<br>
</span></p>
<p><span class="mx_EventTile_body" dir="auto"><br>
</span></p>
<p><span class="mx_EventTile_body" dir="auto">Jacek<br>
</span></p>
</body>
</html>