| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
It is only for MIO, and we want to use the generic name IOManager for
the name of the common parts of the interface and dispatch.
|
|
|
|
|
|
|
|
|
| |
- All rts_mk functions return the tagged closure address
- rts_mkChar/rts_mkInt avoid allocation when the argument is within the
CHARLIKE/INTLIKE range
- rts_getBool avoids a memory load by checking the closure tag
- In rts_mkInt64/rts_mkWord64, allocated closure payload size is either
1 or 2 words depending on target architecture word size
|
|
|
|
|
|
|
|
|
|
| |
Previously we would leave the card table of new arrays uninitialized.
This wasn't a soundness issue: at worst we would end up doing
unnecessary scavenging during GC, after which the card table would be
reset. That being said, it seems worth initializing this properly to
avoid both unnecessary work and non-determinism.
Fixes #19143.
|
|
|
|
|
|
|
|
|
| |
The native-code codepath uses dlinfo to identify memory regions owned by
a loaded dynamic object, facilitating safe unload. Unfortunately, this
interface is not always available. Add an autoconf check for it and
introduce a safe fallback behavior.
Fixes #19159.
|
|
|
|
|
|
| |
used timed wait on condition variable in waitForGcThreads
fix dodgy timespec calculation
|
| |
|
|
|
|
|
|
|
|
| |
I've never observed this counter taking a non-zero value, however I do
think it's existence is justified by the comment in grab_local_todo_block.
I've not added it to RTSStats in GHC.Stats, as it doesn't seem worth the
api churn.
|
|
|
|
| |
We are no longer busyish waiting, so this is no longer meaningful
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Here we remove the schedYield loop in scavenge_until_all_done+any_work, replacing
it with a single mutex + condition variable.
Previously any_work would check todo_large_objects, todo_q,
todo_overflow of each gen for work. Comments explained that this was
checking global work in any gen. However, these must have been out of
date, because all of these locations are local to a gc thread.
We've eliminated any_work entirely, instead simply looping back into
scavenge_loop, which will quickly return if there is no work.
shutdown_gc_threads is called slightly earlier than before. This ensures
that n_gc_threads can never be observed to increase from 0 by a worker thread.
startup_gc_threads is removed. It consisted of a single variable
assignment, which is moved inline to it's single callsite.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously lookupSymbol_PEi386 would call lookupSymbol while
holding linker_mutex. Fix this by rather
calling `lookupDependentSymbol`. This is safe
because lookupSymbol_PEi386 unconditionally holds linker_mutex.
Happily, this un-breaks `T12771`, `T13082_good`, and `T14611`, which
were previously marked as broken due to #18718.
Closes #19155.
|
|
|
|
| |
When checking n_returning_tasks.
|
|
|
|
|
| |
These are the two remaining non-atomic accesses to `wakeup` which were
missed by the original TSAN patch.
|
|
|
|
| |
This check is merely a service to the user; no reason to synchronize.
|
| |
|
|
|
|
|
|
|
|
| |
Solves #19147. When n_capabilities > 1 we were not correctly accounting
for gc time for sequential collections. In this case par_n_gcthreads ==
1, however it is not guaranteed that the single gc thread is capability 0.
A similar issue for copied is addressed as well.
|
|
|
|
|
|
|
| |
The weak pointer check in `checkGenWeakPtrList` previously failed to
account for dead weak pointers. This caused `fptr01` to fail in the
`sanity` way.
Fixes #19162.
|
| |
|
|
|
|
|
|
|
| |
As noted in #9666, the mark-region GC is not compatible with heap
profiling. Also add documentation for this flag.
Closes #9666.
|
|
|
|
|
|
| |
But only when profiling or DEBUG are enabled.
Fixes #17572.
|
|
|
|
| |
This is necessary since the user may enable `+RTS -hT` at any time.
|
|
|
|
|
| |
It turns out that this was fairly straightforward to implement since we
are now pretty careful about zeroing slop.
|
|
|
|
|
| |
Move the logic for taking censuses of "normal" and pinned blocks to
their own functions.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The fix for 18919 was somewhat incomplete: while the MVars were
correctly added to the mut_list via dirty_MVAR(), their info table
remained "clean".
While this is mostly harmless in non-debug builds, but trips an
assertion in the debug build, and may result in the MVar being
needlessly being added to the mut_list multiple times.
Resolves: #19145
|
| |
|
|
|
|
|
|
|
| |
In general we are less careful about locking closures when running with
only a single capability.
Fixes #19075.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This gives a small increase in performance under most circumstances.
For single threaded GC the improvement is on the order of 1-2%.
For multi threaded GC the results are quite noisy but seem to
fall into the same ballpark.
Fixes #16499
|
| |
|
|
|
|
|
|
| |
Previously we would push large objects and compact regions to the mark
queue during the deadlock detect GC, resulting in failure to detect
deadlocks.
|
|
|
|
| |
Pull the cold non-moving allocation path out of alloc_for_copy.
|
|
|
|
|
|
| |
Previously the deadlock-detection promotion logic in alloc_for_copy was
just plain wrong: it failed to fire when gct->evac_gen_no !=
oldest_gen->gen_no. The fix is simple: move the
|
|
|
|
|
| |
When performing a deadlock-detection GC we must ensure that all objects
end up in the non-moving generation. Assert this in scavenge.
|
|
|
|
|
| |
Previously an incorrect semicolon meant that we would fail to call
busy_wait_nop when spinning.
|
| |
|
|
|
|
|
|
|
|
| |
The algorithm described in the referenced paper uses this slightly
weaker atomic op.
This is the first "exotic" cas we're using. I've added a macro in the
<ORDERING>_OP style to match existing ones.
|
|
|
|
|
| |
THREADED_RTS was previously misspelled as THREADEDED_RTS.
Fixes #19057.
|
|
|
|
|
| |
The elf size is 32bit on 32bit builds and 64 otherwise.
We just upcast to 64bits before printing now.
|
| |
|
|
|
|
|
| |
StgWord has different widths on 32/64bit. So use the proper type
instead.
|
| |
|
|
|
|
|
|
| |
Every time I am asked about how to interpret these events I need to
figure it out from scratch. It's well past time that the users guide
properly documents these.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The change fixes build failure on musl:
```
rts/linker/Elf.c:2031:3: error:
warning: implicit declaration of function 'dlclose'; did you mean 'close'? [-Wimplicit-function-declaration]
2031 | dlclose(nc->dlopen_handle);
| ^~~~~~~
| close
```
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
| |
|
|
|
|
| |
Instead of relying on RTS_LINKER_USE_MMAP
|
| |
|
|
|
|
| |
Consolidates munmap calls to ensure consistent error handling.
|
|
|
|
|
|
|
|
| |
Previously most of the uses of mmapForLinker were mapping anonymous
memory, resulting in a great deal of unnecessary repetition. Factor this
out into a new helper.
Also fixes a few places where error checking was missing or suboptimal.
|
|
|
|
| |
This previously resulted in warnings due to spurious unmap failures.
|