| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Previously we were treating the thread ID as a HANDLE, but it is not. We
must first OpenThread.
(cherry picked from commit 63a5c876657bb89e9847f325fb81df2229297eb3)
|
|
|
|
|
|
|
|
|
| |
As noted in #18991, we would previously allocate heap in low memory.
Due to this the linker, which typically *needs* low memory, would end up
competing with the heap. In longer builds we end up running out of
low memory entirely, leading to linking failures.
(cherry picked from commit a1a75aa9be2c133dd1372a08eeb6a92c31688df7)
|
|
|
|
|
| |
Previously we would take all capabilities but fail to join on the thread
itself, potentially resulting in a leaked thread.
|
|
|
|
| |
(cherry picked from commit c832f7e2a9314cfd61257cb161b1795b612d12b5)
|
|
|
|
| |
(cherry picked from commit cb1f755c6fb77f140aee11fdc7b4da04dd5dcd02)
|
|
|
|
|
|
|
|
|
|
| |
Since switching to the two-step allocator, the `outofmem` test fails via
`osCommitMemory` failing to commit. However, this was previously exiting
with `EXIT_FAILURE`, rather than `EXIT_HEAPOVERFLOW`. I think the latter
is a more reasonable exit code for this case and matches the behavior on
POSIX platforms.
(cherry picked from commit da7269a4472856ba701d956a247599f721e9915e)
|
|
|
|
| |
(cherry picked from commit cdd0ff16f20ce920c74f9128a1067cbe1bd378c2)
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We used a variable to keep track of situations where we got
entries from the IO port, but all of them had already been
canceled. While we can avoid some work that way this case
seems quite rare.
So we give up on tracking this and instead always assume at
least one of the returned entries is valid.
If that's not the case no harm is done, we just perform some
additional work. But it makes the runner easier to reason about.
In particular we don't need to care if another thread modifies
oustanding_requests after we return from waiting on the IO Port.
|
|
|
|
|
|
|
|
| |
Only use a single communication point (registerAlertableWait) to inform
the C side aobut both timeouts to use as well as outstanding requests.
Also queue a haskell processing thread after each return from alertable
waits. This way there is no risk of us missing a timer event.
|
| |
|
| |
|
|
|
|
|
| |
This will unblock the IO thread sooner hopefully leading to higher
throughput in some situations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now set a flag in the IO thread. The scheduler when looking for work
will check the flag and create/queue threads accordingly.
We used to create these in the IO thread. This improved performance
but caused frequent segfaults. Thread creation/allocation is only safe to
do if nothing currently accesses the storeagemanager. However without
locks in the non-threaded runtime this can't be guaranteed.
This shouldn't change performance all too much.
In the past we had:
* IO: Create/Queue thread.
* Scheduler: Runs a few times. Eventually picks up IO processing thread.
Now it's:
* IO: Set flag to queue thread.
* Scheduler: Pick up flag, if set create/queue thread. Eventually picks up IO processing thread.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As far as I know C(99) gives no guarantees for code like
bool condition;
...
while(condition)
sleep();
that condition will be updated if it's changed by another thread.
So we are explicit here and mark it as volatile, this will force
a reload from memory on each iteration.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to phyx these should only be read and written once per
object. Not neccesarily in that order.
To strengthen that guarantee the primitives will now throw an
exception if we violate this invariant.
As a consequence we can eliminate some code from their primops.
In particular code dealing with multiple queued readers/writers
now simply checks the invariant and throws an exception if it
was violated. That is in contrast to mvars which will do things
like wake up all readers, queue multi writers etc.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
instead of emulated ones
|
|
|
|
|
|
|
|
|
|
|
| |
Starting with Win 8.1/Server 2012 windows no longer preallocates
page tables for reserverd memory eagerly, which prevented us from
using this approach in the past.
We also try to allocate the heap high in the memory space.
Hopefully this makes it easier to allocate things in the low
4GB of memory that need to be there. Like jump islands for the
linker.
|
|
|
|
|
| |
We can now assume that the thread and processor group interfaces are
available.
|
|
|
|
|
|
|
| |
This patch allows boot libraries to use unboxed sums without implicitly
depending on `base` package because of `absentSumFieldError`.
See updated Note [aBSENT_SUM_FIELD_ERROR_ID] in GHC.Core.Make
|
|
|
|
|
| |
We already have a function to go from time to ms so use it.
Also expand on the state of timer resolution.
|
| |
|
|
|
|
| |
This will help track down #17035.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
These are unexploded minds as far as the linter is concerned. I don't
want to hit in my MRs by mistake!
I did this with `sed`, and then rolled back some changes in the docs,
config.guess, and the linter itself.
|
| |
|
|
|
|
|
| |
This moves all URL references to Trac tickets to their corresponding
GitLab counterparts.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The megablock allocator does not currently check that after aligning the
free region if it still has enough space to actually do the allocation.
This causes it to return a memory region which it didn't fully allocate
itself. Even worse, it can cause it to return a block with a region
that will be present in two allocation pools.
This causes if you're lucky an error from the OS that you're committing
memory that has never been reserved, or causes random heap corruption.
This change makes it consider the alignment as well.
Test Plan: ./validate , testcase testmblockalloc
Reviewers: bgamari, erikd, simonmar
Reviewed By: simonmar
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5363
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Fix a number of issues that have broken the 32 bit build.
This makes it build again.
Test Plan: ./validate
Reviewers: hvr, goldfire, bgamari, erikd, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4691
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit b2ff5dde399cd012218578945ada1d9ff68daa35 "Fix #15038"
added new stable closure 'absentSumFieldError_closure' to
base package. This closure is used in rts package.
Unfortunately the symbol was not explicitly exported and build
failed on windows as:
```
"inplace/bin/ghc-stage1" -o ...hsc2hs.exe ...
rts/dist/build/libHSrts.a(RtsStartup.o): In function `hs_init_ghc':
rts/RtsStartup.c:272:0: error:
undefined reference to `base_ControlziExceptionziBase_absentSumFieldError_closure'
|
272 | getStablePtr((StgPtr)absentSumFieldError_closure);
| ^
```
This change adds 'absentSumFieldError_closure' to explicit export
into libHSbase.def.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Validate, run program with `+RTS --numa` without libnuma
support compiled in
Reviewers: erikd, simonmar
Subscribers: thomie, carter
GHC Trac Issues: #14956
Differential Revision: https://phabricator.haskell.org/D4556
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* osNumaNodes now returns the right number of nodes
* thread affinity is now correctly set
TODO: no noticeable performance improvement.
does windows already distribute threads in a NUMA-aware fashion?
Test Plan:
* validate
* local tests on a NUMA machine
Reviewers: bgamari, erikd, simonmar
Reviewed By: bgamari, simonmar
Subscribers: thomie, carter
Differential Revision: https://phabricator.haskell.org/D4607
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's no-op on all platforms
Reviewers: bgamari, simonmar, erikd, dfeuer
Reviewed By: dfeuer
Subscribers: dfeuer, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4588
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bgamari, erikd, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4450
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Adds quick-cross-ncg flavour.
- Fix windows wchar with `_s` for mingw
- Lookup windres, dllwrap and objdump
- Fix type.
Reviewers: bgamari, hvr, Phyx, erikd, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, thomie, erikd, carter
Differential Revision: https://phabricator.haskell.org/D4430
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bgamari, erikd, simonmar
Reviewed By: bgamari, simonmar
Subscribers: Phyx, rwbarton, thomie, carter
GHC Trac Issues: #11777
Differential Revision: https://phabricator.haskell.org/D4428
|