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

Heavy disk I/O while Waylaying #1

Open
xulai1001 opened this issue Apr 14, 2018 · 0 comments
Open

Heavy disk I/O while Waylaying #1

xulai1001 opened this issue Apr 14, 2018 · 0 comments

Comments

@xulai1001
Copy link

xulai1001 commented Apr 14, 2018

The "relocate.c" program causes extremely high disk I/O loads while working, because it needs to read the randomized "evict" file to get rid of all page caches.

In order to finally relocate a target binary to the desired physical address, it needs to be executed 10,000+ times, which costs several days according to the Flip-in-the-wall article. During the process, although the memory consumption does remain unchanged, the heavy disk I/O load slows the whole system down and can be easily detected.

So, Is there any more efficient way to relocate a binary to a certain phys-addr? (Outside enclaves, root privileges are also OK). I want to optimize the process so that I won't wait for days for this step.

I have tried (below):

  • Waylaying: ~10-30s per run (depending on hdd speed, mine is slow), memory coverage is good.
  • Chasing (with copy-on-write fork()): very fast, but my program always returns repeated addresses. I can only get ~8MB different pages (~2000 pages). Where did I do wrong?
  • posix_fadvise(): can actually relocate, but only gets ~32MB different pages, coverage is poor.
  • posix_fadvise() + some Waylaying: only gets ~100MB different pages.

I have not tried /proc/sys/vm/drop_caches but I feel it does not help much.

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

1 participant