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

Add timestamps, queue size and cleared caches information in diagnostic Thread #12746

Merged
merged 1 commit into from
May 21, 2021

Conversation

EmanElsaban
Copy link
Contributor

@EmanElsaban EmanElsaban commented May 20, 2021

Added timestamps in the diagnostic thread to know when the information printed occurred.
In addition, I added the compilation queue size and the number of times the server clears the
clientSessionData/persistent caches.

issue: #12658

Signed-off-by: Eman Elsabban eman.elsaban1@gmail.com

@EmanElsaban
Copy link
Contributor Author

@mpirvu Can you please review my PR? Thanks.

@mpirvu mpirvu self-assigned this May 20, 2021
@mpirvu mpirvu added the comp:jitserver Artifacts related to JIT-as-a-Service project label May 20, 2021
Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some inline comments

@@ -803,6 +803,8 @@ class CompilationInfo
void incNumCompThreadsActive() { _numCompThreadsActive++; }
void decNumCompThreadsActive() { _numCompThreadsActive--; }
void setNumCompThreadsActive(int32_t n) { _numCompThreadsActive = n; }
int32_t getNumClearedCaches() const { return _numClearedCaches; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information is specific to JITServer, so it should stay in a block of code protected by ifdef.

@@ -1160,6 +1162,7 @@ class CompilationInfo
intptr_t _numSyncCompilations;
intptr_t _numAsyncCompilations;
int32_t _numCompThreadsActive;
int32_t _numClearedCaches;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A short comment would be nice here: "number of instances JITServer was forced to clear its internal per-client caches"

@@ -262,6 +262,8 @@ TR::CompilationInfoPerThreadRemote::waitForMyTurn(ClientSessionData *clientSessi
TR_ASSERT(entry._compInfoPT == this, "Must have stored compInfoPT into the entry to be compiled");
uint32_t seqNo = getSeqNo();
uint32_t criticalSeqNo = getExpectedSeqNo(); // This is the seqNo that I must wait for
TR::CompilationInfo *compInfo = getCompilationInfo();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking that, if you make the new counter a static instance of TR::CompilationInfoPerThreadRemote then you don't have to get hold of getCompilationInfo

@@ -334,6 +336,7 @@ TR::CompilationInfoPerThreadRemote::waitForMyTurn(ClientSessionData *clientSessi
!getWaitToBeNotified()) // Avoid a cohort of threads clearing the caches
{
clientSession->clearCaches();
compInfo->setNumClearedCaches(++numClearedCaches);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work because there could be a large time span between the moment you read the counter at the beginning of this function and the current moment where you increment it. These two operations need to stay close to one another. Better still, you can create a function that increments it: incNumClearedCaches()

@@ -112,10 +113,17 @@ static int32_t J9THREAD_PROC statisticsThreadProc(void * entryarg)
avgCpuUsage = cpuUtil->getAvgCpuUsage();
vmCpuUsage = cpuUtil->getVmCpuUsage();
}
OMRPORT_ACCESS_FROM_J9PORT(PORTLIB);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what the overhead of this is, but I believe it can be moved outside the loop, near PORT_ACCESS_FROM_JAVAVM(vm);. BTW do we need both PORT_ACCESS and OMRPORT_ACCESS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need OMRPORT_ACCESS for omrstr_ftime_ex function

…ic thread

Added timestamps in the diagnostic thread to know when the information printed occurred.
In addition, I added the compilation queue size and the number of times the server clears the
clientSessionData/persistent caches.

Signed-off-by: Eman Elsabban <eman.elsaban1@gmail.com>
Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mpirvu
Copy link
Contributor

mpirvu commented May 20, 2021

jenkins test sanity plinuxjit,xlinuxjit,zlinuxjit jdk11

@mpirvu mpirvu merged commit 9fd9685 into eclipse-openj9:master May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:jitserver Artifacts related to JIT-as-a-Service project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants