From: Peter Sollich Date: Mon, 4 Nov 2019 09:07:00 +0000 (+0100) Subject: Suspension fixes (dotnet/coreclr#27578) X-Git-Tag: submit/tizen/20210909.063632~11030^2~132 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=055378fc79cb108b4769878469eb3802e5e61bfe;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Suspension fixes (dotnet/coreclr#27578) * Two simple fixes to suspension issues seen in GCPerfSim: - Insert allow_fgc() call in background_mark_simple - this fixes the cases where there are a ton of GC handles referencing simple objects not containing pointers. - Change PING_JIT_TIMEOUT constant from 10 milliseconds to 1 millisecond. This fixes the case where return address hijacking doesn't work quickly, because the hijacked thread doesn't return (e.g. because it's in a loop doing further calls). In this case we have to retry the hijack, and changing the timeout constant makes this happen more quickly. Commit migrated from https://github.com/dotnet/coreclr/commit/fab7aa20dc4c5856bb4759bbbde0bb88ffd439a2 --- diff --git a/src/coreclr/src/gc/gc.cpp b/src/coreclr/src/gc/gc.cpp index a3b3fc7..be21bfd 100644 --- a/src/coreclr/src/gc/gc.cpp +++ b/src/coreclr/src/gc/gc.cpp @@ -19982,6 +19982,7 @@ gc_heap::background_mark_simple (uint8_t* o THREAD_NUMBER_DCL) background_mark_simple1 (o THREAD_NUMBER_ARG); } } + allow_fgc(); } } diff --git a/src/coreclr/src/vm/threadsuspend.cpp b/src/coreclr/src/vm/threadsuspend.cpp index 9ac413b..f2a29f8 100644 --- a/src/coreclr/src/vm/threadsuspend.cpp +++ b/src/coreclr/src/vm/threadsuspend.cpp @@ -57,7 +57,7 @@ extern "C" void RedirectedHandledJITCaseForGCStress_Stub(void); // Every PING_JIT_TIMEOUT ms, check to see if a thread in JITted code has wandered // into some fully interruptible code (or should have a different hijack to improve // our chances of snagging it at a safe spot). -#define PING_JIT_TIMEOUT 10 +#define PING_JIT_TIMEOUT 1 // When we find a thread in a spot that's not safe to abort -- how long to wait before // we try again.