-
Notifications
You must be signed in to change notification settings - Fork 16
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
Use dirty page flags instead of dirty regions #219
Conversation
@@ -19,6 +19,9 @@ | |||
#include <faabric/util/string_tools.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file are a mix of fixing the race condition and updating to the pages vs. regions change. Race condition seemed to manifest in distributed tests on this PR, so fixed it.
src/scheduler/Executor.cpp
Outdated
} | ||
|
||
if (!exists) { | ||
std::string snapshotKey = faabric::util::getMainThreadSnapshotKey(msg); | ||
bool alreadyExists = reg.snapshotExists(snapshotKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybre refactor to snapshotAlreadyExists
?
Previously we were taking the list of dirty pages, converting this into a
std::vector<std::pair<uint32_t, uint32_t>>
to express a set of regions, then passing this set of regions through the code to the snapshot diffing logic. In fact, it's more efficient and simpler to skip this computation and just directly pass around the list of dirty page flags as astd::vector<char>
. This PR reworks the necessary logic and testing around this change.I've also added a couple of other small changes along the way:
std::map<uint32_t, SnapshotMergeRegion>
to astd::vector<SnapshotMergeRegion>
on each snapshot. This improves insertion performance, and we can sort the vector when necessary (note that sorting was the point of having themap
in the first place).none
dirty tracking, which just marks all pages as dirty. This may be optimal for workloads with a small memory where most of that memory will be dirty anyway, so diffing every page outweighs the cost of the dirty tracking.Executor::executeThreads
.