Skip to content

Commit

Permalink
Forces cache flush before walking Continuation list
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Lu <Jack.S.Lu@ibm.com>
  • Loading branch information
fengxue-IS committed Mar 29, 2023
1 parent 14084ce commit 7873bf8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions runtime/compiler/control/HookedByTheJit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6694,6 +6694,7 @@ static void jitReleaseCodeStackWalk(OMR_VMThread *omrVMThread, condYieldFromGCFu

do
{
vm->memoryManagerFunctions->j9gc_flush_nonAllocationCaches_for_walk(vm);
jvmtiIterationControl rc = vm->memoryManagerFunctions->j9mm_iterate_all_continuation_objects(vmThread, PORTLIB, 0, jitWalkContinuationCallBack, (void*)condYield);
if (JVMTI_ITERATION_ABORT == rc)
yieldHappened = true;
Expand Down
2 changes: 2 additions & 0 deletions runtime/jvmti/jvmtiThread.c
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,7 @@ jvmtiSuspendAllVirtualThreads(jvmtiEnv *env,

/* Walk all virtual threads. */
vmFuncs->acquireExclusiveVMAccess(currentThread);
vm->memoryManagerFunctions->j9gc_flush_nonAllocationCaches_for_walk(vm);
vm->memoryManagerFunctions->j9mm_iterate_all_continuation_objects(currentThread, PORTLIB, 0, jvmtiSuspendResumeCallBack, (void*)&data);
vmFuncs->releaseExclusiveVMAccess(currentThread);

Expand Down Expand Up @@ -1450,6 +1451,7 @@ jvmtiResumeAllVirtualThreads(jvmtiEnv *env,

/* Walk all virtual threads. */
vmFuncs->acquireExclusiveVMAccess(currentThread);
vm->memoryManagerFunctions->j9gc_flush_nonAllocationCaches_for_walk(vm);
vm->memoryManagerFunctions->j9mm_iterate_all_continuation_objects(currentThread, PORTLIB, 0, jvmtiSuspendResumeCallBack, (void*)&data);
vmFuncs->releaseExclusiveVMAccess(currentThread);
done:
Expand Down
1 change: 1 addition & 0 deletions runtime/vm/ContinuationHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ walkAllStackFrames(J9VMThread *currentThread, J9StackWalkState *walkState)

/* Walk all live continuation stacks using the GC Continuation object iterator */
PORT_ACCESS_FROM_VMC(currentThread);
vm->memoryManagerFunctions->j9gc_flush_nonAllocationCaches_for_walk(vm);
vm->memoryManagerFunctions->j9mm_iterate_all_continuation_objects(
currentThread,
PORTLIB,
Expand Down

0 comments on commit 7873bf8

Please sign in to comment.