summaryrefslogtreecommitdiff
path: root/rts/Sanity.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix #3429: a tricky race conditionSimon Marlow2009-08-181-1/+1
| | | | | | | | | | | | | | | | | | There were two bugs, and had it not been for the first one we would not have noticed the second one, so this is quite fortunate. The first bug is in stg_unblockAsyncExceptionszh_ret, when we found a pending exception to raise, but don't end up raising it, there was a missing adjustment to the stack pointer. The second bug was that this case was actually happening at all: it ought to be incredibly rare, because the pending exception thread would have to be killed between us finding it and attempting to raise the exception. This made me suspicious. It turned out that there was a race condition on the tso->flags field; multiple threads were updating this bitmask field non-atomically (one of the bits is the dirty-bit for the generational GC). The fix is to move the dirty bit into its own field of the TSO, making the TSO one word larger (sadly).
* Fix a sanity check; fixes #3089Ian Lynagh2009-08-121-1/+1
|
* RTS tidyup sweep, first phaseSimon Marlow2009-08-021-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first phase of this tidyup is focussed on the header files, and in particular making sure we are exposinng publicly exactly what we need to, and no more. - Rts.h now includes everything that the RTS exposes publicly, rather than a random subset of it. - Most of the public header files have moved into subdirectories, and many of them have been renamed. But clients should not need to include any of the other headers directly, just #include the main public headers: Rts.h, HsFFI.h, RtsAPI.h. - All the headers needed for via-C compilation have moved into the stg subdirectory, which is self-contained. Most of the headers for the rest of the RTS APIs have moved into the rts subdirectory. - I left MachDeps.h where it is, because it is so widely used in Haskell code. - I left a deprecated stub for RtsFlags.h in place. The flag structures are now exposed by Rts.h. - Various internal APIs are no longer exposed by public header files. - Various bits of dead code and declarations have been removed - More gcc warnings are turned on, and the RTS code is more warning-clean. - More source files #include "PosixSource.h", and hence only use standard POSIX (1003.1c-1995) interfaces. There is a lot more tidying up still to do, this is just the first pass. I also intend to standardise the names for external RTS APIs (e.g use the rts_ prefix consistently), and declare the internal APIs as hidden for shared libraries.
* Remove old GUM/GranSim codeSimon Marlow2009-06-021-326/+0
|
* Fix sanity checking after fix to #2917Simon Marlow2009-03-121-2/+4
|
* sanity checking fixesSimon Marlow2009-01-121-3/+3
|
* Add optional eager black-holing, with new flag -feager-blackholingSimon Marlow2008-11-181-4/+0
| | | | | | | | | | | | | | | Eager blackholing can improve parallel performance by reducing the chances that two threads perform the same computation. However, it has a cost: one extra memory write per thunk entry. To get the best results, any code which may be executed in parallel should be compiled with eager blackholing turned on. But since there's a cost for sequential code, we make it optional and turn it on for the parallel package only. It might be a good idea to compile applications (or modules) with parallel code in with -feager-blackholing. ToDo: document -feager-blackholing.
* More sanity checking for the TSO write barrierSimon Marlow2008-09-091-0/+25
| | | | Check that all threads marked as dirty are really on the mutable list.
* Make LOOKS_LIKE_{INFO,CLOSURE}_PTR into inline functions, instead of macrosSimon Marlow2008-09-081-4/+4
| | | | | | The macros were duplicating their arguments, which was normally harmless, but in the parallel GC was actually wrong and caused spurious assertion failures.
* remove EVACUATED: store the forwarding pointer in the info pointerSimon Marlow2008-04-171-5/+7
|
* Don't traverse the entire list of threads on every GC (phase 1)Simon Marlow2008-04-161-6/+10
| | | | | | Instead of keeping a single list of all threads, keep one per step and only look at the threads belonging to steps that we are collecting.
* Add a write barrier to the TSO link field (#1589)Simon Marlow2008-04-161-1/+1
|
* Fix an assertionIan Lynagh2008-04-261-4/+5
| | | | | We were checking that a pointer was correctly tagged, but after we had untagged it.
* Check tag bits on the fun pointer of a PAPSimon Marlow2007-11-261-0/+3
|
* Add a proper write barrier for MVarsSimon Marlow2007-10-111-1/+2
| | | | | | | | | | | | Previously MVars were always on the mutable list of the old generation, which meant every MVar was visited during every minor GC. With lots of MVars hanging around, this gets expensive. We addressed this problem for MUT_VARs (aka IORefs) a while ago, the solution is to use a traditional GC write-barrier when the object is modified. This patch does the same thing for MVars. TVars are still done the old way, they could probably benefit from the same treatment too.
* Pointer TaggingSimon Marlow2007-07-271-6/+11
| | | | | | | | | | | | | | | | | | | | | | This patch implements pointer tagging as per our ICFP'07 paper "Faster laziness using dynamic pointer tagging". It improves performance by 10-15% for most workloads, including GHC itself. The original patches were by Alexey Rodriguez Yakushev <mrchebas@gmail.com>, with additions and improvements by me. I've re-recorded the development as a single patch. The basic idea is this: we use the low 2 bits of a pointer to a heap object (3 bits on a 64-bit architecture) to encode some information about the object pointed to. For a constructor, we encode the "tag" of the constructor (e.g. True vs. False), for a function closure its arity. This enables some decisions to be made without dereferencing the pointer, which speeds up some common operations. In particular it enables us to avoid costly indirect jumps in many cases. More information in the commentary: http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/HaskellExecution/PointerTagging
* Remove vectored returns.Simon Marlow2007-02-281-4/+0
| | | | | We recently discovered that they aren't a win any more, and just cost code size.
* Remove the itbls field of BCO, put itbls in with the literalsSimon Marlow2007-02-271-1/+0
| | | | This is a simplification & minor optimisation for GHCi
* STM invariantstharris@microsoft.com2006-10-071-4/+21
|
* Remove CONSTR_CHARLIKE and CONSTR_INTLIKE closure typesSimon Marlow2006-09-071-2/+0
| | | | | | | | These closure types aren't used/needed, as far as I can tell. The commoning up of Chars/Ints happens by comparing info pointers, and the info table for a dynamic C#/I# is CONSTR_0_1. The RTS seemed a little confused about whether CONSTR_CHARLIKE/CONSTR_INTLIKE were supposed to be static or dynamic closures, too.
* Reorganisation of the source treeSimon Marlow2006-04-071-0/+948
Most of the other users of the fptools build system have migrated to Cabal, and with the move to darcs we can now flatten the source tree without losing history, so here goes. The main change is that the ghc/ subdir is gone, and most of what it contained is now at the top level. The build system now makes no pretense at being multi-project, it is just the GHC build system. No doubt this will break many things, and there will be a period of instability while we fix the dependencies. A straightforward build should work, but I haven't yet fixed binary/source distributions. Changes to the Building Guide will follow, too.