-
Notifications
You must be signed in to change notification settings - Fork 48
8358343: [leyden] Drop notify_all in CompilationPolicyUtils::Queue::pop #74
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
base: premain
Are you sure you want to change the base?
8358343: [leyden] Drop notify_all in CompilationPolicyUtils::Queue::pop #74
Conversation
👋 Welcome back shade! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
Webrevs
|
Is there a reason why can't we just do the processing work in the thread calling the flush instead of waiting for the replay thread? That is, why not make it be like this:
|
You tell me :) I guess one upside of current code is to leave draining/processing in one place/thread, and thus never run into false positives/negatives due to diagnostic code (this hunk, gated by |
I don't remember. :) I'm just not a big fan of spin-waits even with sleeps inside... |
It'd be also a potentially nicely reusable method. Provided that it works of course... |
Actually the current approach (even with the spin-wait) and my solution too are not really correct. The fact that the queue is empty doesn't mean that every last item has been processed. The last item may have been popped, but still is being worked on. So however you look at it we should set up some kind of a handshake to make sure the replay thread is done processing, not just done popping. |
Found this when reading premain-vs-mainline webrev. Mainline does not have
notify_all
in this method:https://github.com/openjdk/jdk/blob/c382da579884c28f2765b2c6ba68c0ad4fdcb2ce/src/hotspot/share/compiler/compilationPolicy.hpp#L85-L92
But if you remove
notify_all()
inpremain
, then tests start to deadlock, see bug for a sample. The culprit isCompilationPolicy::flush_replay_training_at_init
, which is only present in premain. I fixed it by using timed waits, which obviates the need for extra notifications. We only enter this method with-XX:+AOTVerifyTrainingData
, so we don't care much about its performance. This is IMO better than doing a questionablenotify_all
followed bywait
in load-bearing code.Additional testing:
runtime/cds
(5x, no timeouts yet; still running more iterations)Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/leyden.git pull/74/head:pull/74
$ git checkout pull/74
Update a local copy of the PR:
$ git checkout pull/74
$ git pull https://git.openjdk.org/leyden.git pull/74/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 74
View PR using the GUI difftool:
$ git pr show -t 74
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/leyden/pull/74.diff
Using Webrev
Link to Webrev Comment