This is an archive of the discontinued LLVM Phabricator instance.

[libc] Check the RPC server once again after the kernel exits
ClosedPublic

Authored by jhuber6 on May 12 2023, 9:35 AM.

Details

Summary

We support asynchronous sends, that means that the kernel can issue a
send, then exit the kernel as we do with the EXIT syscall. Because of
the condition it's therefore possible for the kernel to exit and break
from the loop before we check the server again. This can potentially
cause us to ignore an EXIT call from the GPU.

Diff Detail

Event Timeline

jhuber6 created this revision.May 12 2023, 9:35 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 12 2023, 9:35 AM
jhuber6 requested review of this revision.May 12 2023, 9:35 AM
lntue accepted this revision.May 12 2023, 9:37 AM
This revision is now accepted and ready to land.May 12 2023, 9:37 AM

If the server gets a value after the kernel has finished, it can send work back to the kernel, which won't do anything useful. Is there a way we can guard against that, perhaps in handle?

jhuber6 added a comment.EditedMay 12 2023, 9:41 AM

If the server gets a value after the kernel has finished, it can send work back to the kernel, which won't do anything useful. Is there a way we can guard against that, perhaps in handle?

I don't think that's possible given the API, the kernel would be blocked on that value to be returned from the server and unable to exit.

JonChesterfield accepted this revision.May 12 2023, 10:18 AM