-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8354555: Add generic JFR events for TaskTerminator #24676
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: master
Are you sure you want to change the base?
Conversation
…tor::emit_termination_statistics to emit the event
👋 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. |
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.
It looks compelling, but we need to fix a few issues:
|
||
~TaskTerminationTracker() { | ||
if (_terminator->_task_name != nullptr && _event.should_commit()) { | ||
char* event_name = NEW_C_HEAP_ARRAY(char, strlen(TaskTerminator::termination_event_name_prefix) + strlen(_terminator->_task_name) + 1, mtGC); |
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.
Well, NEW_C_HEAP_ARRAY
without a matching FREE_C_HEAP_ARRAY
is a memory leak.
We do this to prepend Termination:
, right? Can we just pass the constant strings to TaskTerminator
, and avoid all this dynamicity? It would be a bit tedious, but I think you can do the compile-time concatenation with a few macros.
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.
Thanks, I have replaced it with macro for the string concatenation here, now it doesn't use NEW_C_HEAP_ARRAY at all.
…RegionsBaseTask and G1STWRefProcProxyTask
_terminator(num_workers, _task_queues), | ||
_pinned_regions_recorded(false) | ||
{ } | ||
_terminator(num_workers, _task_queues, G1GCPhaseTimes::phase_name(G1GCPhaseTimes::Termination)), |
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.
G1EvacuateRegionsBaseTask emits Termination event from G1ParEvacuateFollowersClosure:: offer_termination(), I am trying to keep it same.
@@ -949,7 +946,7 @@ class G1STWRefProcProxyTask : public RefProcProxyTask { | |||
: RefProcProxyTask("G1STWRefProcProxyTask", max_workers), | |||
_g1h(g1h), | |||
_pss(pss), | |||
_terminator(max_workers, &task_queues), | |||
_terminator(max_workers, &task_queues, G1GCPhaseTimes::phase_name(G1GCPhaseTimes::Termination)), |
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.
RefProcProxyTask emits Termination event from G1ParEvacuateFollowersClosure:: offer_termination(), I am trying to keep it same as it is today.
@pengxiaolong this pull request can not be integrated into git checkout JDK-8354555
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
@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 |
/keepalive |
@pengxiaolong The pull request is being re-evaluated and the inactivity timeout has been reset. |
@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 |
The purpose of the PR is to add generic JFR events for TaskTerminator to track the attempts and timings that GC threads have tried to terminate GC tasks.
Today only G1 emits JFR event with name
Termination
from G1ParEvacuateFollowersClosure, all other garbage collectors don't emit any JFR event for the termination attempt at all.By adding this, it gives performance engineers the visibility to the termination attempts and termination time when GC threads trying to finish GC tasks, we could build tool to analyze the jfr events to determine if there is potential data structure issue in application code, e.g. very large LinkedList or LinkedBlockingQueue.
For the test, I have manually tested different GCs with Flight Recording enabled and verified the events:
G1:
Shenandoah:
Parallel GC:
Test
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24676/head:pull/24676
$ git checkout pull/24676
Update a local copy of the PR:
$ git checkout pull/24676
$ git pull https://git.openjdk.org/jdk.git pull/24676/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24676
View PR using the GUI difftool:
$ git pr show -t 24676
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24676.diff
Using Webrev
Link to Webrev Comment