Implement software write watch and make concurrent GC functional outside Windows
authorKoundinya Veluri <kouvel@microsoft.com>
Thu, 7 Jan 2016 19:21:27 +0000 (11:21 -0800)
committerKoundinya Veluri <kouvel@microsoft.com>
Tue, 12 Apr 2016 23:29:38 +0000 (16:29 -0700)
commitf4e5e5969bbe82691b2d129da073ea5c1d04c03b
tree2b6425d1ae8160d13eb8a73a0f96edce1c1b2432
parent6a9770b07501321efb0aec04c413ce027d1afd8e
Implement software write watch and make concurrent GC functional outside Windows

- Implemented software write watch using write barriers
- A new set of write barriers is introduced, each corresponding to an existing one, but which also updates the write watch table. The GC switches to a write watch barrier during concurrent GC, and switches back to a non write watch barrier after the final query for dirty pages.
- The write watch table is alloacted along with the card table
- Since the card table is used differently, different synchonization is used for the write watch table. The runtime is suspended during resize since that is the most infrequently occuring operation, of that, ResetWriteWatch, and GetWriteWatch.
- ResetWriteWatch() doesn't need a suspend, but since the software WW version is much faster than the Windows version, moved it into the suspended region to avoid some synchronization that would otherwise be required
- The background calls to GetWriteWatch() don't need or do a suspend. They only need to synchronize with the resize path, not for the purpose of correct functionality, but to not miss dirty pages such that concurrent GC is effective.

Miscellaneous:
- Fixed runtests.sh to copy mscorlib.dll and delete the Windows version of mscorlib.ni.dll

Commit migrated from https://github.com/dotnet/coreclr/commit/c235ae17cd3a87f8032948bdcb838641d8e6c055
26 files changed:
src/coreclr/CMakeLists.txt
src/coreclr/src/gc/env/gcenv.base.h
src/coreclr/src/gc/gc.cpp
src/coreclr/src/gc/gcpriv.h
src/coreclr/src/gc/sample/CMakeLists.txt
src/coreclr/src/gc/sample/gcenv.ee.cpp
src/coreclr/src/gc/sample/gcenv.h
src/coreclr/src/gc/softwarewritewatch.cpp [new file with mode: 0644]
src/coreclr/src/gc/softwarewritewatch.h [new file with mode: 0644]
src/coreclr/src/inc/stdmacros.h
src/coreclr/src/vm/CMakeLists.txt
src/coreclr/src/vm/amd64/JitHelpers_Fast.asm
src/coreclr/src/vm/amd64/JitHelpers_FastWriteBarriers.asm
src/coreclr/src/vm/amd64/JitHelpers_Slow.asm
src/coreclr/src/vm/amd64/jithelpers_fast.S
src/coreclr/src/vm/amd64/jithelpers_fastwritebarriers.S
src/coreclr/src/vm/amd64/jithelpers_slow.S
src/coreclr/src/vm/amd64/jitinterfaceamd64.cpp
src/coreclr/src/vm/arm/stubs.cpp
src/coreclr/src/vm/arm64/stubs.cpp
src/coreclr/src/vm/gcenv.h
src/coreclr/src/vm/gchelpers.cpp
src/coreclr/src/vm/gchelpers.h
src/coreclr/src/vm/i386/jitinterfacex86.cpp
src/coreclr/src/vm/jitinterface.h
src/coreclr/tests/runtest.sh