Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the scalability of SyncIoDisk #262

Open
tatetian opened this issue Jun 6, 2022 · 4 comments
Open

Improve the scalability of SyncIoDisk #262

tatetian opened this issue Jun 6, 2022 · 4 comments
Assignees

Comments

@tatetian
Copy link
Contributor

tatetian commented Jun 6, 2022

The SyncIoDisk in sgx-disk is not scalable on concurrency.

image

The problem is that there is a lock hold while doing I/O. This lock can be removed if using read_at and write_at API.

image

@lucassong-mh
Copy link
Contributor

Workaround: Use std::os::unix::fs::FileExt::read_at and write_at API, remove the lock.
Bench result:
image
Code:
image

@tatetian
Copy link
Contributor Author

tatetian commented Jun 7, 2022

This is good perf improvement. But the implementation contains a bug... The offset should be calculated as follows.

offset += buf.as_slice().len()

Another thing is that the implementation should better use pwritev so that the number of OCalls is always one per request, instead of one per buffer.

@lucassong-mh
Copy link
Contributor

Improvement: Use libc::ocall::preadv64andpwritev64 API.
Bench result:
image
Code:
image

@tatetian
Copy link
Contributor Author

tatetian commented Jun 9, 2022

Great. Now we can submit a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants