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

Snapshot writing #278

Merged
merged 13 commits into from Dec 13, 2018

Conversation

2 participants
@daumayr
Copy link
Contributor

commented Nov 16, 2018

This PR introduces snapshot creation by serialising received messages that stem from before the snapshot. Each processing thread holds a SnapshotBuffer, similar to TracingBuffers.
The most recent snapshot is persisted on VM shutdown.
Also introduces splitting of the trace (and external data) in separate files for each snapshot.

daumayr added some commits Oct 31, 2018

Add Snapshotbuffer handling.
Splits actor related bookkeeping off into SnapshotRecord.
Changed Reference format, the two MSB now indicate the thread owning the buffer.
Some refactoring/restructuring.
Fix infinite replacement loop
CachedNode kept replacing itself because due to missing object layout update the guard kept throwing errors.
add snapshot test
based on serialising every message, uses the -sam flag

@daumayr daumayr force-pushed the daumayr:Snap branch from e14c673 to 92eaec4 Nov 20, 2018

Repository owner deleted a comment from codacy-bot Nov 20, 2018

Repository owner deleted a comment from codacy-bot Nov 20, 2018

@smarr
Copy link
Owner

left a comment

First look at the changes.

Show resolved Hide resolved build.xml
Show resolved Hide resolved src/som/interpreter/actors/Actor.java Outdated
Show resolved Hide resolved src/som/interpreter/actors/EventualMessage.java Outdated
Show resolved Hide resolved src/som/interpreter/actors/EventualMessage.java Outdated
Show resolved Hide resolved src/tools/concurrency/TracingActivityThread.java Outdated
}

@TruffleBoundary
public static void switchTrace(final byte newSnapshotVersion) {

This comment has been minimized.

Copy link
@smarr

smarr Nov 20, 2018

Owner

And this?

I don't really know what the background to this is.

@@ -335,8 +402,8 @@ private BufferAndLimit tryToObtainBuffer() {

private void writeExternalData(final FileOutputStream edfos) throws IOException {
while (!externalData.isEmpty()) {
Object[] o = externalData.poll();
for (Object oo : o) {
Object[] ed = externalData.poll();

This comment has been minimized.

Copy link
@smarr

smarr Nov 20, 2018

Owner

what's ed? I don't understand abbreviations!

Show resolved Hide resolved src/tools/concurrency/TracingBackend.java Outdated
Show resolved Hide resolved src/tools/snapshot/SnapshotBuffer.java Outdated
@@ -57,7 +57,7 @@ public void serialize(final SBlock block, final SnapshotBuffer sb) {

for (int i = 0; i < args.length; i++) {
Types.getClassOf(args[i]).serialize(args[i], sb);
sb.putLongAt(base + (i * Long.BYTES), sb.getObjectPointer(args[i]));
sb.putLongAt(base + (i * Long.BYTES), sb.getRecord().getObjectPointer(args[i]));

This comment has been minimized.

Copy link
@smarr

smarr Nov 20, 2018

Owner

The getRecord() is this performance critical? Does it need to be moved out of the loop?
I mean, all the code here is unoptimized, for instance the Types.getClassOf isn't even going to compile.

This comment has been minimized.

Copy link
@daumayr

daumayr Nov 21, 2018

Author Contributor

I moved it out of the loop, it's a simple getter. I'm adding a todo for optimisation, first of all we need to specialise on the different blocks, then we can cache the argument serialisation.

smarr and others added some commits Nov 21, 2018

Update Comment
Co-Authored-By: daumayr <daumayr162@gmail.com>

@daumayr daumayr force-pushed the daumayr:Snap branch from 8782b05 to 1e2a1f7 Nov 21, 2018

@daumayr daumayr force-pushed the daumayr:Snap branch from e789bcd to 3d7939a Nov 21, 2018

@smarr smarr added this to To Do in Actor Record & Replay via automation Nov 26, 2018

@smarr smarr added this to the v0.7.0 milestone Nov 26, 2018

@smarr smarr added the enhancement label Nov 26, 2018

@smarr smarr self-assigned this Nov 26, 2018

@smarr

This comment has been minimized.

Copy link
Owner

commented Dec 7, 2018

Do I need to look into this PR again? (was holding off because of failing tests)

@daumayr

This comment has been minimized.

Copy link
Contributor Author

commented Dec 7, 2018

I need to look into them, I've been a bit distracted by the Compiler Summit and getting replay to work.

@smarr

This comment has been minimized.

Copy link
Owner

commented Dec 7, 2018

Sure :) just went through my todo list, and wanted to make sure that I am not blocking anything :)

daumayr added some commits Dec 12, 2018

@smarr
Copy link
Owner

left a comment

Looks good to me, but would be great if you could still enable testing in the GitLab config.

Show resolved Hide resolved .travis.yml

Actor Record & Replay automation moved this from To Do to In Progress Dec 13, 2018

@smarr

smarr approved these changes Dec 13, 2018

@smarr smarr merged commit 89085ce into smarr:dev Dec 13, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

Actor Record & Replay automation moved this from In Progress to Done Dec 13, 2018

@daumayr daumayr deleted the daumayr:Snap branch Jan 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.