| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Previously we would attempt to clear pages which were marked as
read-only. Fix this.
|
|
|
|
|
|
|
|
| |
As noted in #22538, previously some GCC versions warned that various
locals in Libdw.c may be used uninitialized. Although this wasn't
strictly true (since they were initialized in an inline assembler block)
we fix this by providing explicit empty initializers.
Fixes #22538
|
|
|
|
|
|
|
| |
0e274c39bf836d5bb846f5fa08649c75f85326ac added an assertion in
`dirty_MUT_VAR` checking that the MUT_VAR being dirtied was clean.
However, this isn't necessarily the case since another thread may have
raced us to dirty the object.
|
| |
|
| |
|
|
|
|
| |
This is a rather simplistic way of solving #17289.
|
| |
|
| |
|
| |
|
|
|
|
| |
Relaxed ordering is fine here since the later CAS implies a release.
|
| |
|
| |
|
|
|
|
|
| |
This makes it easier to ensure that it is accessed using the necessary
atomic operations.
|
|
|
|
|
|
| |
As noted in #22447, the existence of the pthread-based ITimer
implementation means that we cannot assume that the program is
single-threaded.
|
|
|
|
| |
Since these are modified by the timer handler.
|
|
|
|
|
|
| |
And ensure accesses to n_capabilities are atomic (although with relaxed
ordering). This is necessary as RTS API callers may concurrently call
into the RTS without holding a capability.
|
|
|
|
|
| |
Also introduce MUT_FIELD marker in Closures.h to document mutable
fields.
|
|
|
|
| |
See #22421.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This doesn't change behavior but makes the code a bit easier to follow.
|
|
|
|
|
| |
This is in general unsafe as they may be clobbered if they are mapped to
caller-saved machine registers. See Note [Register parameter passing].
|
|
|
|
|
|
| |
This introduces a new Cmm pass which instruments the program with
ThreadSanitizer annotations, allowing full tracking of mutator memory
accesses via TSAN.
|
| |
|
| |
|
|
|
|
|
| |
It is a relic of the Make build system. The RTS now uses a
`package.conf` file generated the usual way by Cabal.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RTS eventlog events for postCapsetVecEvent are truncated if payload
is larger than EVENT_PAYLOAD_SIZE_MAX
Previously, postCapsetVecEvent records eventlog event with payload
of variable size larger than EVENT_PAYLOAD_SIZE_MAX (2^16) without
any validation, resulting in corrupted data.
For example, this happens when a Haskell binary is invoked with very
long command line arguments exceeding 2^16 bytes (see #20221).
Now we check the size of accumulated payload messages incrementally,
and truncate the message just before the payload size exceeds
EVENT_PAYLOAD_SIZE_MAX. RTS will warn the user with a message showing
how many arguments are truncated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add JS backend adapted from the GHCJS project by Luite Stegeman.
Some features haven't been ported or implemented yet. Tests for these
features have been disabled with an associated gitlab ticket.
Bump array submodule
Work funded by IOG.
Co-authored-by: Jeffrey Young <jeffrey.young@iohk.io>
Co-authored-by: Luite Stegeman <stegeman@gmail.com>
Co-authored-by: Josh Meredith <joshmeredith2008@gmail.com>
|
|
|
|
|
|
| |
It's only used by wasm NCG at the moment, but ghc-prim is a more
reasonable place for hosting out-of-line primops. Also, we only need a
single version of hs_mulIntMayOflo.
|
|
|
|
| |
It was an unfortunate oversight in !8961 and broke devel2 builds.
|
|
|
|
|
|
| |
Previously it didn't enable/disable nonmoving_gc and ticky event types
Fixes #21813
|
|
|
|
|
|
| |
The one about the nonsense (const False) test on WinIO for there being any IO
or timers pending, leading to unnecessary complication later in the
scheduler.
|
|
|
|
|
|
| |
And to insertIntoSleepingQueue. Again, it's a bit cleaner and simpler
though not strictly necessary given that these primops are currently
only used in the non-threaded RTS.
|
|
|
|
|
|
| |
It is currently only used in the non-threaded RTS so it works to use
MainCapability, but it's a bit nicer to pass the cap anyway. It's
certainly shorter.
|
|
|
|
| |
And add or adjust comments at the use sites of awaitEvent.
|
|
|
|
|
|
|
|
| |
It was not really adding anything. The name no longer meant anything
since those I/O and timeout queues do not belong to the scheuler.
In one of the two places it was used, the comments already had to
explain what it did, whereas now the code matches the comment nicely.
|
|
|
|
|
|
|
|
|
|
|
| |
These are the macros originaly from Scheduler.h, previously moved to
IOManager.h, and now replaced with a single inline function
anyPendingTimeoutsOrIO(). We can use a single function since the two
macros were always checked together.
Note that since anyPendingTimeoutsOrIO is defined for all IO manager
cases, including threaded, we do not need to guard its use by cpp
#if !defined(THREADED_RTS)
|
|
|
|
|
|
|
|
|
|
|
| |
from Schedule.h to Schedule.c and IOManager.h
This is just moving, the next step will be to rejig them slightly.
For the non-threaded RTS the scheduler needs to be able to test for
there being pending I/O operation or pending timers. The implementation
of these tests should really be considered to be part of the I/O
managers and not part of the scheduler.
|
|
|
|
|
| |
The global vars {blocked,sleeping}_queue are now in the Capability and
so get marked there via markCapabilityIOManager.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The blocked_queue_{hd,tl} and the sleeping_queue are currently
cooperatively managed between the scheduler and (some but not all of)
the non-threaded I/O manager implementations.
They lived as global vars with the scheduler, but are poked by I/O
primops and the I/O manager backends.
This patch is a step on the path towards making the management of I/O or
timer blocking belong to the I/O managers and not the scheduler.
Specifically, this patch moves the {blocked,sleeping}_queue from being
global vars in the scheduler to being members of the CapIOManager struct
within each Capability. They are not yet exclusively used by the I/O
managers: they are still poked from a couple other places, notably in
the scheduler before calling awaitEvent.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The I/O and delay blocking primitives for the non-threaded way
currently access the blocked_queue and sleeping_queue directly.
We want to move where those queues are to make their ownership clearer:
to have them clearly belong to the I/O manager impls rather than to the
scheduler. Ultimately we will want to change their representation too.
It's inconvenient to do that if these queues are accessed directly from
cmm code. So as a first step, replace the APPEND_TO_BLOCKED_QUEUE with a
C version appendToIOBlockedQueue(), and replace the open-coded
sleeping_queue insertion with insertIntoSleepingQueue().
|
|
|
|
|
|
|
| |
To allow I/O managers to have GC roots in the Capability, within the
CapIOManager structure.
Not yet used in this patch.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than each I/O manager adding things into the Capability structure
ad-hoc, we should have a common CapIOManager iomgr member of the
Capability structure, with a common interface to initialise etc.
The content of the CapIOManager struct will be defined differently for
each I/O manager implementation. Eventually we should be able to have
the CapIOManager be opaque to the rest of the RTS, and known just to the
I/O manager implementation. We plan for that by making the Capability
contain a pointer to the CapIOManager rather than containing the
structure directly.
Initially just move the Unix threaded I/O manager's control FD.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`Foreign.Marshal.Pool` used to call `malloc` once for each allocation
request. Each `Pool` maintained a list of allocated pointers, and
traverses the list to `free` each one of those pointers. The extra O(n)
overhead is apparently bad for a `Pool` that serves a lot of small
allocation requests.
This patch uses the RTS internal arena to implement `Pool`, with these
benefits:
- Gets rid of the extra O(n) overhead.
- The RTS arena is simply a bump allocator backed by the block
allocator, each allocation request is likely faster than a libc
`malloc` call.
Closes #14762 #18338.
|
|
|
|
|
|
|
|
|
| |
The refactoring in 866c736e introduced a rather subtle change in the
semantics of the IPE eventlog output, changing the eventlog field from
encoding info table pointers to "TNTC pointers" (which point to entry
code when tables-next-to-code is enabled). Fix this.
Fixes #22452.
|
|
|
|
| |
Instead of assuming support on all Linuxes.
|
|
|
|
| |
This patch adds the rest of wasm32 specific logic in rts.
|