Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
* Remove concept of AppDomains from the GC
- Leave constructs allowing for multiple handle tables, as scenarios for that have been proposed
- Remove FEATURE_APPDOMAIN_RESOURCE_MONITORING
|
|
|
|
|
|
This change removes CPU groups emulation from Unix PAL and modifies the
GC and thread pool code accordingly.
|
|
|
|
Each entry has to be prefixed by group number followed by comma. There
is nothing like global CPU index on Windows, all the APIs that support
more than 64 processors use group, in-group index pair. So specifying
the affinity this way matches what users are used to.
|
|
The GCHeapAffinitizeRanges are now used only when CPU groups are enabled
and the GCHeapAffinitizeMask when CPU groups are disabled.
|
|
|
|
This change removes all explicit manipulation and handling of CPU groups
from the gc.cpp and hides it behind the GCToOSInterface. This is a step
to prepare for removing the CPU groups emulation on Unix. In fact, I've
already updated the standalone Unix GC to be able to affinitize GC
threads to any subset of CPUs and added previously missing support for
the affinity setting itself. The NUMA support still remains missing there.
It also adds a new way to specify GC thread affinitization that is not
limited to 64 threads. Instead of affinity mask stored in 64 bit
integer, we now use a bitset that can contain as many processors as
GC can support. And there is a new GC config to specify the affinity in
a form of a range list.
|
|
* Fix how we check whether events are enabled via LTTng
* Add GCToEEInterface::UpdateGCEventStatus
* Fix build errors
* Finished hooking it up to post_gc
* Some comments about the event keyword/level detection logic
* Fix windows build
* Fix Prv provider keyword logic
* forgot to add one more ifdef
* Fix OSX build
* one more ifdef to fix
* Addressing PR feedback
* Update GCEventStatus at gc_heap::initialize_gc too
|
|
* Replace __sync_swap with __atomic_exchange_n
__sync_swap() is a clang specific function.
* Remove multiline comment
* Add paranthesis around sum
src/md/hotdata/../inc/streamutil.h:73:34: warning: suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses]
UINT32 aligned = *totalBytes + 3 & ~3;
* Define __int64
* Define windows types for tests
* Remove undefined has_builtin defines and define alloca and inline for GNUC
* Remove __clang__ where possible
* Add implicit casting to help compiler find WCHAR* variant
src/binder/assembly.cpp:294:73: error: no matching function for call to ‘SString::SString(SString)’
return (pAsmName == nullptr ? nullptr : pAsmName->GetSimpleName());
^
In file included from src/inc/sstring.h:1082:0,
from src/inc/ex.h:19,
from src/inc/stgpool.h:28,
from src/inc/../md/inc/metamodel.h:18,
from src/inc/../md/inc/metamodelro.h:19,
from src/inc/metadata.h:17,
from src/binder/../vm/util.hpp:19,
from src/binder/../vm/common.h:110,
from src/binder/assembly.cpp:14:
src/inc/sstring.inl:73:8: note: candidate: SString::SString(void*, COUNT_T)
inline SString::SString(void *buffer, COUNT_T size)
^
src/inc/sstring.inl:73:8: note: candidate expects 2 arguments, 1 provided
src/inc/sstring.inl:436:8: note: candidate: SString::SString(SString::tagLiteral, const WCHAR*, COUNT_T)
inline SString::SString(tagLiteral dummytag, const WCHAR *literal, COUNT_T count)
^
src/inc/sstring.inl:436:8: note: candidate expects 3 arguments, 1 provided
src/inc/sstring.inl:418:8: note: candidate: SString::SString(SString::tagLiteral, const WCHAR*)
inline SString::SString(tagLiteral dummytag, const WCHAR *literal)
^
src/inc/sstring.inl:418:8: note: candidate expects 2 arguments, 1 provided
src/inc/sstring.inl:401:8: note: candidate: SString::SString(SString::tagUTF8Literal, const UTF8*)
inline SString::SString(tagUTF8Literal dummytag, const UTF8 *literal)
^
src/inc/sstring.inl:401:8: note: candidate expects 2 arguments, 1 provided
src/inc/sstring.inl:382:8: note: candidate: SString::SString(SString::tagLiteral, const CHAR*)
inline SString::SString(tagLiteral dummytag, const ASCII *literal)
* Reorder DLLEXPORT and STDAPI
GNUC wants extern "C" <attribute> format.
* Abstract __FUNCSIG__
* Abstract __debugbreak()
* Move common compiler options out of clang and add Wno-unused-value
* Add paranthesis around || and &&
src/gc/gc.cpp:9084:38: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
(!chosen_power2) && (i < free_space_count));
* Set Wno-delete-non-virtual-dtor for CXX files only
* Don't warn on unterminated endif labels
* Suppress unused functions
* Use 0x syntax rather than h syntax on GNU asm files
* Correct constructor call directly
src/ToolBox/superpmi/superpmi-shared/logging.cpp:301:27: required from here
src/inc/clr_std/string:58:9: error: cannot call constructor ‘std::basic_string<char>::basic_string’ directly
this->basic_string::basic_string(_Ptr, c_len(_Ptr));
* Suppress NULL used in arithmetic warnings
|
|
* removing references to COUNTER_ONLY, ENABLE_PERF_COUNTERS in src/vm directory
* removing perfcounters* files
* Fix build
* Remove PerfCounterSupportedBuild
* Some more cleanup on the GC side
|
|
GCHeapHardLimit - specifies a hard limit for the GC heap
GCHeapHardLimitPercent - specifies a percentage of the physical memory this process is allowed to use
If both are specified, GCHeapHardLimit is checked first and only when it's not specified
would we check GCHeapHardLimitPercent.
If neither is specified but the process is running inside a container with a memory
limit specified, we will take this as the hard limit:
max (20mb, 75% of the memory limit on the container)
If one of the HardLimit configs is specified, and the process is running inside a container
with a memory limit, the GC heap usage will not exceed the HardLimit but the total memory
is still the memory limit on the container so when we calculate the memory load it's based
off the container memory limit.
An example,
process is running inside a container with 200mb limit
user also specified GCHeapHardLimit as 100mb.
if 50mb out of the 100mb is used for GC, and 100mb is used for other things, the memory load
is (50 + 100)/200 = 75%.
Some notes on these configs -
+ The limit is the commit size.
+ This is only supported on 64-bit.
+ For Server GC the minimum *reserved* segment size is 16mb per heap, this is to avoid the
scenario where the hard limit is small but the process can use many procs and we end up
with tiny segments which doesn't make sense. We then keep track of the committed on the segments
so the total does not exceed the hard limit.
|
|
|
|
Normalize a few more spin-wait loops
- Fixed a few more spin-waits to normalize the spin-wait duration between processors
- These spin-waits have so far not needed to be retuned to avoid unreasonably long spin-wait durations. They can be retuned as necessary in the future.
- Added a version of YieldProcessorNormalized() that normalizes based on spin-wait counts tuned for pre-Skylake processors for spin-wait loops that have not been retuned.
- Moved some files around to make YieldProcessorNormalized() and the like available in more places. Initialization is still only done in the VM. Uses outside the VM will use the defaults, where there would be no significant change from before.
- Made YieldProcessor() private outside of the GC and added System_YieldProcessor() for when the system-defined implementation is intended to be used
|
|
+alloc lock split into SOH and LOH
+provisional mode to fix too many gen2 GCs triggered in low mem situation when the heap has heavy pinning fragmentation
+better free list usage
+premature OOM fixes
+3 new configs: GCHeapAffinitizeMask, GCHighMemPercent, GCLOHThreshold (will be documented)
YieldProcessor scaling factor is different on core due to the different implementation on core.
|
|
This change removes enforcing of full GC after native LoaderAllocator is
destroyed. It turns out it was not needed. There is no regression in
running coreclr pri 1 tests inside an unloadable AssemblyLoadContext and
unloading the context after a test completes for each test.
|
|
|
|
The BitScanForward/BitScanForward64 wrapper functions from the PAL and
gcenv have been modified so they're faster (and branchless), while also
adhering more closely to the behavior of the MSVC intrinsics.
Use _BitScanForward64 when targeting 64-bit Windows.
The _WIN32 macro is always defined by MSVC, even when targeting 64-bit
versions of Windows. Use the _WIN64 macro instead to check whether the
build is targeting 64-bit Windows, and if so, use the _BitScanForward64
intrinsic for the BitScanForward64 wrapper instead of the 32-bit-based
fallback.
|
|
GCToEEInterface (#19774)
|
|
* re-enable com for local gc
* Use RefCountedHandleCallbacks instead of new api
|
|
stubs from local gc (#19500)
* Switch NumaNodeInfo and CPUGroupInfo to the interface
* Remove AppDomain/SystemDomain stubs
* remove EEConfig methods
* Port numa code to the coreclr side
* add numa back to PAL and standalone builds
* enable numa for PAL/Standalone builds, and fix BOOL warnings
* remove unused defines, and fix linux build errors
* building on windows
* about to delete numa work from unix and want a backup
* add stubs for unix numa/cpugroup
* Code review feedback
* Code review feedback
|
|
|
|
Fixes build breaks with latest Visual Studio Preview.
Fixes #18338
|
|
Fixes https://github.com/dotnet/coreclr/issues/17591
|
|
|
|
|
|
(#17142)
|
|
calls in to the runtime (#16765)
* [Local GC] Refactor calls involving thread modes, suspension, and alloc contexts to always operate on current thread
* BOOL -> bool for enable/disable preemptive routines, also remove an unused call to GetThread
* avoid one indirection by having GCToEEInterface::EnablePreemptiveGC return a bool indicating whether the mode was changed
* Callback on IGCHeap for the runtime to notify the GC when it is trapping threads
* use g_fSuspensionPending instead of GCToEEInterface::CatchAtSafePoint for allow_fgc
* Remove CatchAtSafePoint
* Remove GetThread from WaitLongerNoInstru
* code review feedback
* code review feedback
* change BOOL to bool
|
|
* move GC etw enums to gcinterface.ee.h
* add GetActiveSyncBlockCount
* refactor reference to ETW::GCLog::ShouldTrackMovementForEtw()
* mov g_dwHandles to gc side
* enable FEATURE_EVENT_TRACE for gc
|
|
GetLargestOnDieCacheSize into GetCacheSizePerLogicalCpu (#15975)
* refactor: combine GetLargestOnDieCacheSize and GetLogicalCpuCount in GetCacheSizePerLogicalCpu
* Perform PhysicalMemoryLimit check also for workstation GC
|
|
(#15957)
* [Local GC] FEATURE_EVENT_TRACE 2/n: Scaffolding for porting known events to callbacks on GCToEEInterface
* Code review feedback: remove `descriptor` system for known events and instead use the gcevents xmacro to generate calls to `GCEventStatus::IsEnabled` with known constants
* Remove more event descriptor code
|
|
* [Local GC] FEATURE_EVENT_TRACE 1/n: Add infrastructure for keeping event state within the GC and plumbing to communicate event state changes
* Code review feedback: use a load without a barrier in IsEnabled and put debug-only code under TRACE_GC_EVENT_STATE
* Address code review feedback: add EventPipe callback and comments
* Fix the non-FEATURE_PAL build
* Fix an issue where the GC fails to react to ETW callbacks to occur before the GC is initialized (e.g. on startup when an ETW session is already active)
* Simplify callback locking scheme
* Add a separate callback for each EventPipe provider and funnel them all through a common handler
* Fix non-FEATURE_PAL build
|
|
EE through four callbacks (#14982)""
|
|
through four callbacks (#14982)"
This reverts commit c755e3b7f5d597c8d192675dbaaa337268d93f1c.
|
|
callbacks (#14982)
* [Local GC] Move knowledge of overlapped I/O objects to the EE through
four callbacks
* Code review feedback:
1. Rename OverlappedData->AsyncPinned in interface methods
2. Remove additional FEATURE_REDHAWK defines around async pin
relocation code
* Eliminate two GCToEEInterface callbacks by passing the callbacks directly as arguments to a method on IGCHandleStore
* Repair clang build
* Split pin and async pin handle scans into two separate callbacks
* Fix the clang and non-Windows builds
|
|
* Initial cut, ignoring thread affinity
* Integrate thread affinity
* Affinity for standalone Windows
* Add 'specialness' and the thread name as arguments to CreateThread
* First crack at unified implementation
* Set priority for server GC threads
* Remove unused parameter
* Address code review feedback and remove some dead code that broke the clang build
* Use char* on the interface instead of wchar_t (doesn't play well cross-platform)
* Rename IsGCSpecialThread -> CurrentThreadWasCreatedByGC
* Code review feedback and fix up the build
* rename CurrentThreadWasCreatedByGC -> WasCurrentThreadCreatedByGC
* Fix a contract violation when converting string encodings
* Thread::CreateUtilityThread returns a thread that is not suspended - restarting a non-suspended thread is incorrect
* CreateUnsuspendableThread -> CreateNonSuspendableThread
|
|
* First cut of the load protocol
* Implement for non-standalone GC
* Initial working implementation
* First steps towards not using GetProcAddress when not using a standalone GC
* Factor out loading routines into standalone and non-standalone cases
* Remove the FEATURE_STANDALONE_GC_ONLY build
* Code cleanup and comments
* Comments for the version numbers
* Use more appropriate type for config string
* add GC_LOAD_STATUS_BEFORE_START to disambiguate failures before the start of the load and failures at the beginning of the load
* FEATURE_STANDALONE_GC on by default
* Implement YieldProcessor and MemoryBarrier for arm and arm64
* Remove missed FEATURE_STANDALONE_GC feature check
|
|
* [Local GC] Move IsGCThread and IsGCSpecialThread to GCToEEInterface
* Fix the windows and sample builds
|
|
This leads to the free list plugs not having the right size on heap traversal (often leading to a crash). The fix is for the free object to be an array with a compenent size of 1 byte.
|
|
(#13656)
* Vendor the volatile.h header into src/gc/env for the standalone GC build
* Repair the GC sample
* Remove some unneeded defines (fixes the sample build)
|
|
build breaks (#13523)
|
|
* [Local GC] Build the GC using system headers
* Disable features to get the GC to build
* Get rid of the separate 'GC PAL' build
* Remove unused stuff
* Don't build gcenv.os.cpp when linking in a standalone gc
* Stub out CPUGroupInfo and NumaNodeInfo
* Stub out IsGCThread and friends
* Build the GC as a shared library :tada:
* Build, link, and run! :tada:
* Fix standalone GC build break
* Fixes where the GC's MethodTable and VM's MethodTable classes disagree
* Integrate a standalone GC into the CoreCLR build system (so it gets copied to the output folder). Re-enable some ifdef-ed out includes that are required for a non-standalone build of the GC.
* Bring changes to Unix and fix the Unix build. Implement some compiler intrinsic wrappers and alignment functions expected by the GC.
* Fix the Windows build
* 1. Code review feedback: use standard types for BitScanForward and
BitScanForward64
2. Delete FEATURE_COM stuff from the build system, not needed for this
PR
3. Fix the Unix build
* Fix the Windows x86 build - the _BitScanForward64 intrinsic is not available when targeting 32-bit platforms
* Remove a number of things from gcenv.base.h that are not used
* Remove a linker workaround now that we are not linking a standalone GC into the runtime
* Remove dead code, make the lack of GC_PROFILING for standalone gc not break profiling on the non-standalone build
* Code review feedback - use add_library_clr and other cmake-related fixes
* Fix include indentation
* Remove some extraneous parameters to cmake functions (cmake is remarkably lenient...)
|
|
* [Arm64] Revise Volatile<T> barriers
* Remove VolateStore from CopyValueClassUnchecked
* Replace MemoryBarrier() in CopyValueClassUnchecked
|
|
* [Arm64/Unix] Support 64K pages
* GC move GCToOSInterface::Initialize() into InitializeGarbageCollector()
|
|
|
|
|
|
* [Local GC] Don't use g_SystemInfo to infer the number of processors
* [Local GC] Avoid using g_SystemInfo.dwAllocationGranularity from within
the GC.
In a few places, the GC aligns the size of a request memory reservation
to the allocation granularity before calling
GCToOSInterface::VirtualReserve. Upon inspection, this isn't necessary.
* [Local GC] Remove uses of g_SystemInfo from the handle table
* Add new API on GCToOSInterface for querying the total number of procs on the machine
|