summaryrefslogtreecommitdiff
path: root/rts
Commit message (Collapse)AuthorAgeFilesLines
* Drop the per-task timing stats, give a summary only (#5897)Simon Marlow2012-03-026-105/+73
| | | | | | | | | | | | | | | | | | | | | | We were keeping around the Task struct (216 bytes) for every worker we ever created, even though we only keep a maximum of 6 workers per Capability. These Task structs accumulate and cause a space leak in programs that do lots of safe FFI calls; this patch frees the Task struct as soon as a worker exits. One reason we were keeping the Task structs around is because we print out per-Task timing stats in +RTS -s, but that isn't terribly useful. What is sometimes useful is knowing how *many* Tasks there were. So now I'm printing a single-line summary, this is for the program in TASKS: 2001 (1 bound, 31 peak workers (2000 total), using -N1) So although we created 2k tasks overall, there were only 31 workers active at any one time (which is exactly what we expect: the program makes 30 safe FFI calls concurrently). This also gives an indication of how many capabilities were being used, which is handy if you use +RTS -N without an explicit number.
* raiseAsync: cope with ATOMICALLY_FRAMES inside UPDATE_FRAMES (#5866)Simon Marlow2012-02-272-11/+66
|
* slight tweak to help text (#5896)Simon Marlow2012-02-271-2/+2
|
* formatting tweaksGabor Greif2012-02-271-8/+8
|
* (some) tabs -> spacesGabor Greif2012-02-271-1/+1
|
* tabs -> spacesGabor Greif2012-02-271-53/+53
|
* (some) tabs -> spacesGabor Greif2012-02-271-1/+1
|
* (some) tabs -> spacesGabor Greif2012-02-271-1/+1
|
* zap extra semiGabor Greif2012-02-271-1/+1
|
* typoGabor Greif2012-02-271-5/+5
|
* comments onlyGabor Greif2012-02-271-6/+6
|
* typoGabor Greif2012-02-271-1/+1
|
* fix ARM StgCRun to not save and restore r11/fp register twiceKarel Gardas2012-02-161-2/+2
|
* fix ARM's StgCRun clobbered register list for both ARM and Thumb modesKarel Gardas2012-02-161-1/+15
|
* Allocate pinned object blocks from the nursery, not the globalSimon Marlow2012-02-135-13/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | allocator. Prompted by a benchmark posted to parallel-haskell@haskell.org by Andreas Voellmy <andreas.voellmy@gmail.com>. This program exhibits contention for the block allocator when run with -N2 and greater without the fix: {-# LANGUAGE MagicHash, UnboxedTuples, BangPatterns #-} module Main where import Control.Monad import Control.Concurrent import System.Environment import GHC.IO import GHC.Exts import GHC.Conc main = do [m] <- fmap (fmap read) getArgs n <- getNumCapabilities ms <- replicateM n newEmptyMVar sequence [ forkIO $ busyWorkerB (m `quot` n) >> putMVar mv () | mv <- ms ] mapM takeMVar ms busyWorkerB :: Int -> IO () busyWorkerB n_loops = go 0 where go !n | n >= n_loops = return () | otherwise = do p <- (IO $ \s -> case newPinnedByteArray# 1024# s of { (# s', mbarr# #) -> (# s', () #) } ) go (n+1)
* Add dragonfly support; based on a patch from Goetz IsenmannIan Lynagh2012-02-111-1/+1
|
* ARM StgRun: Ensure r11 state is preservedBen Gamari2012-02-071-3/+3
|
* avoid 32-bit integer overflow (#5831)Simon Marlow2012-02-071-1/+1
|
* commentsSimon Marlow2012-02-071-1/+6
|
* Fix register clobber list in StgRun for ARMBen Gamari2012-01-301-1/+1
| | | | | | | | The ARM implementation of StgRun does not claim that it clobbers r7-r12. As a result, the compiler will sometimes put the returned RegTable in one of these registers, resulting in an invalid RegTable to be returned. Hilarity ensues. Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
* Fix bug introduced in fac8ecbbafde17dd92439c41747223c43e9d2b80Simon Marlow2012-01-191-6/+6
| | | | Fixes recent failures in hGetBuf001.
* Add missing initialisation of cap->disabledSimon Marlow2012-01-161-0/+1
|
* Fix bug causing polling instead of blocking in the non-threaded RTS (#5773)Simon Marlow2012-01-161-18/+17
| | | | | | | | | This was a regression introduced accidentally in 6b1098511aaabd2c9503ee7be6da1944466f9cb4. We were previously passing a large time value to select() to simulate blocking, and this broke due to a change from unsigned to signed arithmetic. I've refactored it to be less fragile now - we just pass NULL as the timeval parameter to select(), which is the correct way to do blocking.
* Fix for tick intervals greater than one second.Simon Marlow2012-01-161-2/+2
|
* Remove some "0 +"s that look redundantIan Lynagh2012-01-151-2/+2
|
* Remove an out-of-date commentIan Lynagh2012-01-151-2/+1
|
* TOP/includes/dist doesn't exist (yet?) and makes ghcpkg05 fail, so remove itSimon Marlow2012-01-121-1/+1
|
* check for failed external symbol lookups (partial fix for #5748)Gregory Wright2012-01-111-15/+81
|
* Add live stg info to Updates.cmm (fixes #4308)David Terei2012-01-091-5/+6
|
* last_free_capability should never be NULLSimon Marlow2012-01-091-1/+1
|
* Make the RTS linker API use wide-char pathnames on Windows (#5697)Simon Marlow2012-01-092-54/+84
| | | | | I haven't been able to test whether this works or not due to #5754, but at least it doesn't appear to break anything.
* RefactoringIan Lynagh2012-01-082-3/+3
| | | | | This is working towards being able to put ghcautoconf.h and ghcplatform.h in includes/dist
* refactoringSimon Marlow2012-01-061-12/+12
|
* setNumCapabilities: don't barf() if it isn't supported, just print an errorSimon Marlow2012-01-061-3/+9
|
* Fix a crash in STM when unregisterisedSimon Marlow2012-01-061-1/+1
| | | | | | | Fixes several test failures: ../../libraries/stm/tests 2411 [bad exit code] (normal,hpc,profasm,ghci,optllvm) ../../libraries/stm/tests stm046 [bad exit code] (normal,hpc,profasm,ghci,optllvm) ../../libraries/stm/tests stm061 [bad exit code] (normal,hpc,profasm,ghci,optllvm)
* Fix crash with +RTS -xc (occasional cgrun057(profthreaded) failure)Simon Marlow2012-01-061-1/+1
| | | | | | Don't try to print a stack trace from raiseAsync() when there's no exception - we might just be deleting the thread, or suspending duplicate work.
* Fix for unregisterised compilation: we want registers when ↵Simon Marlow2012-01-051-1/+1
| | | | | | defined(USE_MINIINTERPRETER) Needed by #5357
* Rename the CCCS field of StgTSO so as not to conflict with the CCCS ↵Simon Marlow2012-01-052-2/+2
| | | | | | pseudo-register Needed by #5357
* In the SIGTSTP handler, throw SIGSTOP instead of re-throwing SIGTSTPSimon Marlow2012-01-031-14/+14
|
* Hide STG register declarations for LLVM C compilersDavid M Peixotto2011-12-191-0/+12
| | | | | | | | | | | | | | | This commit swaps the import order of Rts.h and Stg.h in StgCRun.c for non-SPARC architectures. Swapping the import order prevents the declaration of the global registers thus allowing the GHC runtime to be compiled by LLVM-based C compilers. LLVM-base C compilers cannot use the global register declarations (for R1, R2, etc.) because they use GCC-specific extensions. The declarations are not needed in StgCRun.c except for the SPARC architecture. The other architectures use hand-written assembly that accesses the appropriate register directly.
* Support for reducing the number of Capabilities with setNumCapabilitiesSimon Marlow2011-12-153-72/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows setNumCapabilities to /reduce/ the number of active capabilities as well as increase it. This is particularly tricky to do, because a Capability is a large data structure and ties into the rest of the system in many ways. Trying to clean it all up would be extremely error prone. So instead, the solution is to mark the extra capabilities as "disabled". This has the following consequences: - threads on a disabled capability are migrated away by the scheduler loop - disabled capabilities do not participate in GC (see scheduleDoGC()) - No spark threads are created on this capability (see scheduleActivateSpark()) - We do not attempt to migrate threads *to* a disabled capability (see schedulePushWork()). So a disabled capability should do no work, and does not participate in GC, although it remains alive in other respects. For example, a blocked thread might wake up on a disabled capability, and it will get quickly migrated to a live capability. A disabled capability can still initiate GC if necessary. Indeed, it turns out to be hard to migrate bound threads, so we wait until the next GC to do this (see comments for details).
* Fix a memory allocation bug (rts_argv wasn't big enough)Simon Marlow2011-12-141-5/+22
|
* $(rts_H_FILES) should contain .h files in subdirectories of rts/ tooSimon Marlow2011-12-131-1/+1
|
* Fix for a bug in setNumCapabilitiesSimon Marlow2011-12-131-3/+8
|
* Fix for a bug in +RTS -qi (crash in zero_static_object_list)Simon Marlow2011-12-131-1/+3
|
* add a missing error checkSimon Marlow2011-12-131-0/+3
|
* Add a comment about oddity with yieldThread() and timing results on LinuxSimon Marlow2011-12-131-0/+5
|
* Avoid integer overflow when calling allocGroup() (#5071)Simon Marlow2011-12-132-4/+11
|
* New flag +RTS -qi<n>, avoid waking up idle Capabilities to do parallel GCSimon Marlow2011-12-136-11/+102
| | | | | | | | | | | | | | | | | This is an experimental tweak to the parallel GC that avoids waking up a Capability to do parallel GC if we know that the capability has been idle for a (tunable) number of GC cycles. The idea is that if you're only using a few Capabilities, there's no point waking up the ones that aren't busy. e.g. +RTS -qi3 says "A Capability will participate in parallel GC if it was running at all since the last 3 GC cycles." Results are a bit hit and miss, and I don't completely understand why yet. Hence, for now it is turned off by default, and also not documented except in the +RTS -? output.
* waitForGcThreads: should be calling interruptCapability(), not ↵Simon Marlow2011-12-131-1/+1
| | | | interruptAllCapabilities()