8373468: Shenandoah: Mutator may block at _gc_waiters_lock after allocation failure even block parameter is false#28758
8373468: Shenandoah: Mutator may block at _gc_waiters_lock after allocation failure even block parameter is false#28758pengxiaolong wants to merge 12 commits intoopenjdk:masterfrom
Conversation
…ilure even block parameter is false
|
👋 Welcome back xpeng! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@pengxiaolong The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
| ShenandoahSharedFlag _gc_requested; | ||
| GCCause::Cause _requested_gc_cause; | ||
| ShenandoahSharedFlag _gc_requested; | ||
| Atomic<GCCause::Cause> _requested_gc_cause; |
There was a problem hiding this comment.
_requested_gc_cause should always be accessed when holding the _control_lock. Making this atomic should not be unnecessary.
There was a problem hiding this comment.
Yes, the change to use Atomic for _requested_gc_cause is unnecessary, I have reverted it with a minor change for ShenandoahControlThread to always access _requested_gc_cause with _control_lock held.
|
Can you describe the scenario you are trying to fix here? The two control threads have different idle/wakeup conditions. |
The major thing I am fixing in the PR is to make ShenandoahControlThread always honor the |
|
@pengxiaolong This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
|
Closing this PR as we may not want to change the behavior of classic Shenandoah as long as it is not broken. |
There is behavior discrepancy between Shenandoah generational mode and non-generational when it handles mutator allocation failure, as stated in the description of JDK-8373468, in non-generational, the
blockparameter may not always work.Further looking into ShenandoahGenerationalControlThread and ShenandoahControlThread, they handle the _requested_gc_cause and ShenandoahHeap::cancelled_cause differently in other places as well, the change in this PR will minimize the gap to unify the behavior, and also fix potentially missed allocation failure notifications in some rare cases for both control threads.
Test
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28758/head:pull/28758$ git checkout pull/28758Update a local copy of the PR:
$ git checkout pull/28758$ git pull https://git.openjdk.org/jdk.git pull/28758/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28758View PR using the GUI difftool:
$ git pr show -t 28758Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28758.diff
Using Webrev
Link to Webrev Comment