Age | Commit message (Collapse) | Author | Files | Lines |
|
This change modifies the GCToEEInterface::CreateBackgroundThread so that it returns
a fully initialized and running thread.
|
|
I've removed blocks with PAL_TRY that were under CATCH_GC. I also had to
fix contract problem in GCToEEInterface::GcStartWork that was marked as
THROWS due to StubHelpers::ProcessByrefValidationList being marked as
THROWS, but the StubHelpers::ProcessByrefValidationList in fact doesn't
throw since it has body wrapped in EX_TRY / EX_CATCH.
This also fixes a problem that started to appear after my previous exceptions
fix change.
|
|
The GC code in general doesn't expect exceptions to be thrown from functions
it calls. However, the event creation functions were in fact throwing, so
in case of OOM, exception would be thrown from various places of the code.
This change creates non-throwing versions of the event creation functions
and replaces all usages of the throwing ones in the GC.
In addition, I've removed blocks with PAL_TRY that were under NO_CATCH_HANDLERS
define and also added Object::SetAppDomainNoThrow, which allowed me to removed
EX_TRY from GCHeap::StressHeap where the Object::SetAppDomain was called before.
|
|
complus var GCNoAffinitize or project.json System.GC.NoAffinitize - specify 1/true to disable hard affinity of Server GC threads to CPUs
complus var GCHeapCount or project.json System.GC.HeapCount - specify the # of Server GC threads/heaps, must be smaller than the # of logical CPUs the process is allowed to run on, ie, if you don't specifically affinitize your process it means the # of total logical CPUs on the machine; otherwise this is the # of logical CPUs you affinitized your process to.
|
|
by different
folks and was very intertwined. For full CLR we always have both defined but for coreclr
perf counters are not enabled so some things for ETW were just 0. Need to make sure when one
is not defined the rest are still getting the data they need.
|
|
This change fixes a problem that happened when the `gc_heap::create_bgc_thread`
calls SetupUnstartedThread and it fails to allocate a Thread object and throws.
The GC doesn't expect that and so when the stack is unwound, the `gc_heap::gc_started`
stays set. Now we try to allocate memory for the Throwable for the exception, so we go
to GC heap and since there is not enough space, we end up calling
`gc_heap::try_allocate_more_space`, which calls `gc_heap::wait_for_gc_done`.
And that’s the end of it, since the `gc_started` is still set and we wait forever.
The fix is to catch exception from the SetupUnstartedThread. I have also fixed couple of
places where this method was being called and the exception was not expected.
As an additional cleanup, I have moved the thread creation in GC to the GCToEEInterface.
|
|
|
|
Observed issue:
- When software write watch is enabled, the runtime is suspended in grow_brick_card_tables() to copy the dirty state of pages into the new table
- The global card table pointer was updated before the attempt to suspend the runtime
- That thread gets blocked there, while the background GC thread successfully suspends the runtime, and calls copy_brick_card_table()
- Since the lowest and highest addresses of the GC heap were not updated, copy_brick_card_table() reads invalid memory
Fixes:
- Moved the change to g_card_table to after the point of suspend for software write watch. At the point of this suspend, the global state will be that prior to resize.
- Though much less frequent, this issue can also occur with the implicit suspend that occurs as part of StompWriteBarrierResize(), when the write barrier type needs to be changed. Moved the other StompWriteBarrierResize() down such that it is done after all global state is updated. At the point of this suspend, the global state will be that following resize.
- I don't think we can have a failure path (failing to commit the mark array) after updating global state such as g_card_table. Soon after that, there may be changes to the new table on paths that don't go through the write barrier, and upon failure to commit the mark array, those updates would be lost. Passed the new card table to functions that need them, and moved changes to global table pointers to after all of the failure points.
Fixes #4750
|
|
StompWriteBarrierEphemeral may be called on the init path, where the runtime is technically not suspended, but has not started yet. Added a check for g_fEEInit in the call.
|
|
- 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
|
|
|
|
[tfs-changeset: 1580785]
|
|
[tfs-changeset: 1576135]
|
|
- Custom attribute to suppress NGen with method granularity
- Static contract fixes
- GC fix
[tfs-changeset: 1571860]
|
|
|
|
https://github.com/dotnet/corert/tree/master/src/Native/gc 0dcc350dae128b6fcca6b1ed74b580ed3240460a
|
|
This change replaces all calls of OS specific functions in the GC by a call to
a platform agnostic interface. Critical sections were abstracted too.
The logging file access was changed to use CRT functions instead of Windows specific APIs.
A "size" member was added to the card_table_info so that we can pass the right
size to the VirtualRelease method when destroying the card table.
I have also fixed a bug in the gc_heap::make_card_table error path where when VirtualCommit
failed, it called VirtualRelease with size that was not the reserved size, but
the committed size.
Other related changes
- All interlocked operations moved to Interlocked class as static methods
- Removed unused function prototypes
- Shuffled stuff in the root CMakeLists.txt to enable building the GC sample using the
settings inherited from the root CMakeLists.txt and to clean up some things that have
rotted over time, like the FEATURE_xxx macros not being in one alphabetically ordered
block
- Fixed the VOLATILE_MEMORY_BARRIER macro in the gcenv.base.h
- Replaced uint32_t thread id by EEThreadId
- Removed thread handles storage (g_gc_thread) from the GC. The thread handle is closed right after the thread is launched. That allowed me to get rid of the GCThreadHandle
- Renamed the methods of the EEThreadId to be easier to understand
- Moved the gcenv.windows.cpp and gcenv.unix.cpp to the sample folder
|
|
https://github.com/dotnet/corert/tree/master/src/Native/gc e223e35867c4660fe8423fedb2e547152dd7fd2d
|
|
- Low memory perf fixes in GC
- Update EnC-capable logic to depend on assembly manifest
[tfs-changeset: 1558202]
|
|
https://github.com/dotnet/corert/tree/master/src/Native/gc 6fb4eecd513d3b3e1ae7584a22ece46107e98069
|
|
https://github.com/dotnet/corert/tree/master/src/Native/gc c03d823a11f54e734e340813e6cd1e543ca448ef
|
|
|
|
This change replaces DWORD, LONGLONG, ULONGLONG, SIZE_T, BYTE, LONG32 and few more by
standard c++ types. The DWORD still remains present in signatures of Windows APIs used
by the GC. There are few issues with those that need to get fixed.
|
|
Core runtime and GC changes from https://github.com/Microsoft/dotnet/blob/master/docs/releases/net461/dotnet461-changes.md that are not in CoreCLR yet
[tfs-changeset: 1543382]
|
|
|
|
Most of the changes are about mismatches between printf formatting strings and argument types.
Fix #1294.
|
|
[tfs-changeset: 1448103]
|
|
1121801 X64: Assert mark_stack_array[entry].len == 0 || mark_stack_array[entry].len >= Align(min_obj_size), vm\gc.cpp, Line: 13747 (OriginCS: 1420599)
[tfs-changeset: 1442449]
|
|
1118110 [GC] Assert "chosen_power2 == 0", ndp\clr\src\vm\gc.cpp, Line: 8566 (Origin CS 1410546 - required for the next change)
1119047 ARM heap corruptions found in assert in gc_heap::plan_phase (Origin CS 1414858)
[tfs-changeset: 1442444]
|
|
This change fixes:
1) Member initiazalization order in class constructor didn't correspond to the member order in some classes
2) Objects with vtables were copied via memcpy. While this is intentional, cast of the pointers to void*
is required to silence clang warning
3) Switch case statements containing values of different enums
4) Casting int to pointer
5) Missing return value in methods with _ASSERTE
6) Class name classifier on methods in the .h
7) Invalid position of the DECLSPEC_ALIGN at few places - it had no effect
8) Invalid position of the 'used' attribute
9) Issue with comparing holders to NULL
10) Operator 'new' returning NULL without being marked with throw() or noexcept
11) Variables marked as 'extern' at the declaration / initialization place
12) Data structure declared as struct at one place and forward declared as class at another
Some disabled warnings were no longer happening, so options to disable them were removed too
|
|
qualified name of the static/global.
First pass at the global DAC table support for Linux. Explicitly build the table in the coreclr module instead of extract it from the pdb and put it in a resource.
Fixed the SVR gc globals in the DAC table. They had to be seperated and initialized in gceesvr.cpp.
Start on global pointer table.
PAL functions to write and read the DAC table address between processes.
The dac table is now copied from the coreclr process to the DAC/debugger process. The tables were not being built with exactly the same defines so they weren't the same size. Fixed a bug in the read memory implementation. Still assumes pid = 0.
Changed the dacTable entries to be RVAs and renabled getting the corclr module base addres (m_globalBase). Added dac table address file cleanup on coreclr shutdown.
Filled in the vtable entries in the global dac table. Changed some of the VPTR_* macros to be defined on the coreclr side (RS) to defined a constructor that is used to get the vtable in dactable.cpp. These changes required default constructors to be added to some of the classes.
Changed getting the vtable address to not invoke the destructors since the constructor used didn't do anything (like initialize variables, etc.).
Added a TODO comment about the debuggee pid not being available in the dac table address file name.
Fixed Windows build. Created a couple of new VPTR_* macros that add a default constructor only if building coreclr (not DAC) on Linux.
Comment on how these DAC table functions are temporary.
|
|
This mode lets users to specify an allocation amount for which no GCs would happen. Sometimes during the absolutely performance critical paths users have the desire to allocate without interference from the GC. If there is enough memory, GC will not kick in while this mode is set.
[tfs-changeset: 1421386]
|
|
|
|
[tfs-changeset: 1407945]
|