summaryrefslogtreecommitdiff
path: root/src/gc
diff options
context:
space:
mode:
authorSung Yoon Whang <suwhang@microsoft.com>2018-09-25 16:18:14 -0700
committerGitHub <noreply@github.com>2018-09-25 16:18:14 -0700
commitb67d2fa8fc8cf5b8c41f5c34b1abe31e704386c4 (patch)
tree597c9d0b8abb6296e8fb154a6a08cbca62aa9923 /src/gc
parent694d8d7fd2fb5d5cf0f664a185d94fea1166ae2f (diff)
downloadcoreclr-b67d2fa8fc8cf5b8c41f5c34b1abe31e704386c4.tar.gz
coreclr-b67d2fa8fc8cf5b8c41f5c34b1abe31e704386c4.tar.bz2
coreclr-b67d2fa8fc8cf5b8c41f5c34b1abe31e704386c4.zip
Porting fix on Desktop for VirtualUnlock perf issue on WKS GC when we reset mem (#20115)
Diffstat (limited to 'src/gc')
-rw-r--r--src/gc/gc.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp
index f8946d7270..c5c178b943 100644
--- a/src/gc/gc.cpp
+++ b/src/gc/gc.cpp
@@ -30668,7 +30668,15 @@ void reset_memory (uint8_t* o, size_t sizeo)
// on write watched memory.
if (reset_mm_p)
{
- reset_mm_p = GCToOSInterface::VirtualReset((void*)page_start, size, true /* unlock */);
+#ifdef MULTIPLE_HEAPS
+ bool unlock_p = true;
+#else
+ // We don't do unlock because there could be many processes using workstation GC and it's
+ // bad perf to have many threads doing unlock at the same time.
+ bool unlock_p = false;
+#endif // MULTIPLE_HEAPS
+
+ reset_mm_p = GCToOSInterface::VirtualReset((void*)page_start, size, unlock_p);
}
}
}