On Thu Jan 25 18:39:04 2024 +0000, Paul Gofman wrote:
rt_tgsigqueueinfo looks interesting to me, thanks. Anyway, in the view of more generic discussion it looks like it makes more sense to introduce variable sized context transfers (and maybe some other bits of generic xstate support first).
Yes, in context of avx512 I think that we don't need to worry about `SIGUSR1` performance at this point, it would be good to have more of the infrastructure first. I'd expect syscall dispatcher to be much more sensitive, for example.
For the optimization itself, messing with a separated signal does not seem right. Maybe instead of worrying about signal performance, we could avoid the signal more often in the first place? It seems to me that it would be possible to use any available suspended thread instead of specific thread to deliver async result much more often. This could potentially make use of `SIGUSR1` for purposed other than the actual suspend very rare.
Another possibility would be to decouple context availability from thread suspension in server. For example, we could have a pseudo-APC that server could use to retrieve the context. With that, server could immediately consider waiting thread as suspended and retrieve the context only when it's actually needed. I'm not sure if it's worth the complexity without trying.