-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fix object layout races #285
Conversation
c84b334
to
5f611db
Compare
src/som/interpreter/objectstorage/ObjectTransitionSafepoint.java
Outdated
Show resolved
Hide resolved
While tests are running for this branch, we still have an issue with some benchmarks. The Vacation Benchmark still deadlocks, so ideally we don't merge this PR until we fix the Join Prim and similar things. |
Ok, will see what I can do about those. Will probably try to do them in a separate PR to see performance issues independently. |
I think we need to exclude those benchmarks (LeeTm and Vacation) until then. |
Phaser was able to terminate, an thread registration didn't prevent threads from making progress.
f4f6d42
to
1ad49a2
Compare
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.
A quick review to give at least some comments.
Sorry, didn't get to more.
src/som/interpreter/objectstorage/ObjectTransitionSafepoint.java
Outdated
Show resolved
Hide resolved
…omPhaser is http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jdk8/java/util/concurrent/Phaser.java?revision=1.3 This is a simple copy, no modifications yet. Signed-off-by: Stefan Marr <[email protected]>
This change introduces our formatting and names the class SafepointPhaser and sets the package name correctly. No changes of functionality. Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
1ad49a2
to
439313e
Compare
src/som/interpreter/objectstorage/ObjectTransitionSafepoint.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Dominik Aumayr <[email protected]> Signed-off-by: Stefan Marr <[email protected]>
The SafepointPhaser should not terminate, even if no parties are registered on it anymore. This can happen with our safepoint design, but it is not safe to terminate the phaser. It needs to continue working and accept threads to join again. Co-authored-by: Dominik Aumayr <[email protected]> Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Remove interruptible, timed, and deadline notions. Signed-off-by: Stefan Marr <[email protected]>
SafepointPhaser isn’t a general purpose class, so, let’s provide features only when needed. Signed-off-by: Stefan Marr <[email protected]>
Co-authored-by: Dominik Aumayr <[email protected]> Signed-off-by: Stefan Marr <[email protected]>
This change uses the knowledge of the safepoint consisting of two phases. This allows us to manage registrations without extra race, and it allows us to renew the assumption as part of the arrival routine in the phaser. Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
13c4a97
to
2c0f9ba
Compare
@daumayr I come up with what I think is a working solution. Could you please review and possible test this? The most important bit to discuss is likely 0274546 |
|
@daumayr hmmmm, ok. Didn't think of that. Looking at the code: https://github.com/smarr/SOMns/pull/285/files#diff-2b3be932b680eb719ab91a02f3b6f064R137 I suppose, I could simply increment the phase in that case by 2, no? |
hmmm, well, possibly depending on in which concrete state we are. Though, we should never unregister during a safepoint. So, probably increment by 2 plus an assertion that we are never in a phase that indicates a safepoint is going on |
Increment by two sounds good, that way we still have a phase change and keep the odd/even. |
ok, cool. and one more todo:
|
… reregistered Signed-off-by: Stefan Marr <[email protected]>
3b34006
to
743481b
Compare
Signed-off-by: Stefan Marr <[email protected]>
743481b
to
56e54f9
Compare
@daumayr could you give this a spin with your snapshot tests? |
Snapshot Tests running, didn't see any errors. |
This PR fixes issue #85.
The Phaser used in ObjectTransitionSafepoint used a default Phaser, which Terminates when onAdvance(...) returns true. This caused the synchronisation methods to have no effect.
The default onAdvance implementation causes the Phaser to terminate when the number of registered Threads is 0.
By overwriting the onAdvance method and returning false we can prevent Phaser from terminating and preserve the synchronisation.