This is an archive of the discontinued LLVM Phabricator instance.

[libc] Cache ownership of the shared buffer in the port
ClosedPublic

Authored by jhuber6 on May 13 2023, 8:23 PM.

Details

Summary

This patch adds another variable to cache cases where we know that we
own the buffer. This allows us to skip the atomic load on the inbox
because we already know its state. This is legal immediately after
opening a port, or when sending immediately after a recieve. This
caching nets a significant (~17%) speedup for the basic open, send,
recieve combination.

Diff Detail

Event Timeline

jhuber6 created this revision.May 13 2023, 8:23 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 13 2023, 8:23 PM
jhuber6 requested review of this revision.May 13 2023, 8:23 PM
jhuber6 updated this revision to Diff 521960.

Fix

JonChesterfield accepted this revision.May 14 2023, 7:24 AM

LG. I think the expected use case of this port is an object that gets disassembled by SROA so there's a decent chance the extra boolean is removed before codegen.

libc/src/__support/RPC/rpc.h
343

This out field could be a bool too, it's a similar sort of thing to receive/owns_buffer

This revision is now accepted and ready to land.May 14 2023, 7:24 AM
This revision was automatically updated to reflect the committed changes.