summaryrefslogtreecommitdiff
path: root/src/gc/env
AgeCommit message (Collapse)AuthorFilesLines
2019-07-05many core (#25350)Maoni Stephens3-1/+55
2019-06-11Fix Redhawk definesSuchiman1-3/+0
2019-05-15Remove concept of AppDomains from the GC (#24536)David Wrighton3-26/+2
* 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
2019-05-14Fix issues reported by PREfast static analysis tool (#24577)Jan Kotas3-3/+3
2019-04-24Add Medium GC Profiling Mode & ICorProfilerInfo::GetObjectReferences (#24156)Mukul Sabharwal1-1/+1
2019-04-09Remove Unix CPU groups emulationJan Vorlicek1-3/+7
This change removes CPU groups emulation from Unix PAL and modifies the GC and thread pool code accordingly.
2019-04-08Add Large pages support in GCMukul Sabharwal1-0/+7
2019-04-04Modify affinity range config format for WindowsJan Vorlicek1-0/+12
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.
2019-04-03Use the GCHeapAffinitizeRanges / GCHeapAffinitizeMask exclusivelyJan Vorlicek1-8/+10
The GCHeapAffinitizeRanges are now used only when CPU groups are enabled and the GCHeapAffinitizeMask when CPU groups are disabled.
2019-04-03Reflect PR feedbackJan Vorlicek2-2/+3
2019-04-03Remove CPU groups handling from the gc.cppJan Vorlicek2-41/+103
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.
2019-03-07Fix how we check whether events are enabled via LTTng (#22707)Sung Yoon Whang1-0/+1
* 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
2019-02-22More GNUC Fixes (#22687)Sinan Kaya2-8/+26
* 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
2019-02-21Remove unused perfcounter code (#22742)Sung Yoon Whang1-2/+0
* 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
2019-01-29To support container scenario, 2 HardLimit configs are added - (#22180)Maoni Stephens1-1/+5
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.
2019-01-23Remove all traces of FEATURE_STACK_PROBE. (#22149)Filip Navara1-3/+0
2019-01-10Normalize a few more spin-wait loops (#21586)Koundinya Veluri1-0/+6
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
2018-12-26desktop port (#21523)Maoni Stephens1-0/+2
+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.
2018-11-08Remove need for full GC for unloadable stuff (#20384)Jan Vorlicek1-1/+0
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.
2018-11-06Loop-free GC rounding helpers with _BitScanReverse. (#20157)Jack Pappas1-0/+52
2018-10-31Make BitScanForward/BitScanForward64 PAL wrappers branchless. (#20412)Jack Pappas1-22/+22
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.
2018-08-31[local gc] move DacNotifyGCMarkEnd and AnalyzeSurvivorsRequested to ↵David Mason1-0/+3
GCToEEInterface (#19774)
2018-08-27re-enable com for local gc (#19681)David Mason1-1/+1
* re-enable com for local gc * Use RefCountedHandleCallbacks instead of new api
2018-08-25Remove NumaNodeInfo, CPUGroupInfo, AppDomain, SystemDomain, and EEConfig ↵David Mason4-71/+27
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
2018-08-11[local gc] disable feature redhawk (#17769)David Mason1-1/+0
2018-07-17Delete redundant broken offsetof definitions (#18947)Jan Kotas1-26/+0
Fixes build breaks with latest Visual Studio Preview. Fixes #18338
2018-04-16[Arm64] Add memory barrier after interlocked operations (#17595)Koundinya Veluri2-9/+45
Fixes https://github.com/dotnet/coreclr/issues/17591
2018-04-06Add GetLoaderAllocatorObjectForGC to IGCToCLR (#17443)David Mason2-6/+3
2018-03-30fix for HasCriticalFinalizer in local gc (#17369)David Mason1-6/+7
2018-03-26[local gc] Fix for BitScanForward64, it was ignoring the high byte check ↵David Mason1-3/+9
(#17142)
2018-03-13[local gc] refactor apis for threading and suspension to avoid redundant ↵David Mason1-6/+4
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
2018-01-31[local gc] Enable eventing (#16120)David Mason1-0/+1
* 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
2018-01-29Perform PhysicalMemoryLimit check for workstation GC, refactor ↵Tom Deseyn1-5/+2
GetLargestOnDieCacheSize into GetCacheSizePerLogicalCpu (#15975) * refactor: combine GetLargestOnDieCacheSize and GetLogicalCpuCount in GetCacheSizePerLogicalCpu * Perform PhysicalMemoryLimit check also for workstation GC
2018-01-24[Local GC] FEATURE_EVENT_TRACE 2/n: Scaffolding for emitting known events ↵Sean Gillespie1-0/+1
(#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
2018-01-23[Local GC] FEATURE_EVENT_TRACE 1/n: Tracking Event State (#15873)Sean Gillespie3-0/+13
* [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
2017-12-13Revert " Revert "[Local GC] Move knowledge of overlapped I/O objects to the ↵Jan Kotas3-0/+8
EE through four callbacks (#14982)""
2017-12-12Revert "[Local GC] Move knowledge of overlapped I/O objects to the EE ↵Sean Gillespie3-8/+0
through four callbacks (#14982)" This reverts commit c755e3b7f5d597c8d192675dbaaa337268d93f1c.
2017-11-27[Local GC] Move knowledge of overlapped I/O objects to the EE through four ↵Sean Gillespie3-0/+8
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
2017-11-09[Local GC] Unify background GC thread and server GC thread creation (#14821)Sean Gillespie2-13/+19
* 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
2017-10-27[Local GC] Implement loader protocol for a standalone GC (#14663)Sean Gillespie1-2/+10
* 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
2017-10-26[Local GC] Move IsGCThread and IsGCSpecialThread to GCToEEInterface (#14685)Sean Gillespie2-12/+2
* [Local GC] Move IsGCThread and IsGCSpecialThread to GCToEEInterface * Fix the windows and sample builds
2017-09-20When building as standalone GC the free object is initialized with 0 flags. ↵Jeff Schwartz1-1/+1
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.
2017-09-06Vendor the volatile.h header into src/gc/env for the standalone GC build ↵Sean Gillespie3-118/+481
(#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)
2017-08-22Remove macro definition checks that aren't useful and cause unnecessary ↵Sean Gillespie1-8/+0
build breaks (#13523)
2017-08-22[Local GC] Enable building the GC as a shared library (#13137)Sean Gillespie3-146/+292
* [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...)
2017-06-13[Arn64/Unix] Revise Volatile.T barriers (#12156)Steve MacLean1-1/+28
* [Arm64] Revise Volatile<T> barriers * Remove VolateStore from CopyValueClassUnchecked * Replace MemoryBarrier() in CopyValueClassUnchecked
2017-06-12[Arm64/Unix] Add 64K page support (#10981)Steve MacLean4-2/+51
* [Arm64/Unix] Support 64K pages * GC move GCToOSInterface::Initialize() into InitializeGarbageCollector()
2017-06-08[Local GC] Add GetThread to the GC/EE interface (#12036)Sean Gillespie1-0/+1
2017-06-05[Local GC] Add TrapReturningThreads to the GC/EE interface (#12067)Sean Gillespie1-0/+1
2017-06-01[Local GC] Remove uses of g_SystemInfo from the GC (#11628)Sean Gillespie1-0/+15
* [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