[all-commits] [llvm/llvm-project] dff390: [libc] Support suspending threads during RPC spin ...

Joseph Huber via All-commits all-commits at lists.llvm.org
Thu Mar 30 09:40:41 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dff3909c3ed935138608a02fcb940589a95f1a14
      https://github.com/llvm/llvm-project/commit/dff3909c3ed935138608a02fcb940589a95f1a14
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M libc/src/__support/RPC/CMakeLists.txt
    M libc/src/__support/RPC/rpc.h
    A libc/src/__support/RPC/rpc_util.h

  Log Message:
  -----------
  [libc] Support suspending threads during RPC spin loops

The RPC interface relies on waiting on atomic signals to coordinate
which side of the protocol is in control of the shared buffer. The GPU client
supports briefly suspending the executing thread group. This is used by the
thread scheduler to identify which thread groups can be switched out so that
others may execute. This allows us to ensure that other threads get a chance
to make forward progress while these threads wait on the atomic signal.

This is currently only relevant on the client-side. We could use an
alternative implementation on the server that uses the standard
`nanosleep` on supported hosts.

Reviewed By: JonChesterfield, tianshilei1992

Differential Revision: https://reviews.llvm.org/D147238




More information about the All-commits mailing list