-
My program involves file read/write operations, and to my knowledge, these typically require OCalls in SGX. How does Gramine handle this? Does every file read/write operation (e.g., C++ filestream operations) trigger an SGX OCall in Gramine as well? I’ve conducted performance tests comparing file access times across three environments: REE, Gramine-direct, and Gramine-SGX. Below are the results for a single file read operation (in ns, averaged over multiple random accesses of varying file sizes):
As shown, there is a significant performance drop (~8000 ns) in Gramine-SGX, which I assume is due to the overhead introduced by SGX OCalls. In my scenario, however, I can batch multiple read/write requests together, so ideally, only a single OCall would be required. Is there a way to optimize this in Gramine and reduce the number of OCalls? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In theory yes, but it's not implemented and would require the following:
So, it's quite some work. Not complicated, but adds a bunch of new APIs we'd need to support. Not sure we want that, but I guess we should consider it if it actually significantly helps with performance. |
Beta Was this translation helpful? Give feedback.
In theory yes, but it's not implemented and would require the following:
readv
.readv
andwritev
callbacks in itsstruct libos_fs_ops
.So, it's quite some work. Not complicated, but adds a bunch of new APIs we'd need to support. Not sure we want that, but I guess we should consider it if it actually significantly helps with performance.