Bgc suspension fixes (dotnet/coreclr#27729)
authorPeter Sollich <petersol@microsoft.com>
Wed, 13 Nov 2019 23:24:20 +0000 (00:24 +0100)
committerSergiy Kuryata <sergeyk@microsoft.com>
Wed, 13 Nov 2019 23:24:20 +0000 (15:24 -0800)
commit59c5429504222fef7df284bf2684f32a570d4aa8
tree45985b6f444fe6cdd5c01129ed45cfd0a0cd6ca1
parentcc2b418a959b308d09a52ba2cfd8dd9c6d91c645
Bgc suspension fixes (dotnet/coreclr#27729)

* Changes to set gen0 bricks always. This reduces the time spent in find_first_object when finding the start of objects for marking interior pointers.

* Revert "Changes to set gen0 bricks always. This reduces the time spent in find_first_object when finding the start of objects for marking interior pointers."

This reverts commit dotnet/coreclr@9d53ff910ceb5482c67350a88e6687b8f94d5634.

* Two fixes to speed up suspension for foreground GCs while background GC is in progress:

- In background_mark_simple1, check g_fSuspensionPending and if it is set, save the state of the work and restart the loop - this will call allow_fgc() and thus allow a foreground GC to take place.

- In revisit_written_page, call allow_fgc() at the end - this allow a foreground GC to happen whenever we are done with revisiting a written page.

* Addressed code review feedback - use counter instead of testing g_fSuspensionPending directly.

Commit migrated from https://github.com/dotnet/coreclr/commit/a7678f5d8e14ad0edc8d996ae4048079c7b2d575
src/coreclr/src/gc/gc.cpp