summaryrefslogtreecommitdiff
path: root/rts
Commit message (Collapse)AuthorAgeFilesLines
* rts: delint/detab/dewhitespace EventLog.cAustin Seipp2014-07-281-33/+36
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Increase precision of timings reported by RTSHerbert Valerio Riedel2014-07-281-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Today's hardware is much faster, so it makes sense to report timings with more precision, and possibly help reduce rounding-induced fluctuations in the nofib statistics. This commit increases the precision of all timings previously reported with a granularity of 10ms to 1ms. For instance, the `+RTS -S` output is now rendered as: Alloc Copied Live GC GC TOT TOT Page Flts bytes bytes bytes user elap user elap 641936 59944 158120 0.000 0.000 0.013 0.001 0 0 (Gen: 0) 517672 60840 158464 0.000 0.000 0.013 0.002 0 0 (Gen: 0) 517256 58800 156424 0.005 0.005 0.019 0.007 0 0 (Gen: 1) 670208 9520 158728 0.000 0.000 0.019 0.008 0 0 (Gen: 0) ... Tot time (elapsed) Avg pause Max pause Gen 0 24 colls, 0 par 0.002s 0.002s 0.0001s 0.0002s Gen 1 3 colls, 0 par 0.011s 0.011s 0.0038s 0.0055s TASKS: 4 (1 bound, 3 peak workers (3 total), using -N1) SPARKS: 0 (0 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled) INIT time 0.001s ( 0.001s elapsed) MUT time 0.005s ( 0.006s elapsed) GC time 0.014s ( 0.014s elapsed) EXIT time 0.001s ( 0.001s elapsed) Total time 0.032s ( 0.020s elapsed) Note that this change also requires associated changes in the nofib submodule. Test Plan: tested with modified nofib Reviewers: simonmar, nomeata, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D97
* Acquire all_tasks_mutex in forkProcessEdsko de Vries2014-07-133-2/+18
| | | | | | | | | | | | | | Summary: (for the same reason that we acquire all the other mutexes) Test Plan: validate Reviewers: simonmar, austin, duncan Reviewed By: simonmar, austin, duncan Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D60
* Avoid deadlock in freeTask (called by forkProcess)Edsko de Vries2014-07-131-0/+14
| | | | | | | | | | | | | | Summary: Documented in more detail inline with the change. Test Plan: validate Reviewers: austin, simonmar, duncan Reviewed By: austin, simonmar, duncan Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D59
* Avoid unnecessary clock_gettime() syscalls in GC stats.Brian Brooks2014-07-104-53/+3
| | | | | | | | | | | | | | Summary: Avoid unnecessary clock_gettime() syscalls in GC stats. Test Plan: Use strace. Reviewers: simonmar, austin Reviewed By: simonmar, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D39
* rts: Fix #9003 with an annoying hackAustin Seipp2014-07-091-0/+5
| | | | | | | The TL;DR is that by adding this, we can distinguish GHC 7.8.3 from 7.8.2, which had a buggy implementation. See the ticket for details. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Update documentationJan Stolarek2014-07-031-1/+2
| | | | | * fix links to the User's Guide in ghc and ghci --help messages * fix default stack size info in RTS help message
* remove redundant condition checking in profiling RTS codeosa12014-07-021-4/+2
| | | | | | | | | | | | | | Summary: A redundant condition checking is removed, as discussed in http://www.haskell.org/pipermail/ghc-devs/2014-June/005088.html Test Plan: validate Reviewers: simonmar, austin Reviewed By: austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D37
* Fix variable name in allocate()Reid Barton2014-07-011-3/+3
|
* Check for integer overflow in allocate() (#9172)Reid Barton2014-07-011-1/+9
| | | | | | | | | | | | | | Summary: Check for integer overflow in allocate() (#9172) Test Plan: validate Reviewers: austin Reviewed By: austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D36
* Re-add more primops for atomic ops on byte arraysJohan Tibell2014-06-302-13/+0
| | | | | | | | | | | | | | | | | | | | | | | This is the second attempt to add this functionality. The first attempt was reverted in 950fcae46a82569e7cd1fba1637a23b419e00ecd, due to register allocator failure on x86. Given how the register allocator currently works, we don't have enough registers on x86 to support cmpxchg using complicated addressing modes. Instead we fall back to a simpler addressing mode on x86. Adds the following primops: * atomicReadIntArray# * atomicWriteIntArray# * fetchSubIntArray# * fetchOrIntArray# * fetchXorIntArray# * fetchAndIntArray# Makes these pre-existing out-of-line primops inline: * fetchAddIntArray# * casIntArray#
* Revert "Fix obscure problem with using the system linker (#8935)"Austin Seipp2014-06-301-34/+9
| | | | | | This reverts commit 2f8b4c9330b455d4cb31c186c747a7db12a69251. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Revert "Add more primops for atomic ops on byte arrays"Johan Tibell2014-06-262-0/+13
| | | | | | | | This commit caused the register allocator to fail on i386. This reverts commit d8abf85f8ca176854e9d5d0b12371c4bc402aac3 and 04dd7cb3423f1940242fdfe2ea2e3b8abd68a177 (the second being a fix to the first).
* Add more primops for atomic ops on byte arraysJohan Tibell2014-06-242-13/+0
| | | | | | | | | | | | | | | | | | | Summary: Add more primops for atomic ops on byte arrays Adds the following primops: * atomicReadIntArray# * atomicWriteIntArray# * fetchSubIntArray# * fetchOrIntArray# * fetchXorIntArray# * fetchAndIntArray# Makes these pre-existing out-of-line primops inline: * fetchAddIntArray# * casIntArray#
* Fix Windows build (wibble to fix for Trac #4934)Simon Peyton Jones2014-06-111-1/+1
|
* Raise exceptions when blocked in bad FDs (fixes Trac #4934)Sergei Trofimovich2014-06-085-48/+139
| | | | | | | | | | | | | | | Before the patch any call to 'select()' with 'bad_fd' led to: - unblocking of all threads - hiding exception for 'threadWaitRead bad_fd' The patch fixes both cases in this way: after 'select()' failure we iterate over each blocked descriptor and poll individually to see it's actual status, which is: - READY (move to run queue) - BLOCKED (leave in blocked queue) - INVALID (send an IOErrror exception) Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Fix obscure problem with using the system linker (#8935)Simon Marlow2014-06-081-9/+34
| | | | See Note [RTLD_LOCAL] for a summary of the problem and solution, and
* Add ".text.unlikely" to recognized code sections on Windows.Niklas Larsson2014-06-051-0/+1
| | | | | | Fixes #9080 Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix missing unlockClosure() call in tryReadMVar (#9148)Simon Marlow2014-05-301-0/+1
|
* Per-capability nursery weak pointer lists, fixes #9075Edward Z. Yang2014-05-298-5/+61
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* rts: remove stable-names from hashtable upon freeEdward Z. Yang2014-05-181-0/+1
| | | | | | This fixes #9078. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Only uninstall signal handlers if they were actually installed (#9068)Simon Marlow2014-05-161-2/+6
| | | | Submitted by: tomgr
* Revert "Per-thread allocation counters and limits"Simon Marlow2014-05-0412-137/+51
| | | | | | | | Problems were found on 32-bit platforms, I'll commit again when I have a fix. This reverts the following commits: 54b31f744848da872c7c6366dea840748e01b5cf b0534f78a73f972e279eed4447a5687bd6a8308e
* Update comment now that we have per-gen weak pointer lists.Edward Z. Yang2014-05-041-4/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* fix rts exported symbols base_GHCziIOziException_allocationLimitExceeded_closureSergei Trofimovich2014-05-032-2/+3
| | | | | | | | | | | | | | | | Commit b0534f78a73f972e279eed4447a5687bd6a8308e added new exported rts symbols, but slightly misspelled them. Observer on first compiled program: > Linking dist/build/haskell-updater/haskell-updater ... > /usr/lib64/ghc-7.9.20140503/rts-1.0/libHSrts.a(Schedule.o): In function `scheduleWaitThread': > (.text+0xc4c): undefined reference to `base_GHCziIOziException_allocationLimitExceeded_closure' > /usr/lib64/ghc-7.9.20140503/rts-1.0/libHSrts.a(RtsStartup.o): In function `hs_init_ghc': > (.text+0x2fa): undefined reference to `base_GHCziIOziException_allocationLimitExceeded_closure' > collect2: error: ld returned 1 exit status CC: Simon Marlow <marlowsd@gmail.com> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Per-thread allocation counters and limitsSimon Marlow2014-05-0211-51/+136
| | | | | | | | | | | | | | | | | | | | | | | This tracks the amount of memory allocation by each thread in a counter stored in the TSO. Optionally, when the counter drops below zero (it counts down), the thread can be sent an asynchronous exception: AllocationLimitExceeded. When this happens, given a small additional limit so that it can handle the exception. See documentation in GHC.Conc for more details. Allocation limits are similar to timeouts, but - timeouts use real time, not CPU time. Allocation limits do not count anything while the thread is blocked or in foreign code. - timeouts don't re-trigger if the thread catches the exception, allocation limits do. - timeouts can catch non-allocating loops, if you use -fno-omit-yields. This doesn't work for allocation limits. I couldn't measure any impact on benchmarks with these changes, even for nofib/smp.
* Rts: Reuse scavenge_small_bitmap (#8742)Arash Rouhani2014-04-292-53/+33
| | | | | | | | | | | | | | | | The function was inlined at two places already. And the function is having the STATIC_INLINE annotation, so the assembly output should. be the same. To convince myself, I did diff the output of the object files before and after the patch and they matched on my 64-bit Ubuntu 13.10 machine, running gcc 4.8.1-10ubuntu9. Also, I had to move scavenge_small_bitmap up a bit since it's not in any .h-file. While I was at it, I also applied the analogous patch for Compact.c. Though I had to write `thread_small_bitmap` instead of just moving it.
* Rts: Consistently use StgWord for sizes of bitmapsArash Rouhani2014-04-292-15/+15
| | | | | | | | | | | | | | | | | | A long debate is in issue #8742, but the main motivation is that this allows for applying a patch to reuse the function scavenge_small_bitmap without changing the .o-file output. Similarly, I changed the types in rts/sm/Compact.c, so I can create a STATIC_INLINE function for the redundant code block: while (size > 0) { if ((bitmap & 1) == 0) { thread((StgClosure **)p); } p++; bitmap = bitmap >> 1; size--; }
* rts: Fix memory leak when loading ELF objectsAustin Seipp2014-04-291-0/+1
| | | | | | Issue discovered by Coverity Scan, CID 43168. Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: Fix leak of file archive handleAustin Seipp2014-04-291-0/+1
| | | | | | Issue discovered by Coverity Scan, CID 43171. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Revert "rts: Add an initial Coverity model"Austin Seipp2014-04-291-112/+0
| | | | This reverts commit 4539400a72ded7fa69149b28cfa9c84464f4739d.
* rts: Add an initial Coverity modelAustin Seipp2014-04-291-0/+112
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix scavenge_stack crash (#9045)Simon Marlow2014-04-291-2/+3
| | | | | | The new stg_gc_prim_p_ll stack frame was missing an info table. This is a regression since 7.6, because this stuff was part of a cleanup that happened in 7.7.
* Check correct variable for NULLNicolas Trangez2014-04-271-1/+1
| | | | | | | Issue discovered by Coverity scan, CID 43163. This should fix CID 43172 as a side-effect as well. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Check return value of sigactionNicolas Trangez2014-04-271-1/+3
| | | | | | Issue discovered by Coverity scan, CID 43142. Signed-off-by: Austin Seipp <austin@well-typed.com>
* coverity: Suppress some time-of-check-time-of-use reportsAustin Seipp2014-04-271-0/+4
| | | | | | CID 43178 Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: Fix possible int overflow in resize_nurseryAustin Seipp2014-04-271-1/+2
| | | | | | | | | | | n_capabilities is declared as unsigned int (32bit), and so multiplication is 32-bit before being stored in a 64bit integer (StgWord). Instead, cast n_capabilities to StgWord before multiplying. Discovered by Coverity. CID 43164. Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: Fix potential memory leak in ProfHeap.cAustin Seipp2014-04-271-3/+4
| | | | | | Discovered by Coverity. CID 43166. Signed-off-by: Austin Seipp <austin@well-typed.com>
* ghc: initial AArch64 patchesColin Watson2014-04-211-0/+66
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Make BlockAlloc.c comment slightly more accurate (fixes #8491)Edward Z. Yang2014-04-131-1/+1
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Fix linked list manipulation code (buggy on consecutive deletion)Edward Z. Yang2014-04-122-3/+6
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Include LD_OPTS when building the RTS shared libsSimon Marlow2014-04-071-1/+4
|
* Ignore repeated loads of the same archive (#8942)Simon Marlow2014-04-071-18/+32
|
* Disable thin archive support on WindowsSimon Marlow2014-04-041-1/+14
|
* Test return value of clock_gettime() for errors.Simon Marlow2014-04-041-3/+13
| | | | | I don't want to fall back to gettimeofday(), because that might have a different absolute value.
* Fix copy/paste error (#8937)Simon Marlow2014-04-041-1/+1
|
* Support thin archive formatSimon Marlow2014-04-011-49/+90
| | | | | | | | | | | | This is a patch from FB's internal build of GHC that I'm pushing upstream. Author: Andrew Gallagher <agallagher@fb.com> This diff adds simple thin archive support to ghc's linker code, which basically just entails finding the member data from disk rather than from inside the archive (except for the case of the symbol index and gnu filename index, where the member data is still inline).
* Add more missing linker symbolsJohan Tibell2014-03-291-0/+3
|
* PrimOps.cmm: whitespace onlyJohan Tibell2014-03-291-438/+439
| | | | | Harmonize the indentation amount. The file mixed 4, 2, and in some cases 3 spaces for indentation.
* Add missing symbols to linkerJohan Tibell2014-03-291-1/+5
| | | | The copy array family of primops were moved out-of-line.