You are viewing paulmck

Previous Entry | Next Entry

TMEverywhere
One can execute RPCs within a lock-based critical section, as well as from within an RCU read-side critical section. What happens when you attempt to execute an RPC from within a transaction?

If both the RPC request and its response are to be contained within the transaction, and if some part of the transaction depends on the result returned by the response, then it is not possible to use the memory-buffer tricks that can be used in the case of buffered I/O. Any attempt to take this buffering approach would deadlock the transaction, as the request could not be transmitted until the transaction was guaranteed to succeed, but the transaction's success might not be knowable until after the response is received, as is the case in the following example:

begin_trans();
rpc_request();
i = rpc_response();
a[i]++;
end_trans();

The transaction's memory footprint cannot be determined until after the RPC response is received, and until the transaction's memory footprint can be determined. It is therefore impossible to determine whether the transaction can be allowed to commit.

What can TM do about this scenario?