Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
assert to FindOrCreateInitAndAddJitInfo when on arm to ensure the thumb bit is set
|
|
|
|
|
|
* Separate sections READONLY_VCHUNKS and READONLY_DICTIONARY
* Remove relocations for second-level indirection of Vtable in case FEATURE_NGEN_RELOCS_OPTIMIZATIONS is enabled.
Introduce FEATURE_NGEN_RELOCS_OPTIMIZATIONS, under which NGEN specific relocations optimizations are enabled
* Replace push/pop of R11 in stubs with
- str/ldr of R4 in space reserved in epilog for non-tail calls
- usage of R4 with hybrid-tail calls (same as for EmitShuffleThunk)
* Replace push/pop of R11 for function epilog with usage of LR as helper register right before its restore from stack
|
|
|
|
* Allow ILCodeVersion to fallback to default IL
For compat with profilers that used our APIs in unexpected ways we can allow
the ILCodeVersion to fallback to the default IL code when no IL was explicitly
given.
* Fix incorrect usage of ILCodeVersion::AsNode (issue #18602)
When the debugger is querying the active rejit IL for an IL method that has not been rejitted it incorrectly creates a VMPTR_ILCodeVersionNode for a code version that shouldn't have one.
|
|
Add DBI OpenVirtualProcessImpl2 that takes a module path instead of handle.
Fix assert on Windows debug.
Issue #17446
|
|
* Rename conflicting definitions of VER_MAJOR/MINORVERSION
These macros are defined by Windows SDK. They were overload to mean CLR version
that was causing interesting redefinition issues.
* Delete workaround for redefined Windows SDK macros
* Delete ProjectN version
* Delete dead code
|
|
|
|
|
|
works on Linux (#16978)
Add new ICLRDebuggingLibraryProvider2 interface for OpenVirtualProcess that works on Linux.
The old ICLRDebuggingLibraryProvider::ProviderLibrary returns module handles that can't
be properly supported on Linux.
ICLRDebuggerLibraryProvider2 returns the module path string instead of a handle. Works on
both Windows and Linux. If ICLRDebuggerLibraryProvider2 is QI'ed, OpenVirtualProcess will
NOT fall back to ICLRDebuggerLibraryProvider if ProviderLibrary2 fails.
HRESULT ProvideLibrary2(
[in] const WCHAR* pwszFileName,
[in] DWORD dwTimestamp,
[in] DWORD dwSizeOfImage,
[out] LPWSTR* ppResolvedModulePath);
ppResolvedModulePath - Where *ppResolvedModulePath is a null terminated path to the module dll. On Windows it should be allocated
with CoTaskMemAlloc. On Unix it should be allocated with malloc. Failure leave it untouched.
|
|
and profiling. (#16141)
This reverts commit e9985126acb0f1efd7c780faac4e66bc798b73c0.
|
|
(#16790)" (#16917)
This reverts commit 47bef69b68a35eafa069d08187727684a5f47901.
|
|
This reverts commit 383736b96b643ba46ad290fc86601fc2d62a9436.
|
|
* Return DPTR from PEDecoder::FindFirstSection()
Change type of the function's return value
to PTR_IMAGE_SECTION_HEADER instead of (IMAGE_SECTION_HEADER *)
* Fix handling of incorrect assemblies on Unix
This fixes the regression that was introduced by #10772 and is
caused by a missing check for validity of loaded assembly file.
Related issue: #15544
|
|
Fixed mixed mode attach/JIT debugging.
The mixed mode debugging attach uses TLS slot to communicate between debugger break-in thread and the right side. Unfortunately, the __thread static variables cannot be used on debugger breakin
thread because of it does not have storage allocated for them.
The fix is to switch the storage for debugger word to classic TlsAlloc allocated slot that works
fine on debugger break-in thread.
There was also problem (that is also in 2.0) where the WINNT_OFFSETOF__TEB__ThreadLocalStoragePointer was using the define for 64/32 bit and ended up always the 32 bit Windows value. This caused the right side GetEEThreadValue, GetEETlsDataBlock unmanaged thread functions to always fail.
|
|
|
|
|
|
(#16302)
Fixes https://github.com/dotnet/coreclr/issues/16224
|
|
* Debugger api to set a breakpoint on offset 0 of all methods
* fix ifdef misplacement in pal cordebug.h
* add IID to cordebug_i.cpp
|
|
This reverts commit 3d689d00843618105e735c5647e1cb64e721a333.
|
|
This reverts commit cd3f6e77757729d3d02dfbec4af21cdfe83f5435.
|
|
|
|
* Debugger api to set a breakpoint on offset 0 of all methods
* code review feedback
* more code review feedback
* respect IsIl in CorDbFunctionBreakoint()
* change SIMPLIFYING_ASSERT to SIMPLIFYING_ASSUMPTION_SUCCEEDED for hrs, it outputs a much better diagnostic message
|
|
address (#16146)
Fix GetILToNativeMapping3 to return mappings for the specified code start address
Fix for https://github.com/dotnet/coreclr/issues/16145 in master:
- Previously, it was getting or creating the current entry point's corresponding DebugJitInfo and determining that the specified code address is not within the code range
- Fixed to get or create a DebugJitInfo corresponding to the specified code address and return that
|
|
debugging and profiling. (#15878)"
This reverts commit 5bcfde404803f85451cf0ee9fd6406734cb878ff.
|
|
CLR_DEBUGGING_PROCESS_FLAGS for VS. (#15973)
|
|
and profiling. (#15878)
To disable the named pipes and semaphores created on linux execute "export COMPlus_EnableDiagnostics=0" before start the .NET Core program.
On Windows execute "set COMPlus_EnableDiagnostics=0" and on Linux execute "export "COMPlus_EnableDiagnostics=0"
Removed the "Telesto" registry entry (old unnecessary Silverlight code) and Watson (always true) checks.
For issues #11769 and #8844.
|
|
This reverts commit cf1fb9e17fc8b6ee849edab5a696d0ec5c6eadd2.
|
|
|
|
|
|
- Reserve space for jump stubs for precodes and other code fragments at the end of each code heap segment. This is trying
to ensure that eventual allocation of jump stubs for precodes and other code fragments succeeds. Accounting is done
conservatively - reserves more than strictly required. It wastes a bit of address space, but no actual memory. Also,
this reserve is not used to allocate jump stubs for JITed code since the JITing can recover from failure to allocate
the jump stub now. Fixes #14996.
- Improve algorithm to reuse HostCodeHeap segments: Maintain estimated size of the largest free block in HostCodeHeap.
This estimate is updated when allocation request fails, and also when memory is returned to the HostCodeHeap. Fixes #14995.
- Retry JITing on failure to allocate jump stub. Failure to allocate jump during JITing is not fatal anymore. There is
extra memory reserved for jump stubs on retry to ensure that the retry succeeds allocating the jump stubs that it needs
with high probability.
- Respect CodeHeapRequestInfo::getRequestSize for HostCodeHeap. CodeHeapRequestInfo::getRequestSize is used to
throttle code heap segment size for large workloads. Not respecting it in HostCodeHeap lead to too many
too small code heap segments in large workloads.
- Switch HostCodeHeap nibble map to be allocated on regular heap as part. It simplied the math required to estimate
the nibble map size, and allocating on regular heap is overall goodness since it does not need to be executable.
|
|
Improve Monitor scaling and reduce spinning
Part 1: Improve Monitor scaling
Fixes https://github.com/dotnet/coreclr/issues/13978
- Refactored AwareLock::m_MonitorHeld into a class LockState with operations to mutate the state
- Allowed the lock to be taken by a non-waiter when there is a waiter to prevent creating lock convoys
- Added a bit to LockState to indicate that a waiter is signaled to wake, to avoid waking more than one waiter at a time. A waiter that wakes by observing the signal unsets this bit. See AwareLock::EnterEpilogHelper().
- Added a spinner count to LockState. Spinners now register and unregister themselves and lock releasers don't wake a waiter when there is a registered spinner (the spinner guarantees to take the lock if it's available when unregistering itself)
- This was necessary mostly on Windows to reduce CPU usage to the expected level in contended cases with several threads. I believe it's the priority boost Windows gives to signaled threads, which seems to cause waiters to much more frequently succeed in acquiring the lock. This causes a CPU usage problem because once the woken waiter releases the lock, on the next lock attempt it will become a spinner. This keeps repeating, converting several waiters into spinners unnecessarily. Before registering spinners, I saw typically 4-6 spinners under contention (with delays inside and outside the lock) when I expected to have only 1-2 spinners at most.
- It costs an interlocked operation before and after the spin loop, doesn't seem to be too significant since spinning is a relatively slow path anyway, and the reduction in CPU usage in turn reduces contention on the lock and lets more useful work get done
- Updated waiters to spin a bit before going back to waiting, reasons are explained in AwareLock::EnterEpilogHelper()
- Removed AwareLock::Contention() and any references (this removes the 10 repeats of the entire spin loop in that function). With the lock convoy issue gone, this appears to no longer be necessary.
Perf
- On Windows, throughput has increased significantly starting at slightly lower than proc count threads. On Linux, latency and throughput have increased more significantly at similar proc counts.
- Most of the larger regressions are in the unlocked fast paths. The code there hasn't changed and is almost identical (minor layout differences), I'm just considering this noise until we figure out how to get consistently faster code generated.
- The smaller regressions are within noise range
Part 2: Reduce Monitor spinning
Fixes https://github.com/dotnet/coreclr/issues/13980
- Added new config value Monitor_SpinCount and Monitor spins for that many iterations, default is 30 (0x1e). This seems to give a somewhat decent balance between latency, fairness, and throughput. Lower spin counts improve latency and fairness significantly and regress throughput slightly, and higher spin counts improve throughput slightly and regress latency and fairness significantly.
- The other constants can still be used to disable spinning but otherwise they are no longer used by Monitor
- Decreased the number of bits used for tracking spinner count to 3. This seems to be more than enough since only one thread can take a lock at a time, and prevents spikes of unnecessary CPU usage.
Tried some things that didn't pan out:
- Sleep(0) doesn't seem to add anything to the spin loop, so left it out. Instead of Sleep(0) it can just proceed to waiting. Waiting is more expensive than Sleep(0), but I didn't see that benefit in the tests. Omitting Sleep(0) also keeps the spin loop very short (a few microseconds max).
- Increasing the average YieldProcessor() duration per spin iteration improved thorughput slightly but regressed latency and fairness very quickly. Given that fairness is generally worse with part 1 of this change above, it felt like a better compromise to take a small reduction in throughput for larger improvements in latency and fairness.
- Tried adding a very small % of lock releases by random wake a waiter despite there being spinners to improve fairness. This improved fairness noticeably but not as much as decreasing the spin count slightly, and it was making latency and throughput worse more quickly. After reducing the % to a point where I was hardly seeing fairness improvements, there were still noticeable latency and throughput regressions.
Miscellaneous
- Moved YieldProcessorNormalized code into separate files so that they can be included earlier and where needed
- Added a max for "optimal max normalized yields per spin iteration" since it has a potential to be very large on machines where YieldProcessor may be implemented as no-op, in which case it's probably not worth spinning for the full duration
- Refactored duplicate code in portable versions of MonEnterWorker, MonEnter, and MonReliableEnter. MonTryEnter has a slightly different structure, did not refactor that.
Perf
- Throughput is a bit lower than before at lower thread counts and better at medium-high thread counts. It's a bit lower at lower thread counts because of two reasons:
- Shorter spin loop means the lock will be polled more frequently because the exponential backoff does not get as high, making it more likely for a spinner to steal the lock from another thread, causing the other thread to sometimes wait early
- The duration of YieldProcessor() calls per spin iteration has decreased and a spinner or spinning waiter are more likely to take the lock, the rest is similar to above
- For the same reasons as above, latency is better than before. Fairness is better on Windows and worse on Linux compared to baseline due to the baseline having differences between these platforms. Latency also has differences between Windows/Linux in the baseline, I suspect those are due to differences in scheduling.
- Performance now scales appropriately on processors with different pause delays
Part 3: Add mitigation for waiter starvation
Normally, threads are allowed to preempt waiters to acquire the lock. There are cases where waiters can be easily starved as a result. For example, a thread that holds a lock for a significant amount of time (much longer than the time it takes to do a context switch), then releases and reacquires the lock in quick succession, and repeats. Though a waiter would be woken upon lock release, usually it will not have enough time to context-switch-in and take the lock, and can be starved for an unreasonably long duration.
In order to prevent such starvation and force a bit of fair forward progress, it is sometimes necessary to change the normal policy and disallow threads from preempting waiters. A new bit was added to LockState and ShouldNotPreemptWaiters() indicates the current state of the policy.
- When the first waiter begins waiting, it records the current time as a "waiter starvation start time". That is a point in time after which no forward progress has occurred for waiters. When a waiter acquires the lock, the time is updated to the current time.
- Before a spinner begins spinning, and when a waiter is signaled to wake, it checks whether the starvation duration has crossed a threshold (currently 100 ms) and if so, sets ShouldNotPreemptWaiters()
When unreasonable starvation is occurring, the lock will be released occasionally and if caused by spinners, spinners will be starting to spin.
- Before starting to spin, if ShouldNotPreemptWaiters() is set, the spinner will skip spinning and wait instead. Spinners that are already registered at the time ShouldNotPreemptWaiters() is set will stop spinning as necessary. Eventually, all spinners will drain and no new ones will be registered.
- After spinners have drained, only a waiter will be able to acquire the lock. When a waiter acquires the lock, or when the last waiter unregisters itself, ShouldNotPreemptWaiters() is cleared to restore the normal policy.
|
|
1) Fix createdump p_vaddr bias/base problem.
2) createdump was loading the DAC from the directory where createdump was executed from and not from the libcoreclr.so path. Fixed this.
3) Don't use the dac if the libcoreclr.so module is not found.
4) Remove the QI of ICoreDebugDataTarget4 in datatarget.cpp. Forgot to do this when the VirtualUnwind function was removed. Caused crash.
|
|
|
|
After investigation the failures look unrelated to my changes. Thanks Jan and Noah.
|
|
Not supported on CoreCLR appdomain's method and properties were removed
#15001
|
|
to have broken the arm64 build. Fix one file by removing non-ASCII
characters.
|
|
Add new apis for profiler to use with tiered jitting.
|
|
Fix #14426. Added a more flexible IL master breakpoint that can:
a) bind to native offset 0 of each jitted code body
b) use a MethodDescFilter so that only jitted code for one generic instance receives breakpoints
The remaining change is simply to switch step-in and trace stepping to use that new breakpoint binding behavior instead of the code version specific binding behavior that was used before. This ensures that even if the code version changes after the trace occurs we will still have a breakpoint on the alternate code versions and complete the stepping operation.
|
|
Adds the appropriate handling of the default ILCodeVersion in DacDbiInterfaceImpl::GetILCodeVersionNode
|
|
Enumerate all of the jitted instances of a method using the tiered compilation manager
|
|
Fix #14428
|
|
Fix #14423
|
|
Linux and Windows arm64 are using the regular C/C++ thread local statics. This change unifies the remaining Windows architectures to be on the same plan.
|
|
Now using an offset calculation that is correct for all of a method's jitted code versions.
|
|
The JIT now invokes the debugger's JITComplete callback on every jitting of a method
|