summaryrefslogtreecommitdiff
path: root/rts/win32
Commit message (Collapse)AuthorAgeFilesLines
* rts: Fix joinOSThread on WindowsBen Gamari2021-04-071-1/+6
| | | | | | | Previously we were treating the thread ID as a HANDLE, but it is not. We must first OpenThread. (cherry picked from commit 63a5c876657bb89e9847f325fb81df2229297eb3)
* rts: Allocate MBlocks with MAP_TOP_DOWN on WindowsBen Gamari2020-11-301-1/+4
| | | | | | | | | 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)
* rts: Join to concurrent mark thread during shutdownBen Gamari2020-11-241-0/+9
| | | | | Previously we would take all capabilities but fail to join on the thread itself, potentially resulting in a leaked thread.
* winio: fixed timeouts non-threaded.Tamar Christina2020-11-091-13/+9
| | | | (cherry picked from commit c832f7e2a9314cfd61257cb161b1795b612d12b5)
* winio: Fix unused variables warningsTamar Christina2020-11-092-9/+2
| | | | (cherry picked from commit cb1f755c6fb77f140aee11fdc7b4da04dd5dcd02)
* rts/win32: Exit with EXIT_HEAPOVERFLOW if memory commit failsBen Gamari2020-08-131-1/+1
| | | | | | | | | | 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)
* winio: restore console cp on exitTamar Christina2020-08-131-0/+1
| | | | (cherry picked from commit cdd0ff16f20ce920c74f9128a1067cbe1bd378c2)
* winio: update lockfile signature and remove mistaken symbol in rts.Tamar Christina2020-07-151-1/+0
|
* winio: clarify wording on conditional variables.Tamar Christina2020-07-151-1/+2
|
* winio: Remove obsolete comment about cond. variablesAndreas Klebinger2020-07-151-5/+0
|
* winio: Minor comments/renamingsBen Gamari2020-07-152-3/+3
|
* winio: Fix rebase artifactsTamar Christina2020-07-151-14/+7
|
* winio: Various fixes related to rebase and testdriverTamar Christina2020-07-151-6/+14
|
* winio: Remove outstanding_requests from runner.Andreas Klebinger2020-07-151-18/+10
| | | | | | | | | | | | | | | | 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.
* winio: Refactor non-threaded runner thread and scheduler interface.Andreas Klebinger2020-07-152-98/+151
| | | | | | | | 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.
* winio: Always lock win32 event queueAndreas Klebinger2020-07-151-10/+17
|
* winio: Update placeholder comment with actual function name.Andreas Klebinger2020-07-151-1/+1
|
* winio: Queue IO processing threads at the front of the queue.Andreas Klebinger2020-07-151-1/+1
| | | | | This will unblock the IO thread sooner hopefully leading to higher throughput in some situations.
* winio: nonthreaded: Create io processing threads in main thread.Andreas Klebinger2020-07-152-34/+86
| | | | | | | | | | | | | | | | | | | | 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.
* winio: Make last_event a local variableAndreas Klebinger2020-07-151-3/+8
|
* winio: Mark outstanding_service_requests volatile.Andreas Klebinger2020-07-151-2/+8
| | | | | | | | | | | | | | | 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.
* winio: Clean up code surrounding IOPort primitives.Andreas Klebinger2020-07-151-1/+2
| | | | | | | | | | | | | | 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.
* winio: Expand comments describing non-threaded loopAndreas Klebinger2020-07-151-5/+37
|
* winio: Remove some barf statements that are a bit strict.Tamar Christina2020-07-151-2/+0
|
* winio: Fix issues with non-threaded I/O manager after split.Tamar Christina2020-07-151-0/+3
|
* winio: Relaxing some constraints in io-manager.Tamar Christina2020-07-151-1/+1
|
* winio: core non-threaded I/O managerTamar Christina2020-07-154-0/+844
|
* winio: Multiple refactorings and support changes.Tamar Christina2020-07-159-454/+61
|
* winio: Use SlimReaderLocks and ConditonalVariables provided by the OS ↵Tamar Christina2020-07-155-162/+111
| | | | instead of emulated ones
* Enable large address space optimization on windows.Andreas Klebinger2020-06-251-1/+1
| | | | | | | | | | | 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.
* rts: Drop compatibility shims for Windows VistaBen Gamari2020-05-301-51/+5
| | | | | We can now assume that the thread and processor group interfaces are available.
* Fix unboxed-sums GC ptr-slot rubbish value (#17791)Sylvain Henry2020-05-091-1/+0
| | | | | | | 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
* Small change to the windows ticker.Andreas Klebinger2020-04-141-1/+7
| | | | | We already have a function to go from time to ms so use it. Also expand on the state of timer resolution.
* rts: Add getCurrentThreadCPUTime helperBen Gamari2020-03-051-0/+14
|
* rts: Add more debug output to failed path in onIOCompleteBen Gamari2020-02-141-2/+3
| | | | This will help track down #17035.
* Add arithmetic exception primops (#14664)Sylvain Henry2020-02-111-0/+3
|
* Fix typos, via a Levenshtein-style correctorBrian Wignall2020-01-041-1/+1
|
* Windows: Update tarballs to GCC 9.2 and remove MAX_PATH limit.Tamar Christina2019-10-202-11/+19
|
* Expunge #ifdef and #ifndef from the codebaseJohn Ericson2019-07-141-3/+3
| | | | | | | | 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.
* err: clean up error handlerTamar Christina2019-03-191-19/+30
|
* Update Trac ticket URLs to point to GitLabRyan Scott2019-03-151-1/+1
| | | | | This moves all URL references to Trac tickets to their corresponding GitLab counterparts.
* rts: fix Windows megablock allocatorTamar Christina2018-11-221-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix 32 bit windows buildTamar Christina2018-05-282-2/+2
| | | | | | | | | | | | | | | | 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
* rts: export new absentSumFieldError from baseSergei Trofimovich2018-05-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* rts: Throw better error if --numa is used without libnuma supportBen Gamari2018-05-031-0/+5
| | | | | | | | | | | | | 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
* Fix NUMA support on Windows (#15049)David Kraeutmann2018-05-032-9/+17
| | | | | | | | | | | | | | | | | | | | * 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
* Remove markSignalHandlersÖmer Sinan Ağacan2018-04-161-12/+0
| | | | | | | | | | | | 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
* rts/win32: Assert that the IO manager has been initialisedSimon Jakobi2018-03-021-18/+15
| | | | | | | | | | Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4450
* Various Windows / Cross Compile to Windows fixesMoritz Angermann2018-03-021-1/+1
| | | | | | | | | | | | | | | - 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
* RTS: Remember to free some pointersSimon Jakobi2018-02-251-3/+12
| | | | | | | | | | | | Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari, simonmar Subscribers: Phyx, rwbarton, thomie, carter GHC Trac Issues: #11777 Differential Revision: https://phabricator.haskell.org/D4428