ghc-hetmet.git
15 years agoFix up inlines for gcc 4.3
Simon Marlow [Thu, 19 Jun 2008 10:08:49 +0000 (10:08 +0000)]
Fix up inlines for gcc 4.3
gcc 4.3 emits warnings for static inline functions that its heuristics
decided not to inline.  The workaround is to either mark appropriate
functions as "hot" (a new attribute in gcc 4.3), or sometimes to use
"extern inline" instead.

With this fix I can validate with gcc 4.3 on Fedora 9.

15 years agofix warnings with gcc 4.3
Simon Marlow [Wed, 18 Jun 2008 14:43:07 +0000 (14:43 +0000)]
fix warnings with gcc 4.3

15 years agoit's time to retire ghcprof & friends
Simon Marlow [Wed, 18 Jun 2008 14:02:28 +0000 (14:02 +0000)]
it's time to retire ghcprof & friends

15 years agoMake the wired-in packages code handle ndp mapping to ndp-seq or ndp-par
Ian Lynagh [Wed, 18 Jun 2008 16:22:33 +0000 (16:22 +0000)]
Make the wired-in packages code handle ndp mapping to ndp-seq or ndp-par
It's getting a bit crufty - could probably do with a rewrite.

15 years agoPut the infrastructure in place for getting the libraries -Wall clean
Ian Lynagh [Tue, 17 Jun 2008 02:01:45 +0000 (02:01 +0000)]
Put the infrastructure in place for getting the libraries -Wall clean
libraries/Makefile.local now lists those for which we need to pass -w
(currently this is every library).

15 years agoutils/Digraph doesn't need -fglasgow-exts passed specially
Ian Lynagh [Mon, 16 Jun 2008 22:59:49 +0000 (22:59 +0000)]
utils/Digraph doesn't need -fglasgow-exts passed specially

15 years agoFix Trac #2321: bug in SAT
simonpj@microsoft.com [Mon, 16 Jun 2008 20:17:00 +0000 (20:17 +0000)]
Fix Trac #2321: bug in SAT
  This is a fairly substantial rewrite of the Static Argument Transformatoin,
  done by Max Bolingbroke and reviewed and modified by Simon PJ.

  * Fix a subtle scoping problem; see Note [Binder type capture]
  * Redo the analysis to use environments
  * Run gentle simlification just before the transformation

15 years agodefine NeedVarargsPrototypes to avoid segfault on x86_64
Simon Marlow [Wed, 18 Jun 2008 13:21:16 +0000 (13:21 +0000)]
define NeedVarargsPrototypes to avoid segfault on x86_64

15 years agoFix an example where we weren't doing case-of-case when we should
Simon Marlow [Tue, 17 Jun 2008 12:35:10 +0000 (12:35 +0000)]
Fix an example where we weren't doing case-of-case when we should
That's 1 line of new code and 38 lines of new comments

15 years agofix gcc warnings for printf formats on 32-bit
Simon Marlow [Wed, 18 Jun 2008 09:40:18 +0000 (09:40 +0000)]
fix gcc warnings for printf formats on 32-bit

15 years agoFIX BUILD on Windows
Simon Marlow [Wed, 18 Jun 2008 09:47:00 +0000 (09:47 +0000)]
FIX BUILD on Windows

15 years agoSort the mi_deps into a canonical ordering before fingerprinting.
Simon Marlow [Tue, 17 Jun 2008 15:21:17 +0000 (15:21 +0000)]
Sort the mi_deps into a canonical ordering before fingerprinting.
This may help do a little less recompilation with make (GHC's --make
is unaffected).

15 years agoFix another "urk! lookup local fingerprint" in nofib/real/bspt/GeomNum.lhs
Simon Marlow [Tue, 17 Jun 2008 15:15:30 +0000 (15:15 +0000)]
Fix another "urk! lookup local fingerprint" in nofib/real/bspt/GeomNum.lhs

15 years agosmall interpreter fix
Simon Marlow [Tue, 17 Jun 2008 13:46:51 +0000 (13:46 +0000)]
small interpreter fix

15 years agofix some printf formats for 64 bits
Simon Marlow [Tue, 17 Jun 2008 10:11:02 +0000 (10:11 +0000)]
fix some printf formats for 64 bits

15 years ago64-bit fixes
Simon Marlow [Tue, 17 Jun 2008 10:10:45 +0000 (10:10 +0000)]
64-bit fixes

15 years agodon't try to parallelise marking GC (yet)
Simon Marlow [Mon, 16 Jun 2008 07:31:11 +0000 (07:31 +0000)]
don't try to parallelise marking GC (yet)

15 years agoanother stableptr003 fix
Simon Marlow [Mon, 9 Jun 2008 19:17:22 +0000 (19:17 +0000)]
another stableptr003 fix

15 years agoExperimental "mark-region" strategy for the old generation
Simon Marlow [Mon, 9 Jun 2008 17:49:43 +0000 (17:49 +0000)]
Experimental "mark-region" strategy for the old generation
Sometimes better than the default copying, enabled by +RTS -w

15 years agothreadStackUnderflow: fix up the bd->free pointers in the split blocks
Simon Marlow [Mon, 9 Jun 2008 17:16:17 +0000 (17:16 +0000)]
threadStackUnderflow: fix up the bd->free pointers in the split blocks

15 years agofix allocated blocks calculation, and add more sanity checks
Simon Marlow [Sun, 8 Jun 2008 07:37:54 +0000 (07:37 +0000)]
fix allocated blocks calculation, and add more sanity checks

15 years agoPut the contents of Evac.c-inc back in Evac.c, and just compile the file twice
Simon Marlow [Tue, 3 Jun 2008 07:31:19 +0000 (07:31 +0000)]
Put the contents of Evac.c-inc back in Evac.c, and just compile the file twice
Similarly for Scav.c/Scav.c-inc.

15 years ago+RTS -N also sets +RTS -g
Simon Marlow [Tue, 3 Jun 2008 07:27:01 +0000 (07:27 +0000)]
+RTS -N also sets +RTS -g

15 years agoDECLARE_GCT for when we have no register variable
Simon Marlow [Tue, 3 Jun 2008 07:26:08 +0000 (07:26 +0000)]
DECLARE_GCT for when we have no register variable

15 years agocomment updates
Simon Marlow [Tue, 3 Jun 2008 07:25:27 +0000 (07:25 +0000)]
comment updates

15 years agofix some types for 64-bit platforms
Simon Marlow [Tue, 3 Jun 2008 03:26:25 +0000 (03:26 +0000)]
fix some types for 64-bit platforms

15 years ago+RTS -S- is the same as +RTS -Sstderr
Simon Marlow [Tue, 3 Jun 2008 03:25:57 +0000 (03:25 +0000)]
+RTS -S- is the same as +RTS -Sstderr

15 years agomove the spinlock counts inside +RTS -S
Simon Marlow [Tue, 3 Jun 2008 03:25:34 +0000 (03:25 +0000)]
move the spinlock counts inside +RTS -S

15 years agoFIX #2164: check for ThreadRelocated in isAlive()
Simon Marlow [Wed, 28 May 2008 06:39:04 +0000 (06:39 +0000)]
FIX #2164: check for ThreadRelocated in isAlive()

16 years agoFIX the compacting GC again
Simon Marlow [Thu, 24 Apr 2008 20:58:29 +0000 (20:58 +0000)]
FIX the compacting GC again

16 years agoFIX #2185: sparks should not be treated as roots by the GC
Simon Marlow [Thu, 24 Apr 2008 20:58:13 +0000 (20:58 +0000)]
FIX #2185: sparks should not be treated as roots by the GC

16 years agoturn off the usleep() in the GC thread idle loop (tmp, for portability)
Simon Marlow [Thu, 17 Apr 2008 22:02:21 +0000 (22:02 +0000)]
turn off the usleep() in the GC thread idle loop (tmp, for portability)

16 years agodeclare the GC thread register variable more portably
Simon Marlow [Thu, 17 Apr 2008 22:01:57 +0000 (22:01 +0000)]
declare the GC thread register variable more portably

16 years agoremove EVACUATED: store the forwarding pointer in the info pointer
Simon Marlow [Thu, 17 Apr 2008 21:27:07 +0000 (21:27 +0000)]
remove EVACUATED: store the forwarding pointer in the info pointer

16 years agotso->link is now tso->_link (fix after merge with HEAD)
Simon Marlow [Thu, 17 Apr 2008 18:00:16 +0000 (18:00 +0000)]
tso->link is now tso->_link  (fix after merge with HEAD)

16 years agoDon't look at all the threads before each GC.
Simon Marlow [Wed, 16 Apr 2008 23:44:46 +0000 (23:44 +0000)]
Don't look at all the threads before each GC.
We were looking at all the threads for 2 reasons:
 1. to catch transactions that might be looping as a
    result of seeing an inconsistent view of memory.
 2. to catch threads with blocked exceptions that are
    themselves blocked.
For (1) we now check for this case whenever a thread yields, and for
(2) we catch these threads in the GC itself and send the exceptions
after GC (see performPendingThrowTos).

16 years agoDon't traverse the entire list of threads on every GC (phase 1)
Simon Marlow [Wed, 16 Apr 2008 23:44:20 +0000 (23:44 +0000)]
Don't traverse the entire list of threads on every GC (phase 1)
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.

16 years agooptimisation for isAlive()
Simon Marlow [Wed, 16 Apr 2008 23:43:49 +0000 (23:43 +0000)]
optimisation for isAlive()

16 years agorefactoring
Simon Marlow [Wed, 16 Apr 2008 23:43:24 +0000 (23:43 +0000)]
refactoring

16 years agoadd [] to foreign calls
Simon Marlow [Wed, 16 Apr 2008 23:42:34 +0000 (23:42 +0000)]
add [] to foreign calls

16 years agoremove GRAN/PAR code
Simon Marlow [Wed, 16 Apr 2008 23:41:35 +0000 (23:41 +0000)]
remove GRAN/PAR code

16 years agobugfix for traverseBlackHoleQueue
Simon Marlow [Wed, 16 Apr 2008 23:40:42 +0000 (23:40 +0000)]
bugfix for traverseBlackHoleQueue

16 years agoAdd a write barrier to the TSO link field (#1589)
Simon Marlow [Wed, 16 Apr 2008 23:39:51 +0000 (23:39 +0000)]
Add a write barrier to the TSO link field (#1589)

16 years agofix trace
Simon Marlow [Wed, 16 Apr 2008 23:39:22 +0000 (23:39 +0000)]
fix trace

16 years agotmp: alloc one block at a time
Simon Marlow [Wed, 16 Apr 2008 23:38:30 +0000 (23:38 +0000)]
tmp: alloc one block at a time

16 years agoadd debugging code to check for fragmentation
Simon Marlow [Wed, 16 Apr 2008 23:30:58 +0000 (23:30 +0000)]
add debugging code to check for fragmentation

16 years agodo a better job of re-using partial blocks in subsequent GCs
Simon Marlow [Wed, 16 Apr 2008 23:29:49 +0000 (23:29 +0000)]
do a better job of re-using partial blocks in subsequent GCs

16 years agoUse the BF_EVACUATED flag to indicate to-space consistently
Simon Marlow [Wed, 16 Apr 2008 23:29:06 +0000 (23:29 +0000)]
Use the BF_EVACUATED flag to indicate to-space consistently
BF_EVACUATED is now set on all blocks except those that we are
copying.  This means we don't need a separate test for gen>N in
evacuate(), because in generations older than N, BF_EVACUATED will be
set anyway.  The disadvantage is that we have to reset the
BF_EVACUATED flag on the blocks of any generation we're collecting
before starting GC.  Results in a small speed improvement.

16 years agorearrange: we were calling markSomeCapabilities too often
Simon Marlow [Wed, 16 Apr 2008 23:28:25 +0000 (23:28 +0000)]
rearrange: we were calling markSomeCapabilities too often

16 years agodebug output: show mem in use
Simon Marlow [Wed, 16 Apr 2008 23:27:39 +0000 (23:27 +0000)]
debug output: show mem in use

16 years agomake +RTS -G1 work again
Simon Marlow [Wed, 16 Apr 2008 23:25:10 +0000 (23:25 +0000)]
make +RTS -G1 work again

16 years agopad step_workspace to 64 bytes, to speed up access to gct->steps[]
Simon Marlow [Wed, 16 Apr 2008 23:24:33 +0000 (23:24 +0000)]
pad step_workspace to 64 bytes, to speed up access to gct->steps[]

16 years agoupdate copyrights in rts/sm
Simon Marlow [Wed, 16 Apr 2008 23:23:55 +0000 (23:23 +0000)]
update copyrights in rts/sm

16 years agoReorganisation to fix problems related to the gct register variable
Simon Marlow [Wed, 16 Apr 2008 23:22:32 +0000 (23:22 +0000)]
Reorganisation to fix problems related to the gct register variable
  - GCAux.c contains code not compiled with the gct register enabled,
    it is callable from outside the GC
  - marking functions are moved to their relevant subsystems, outside
    the GC
  - mark_root needs to save the gct register, as it is called from
    outside the GC

16 years agofaster block allocator, by dividing the free list into buckets
Simon Marlow [Wed, 16 Apr 2008 22:45:41 +0000 (22:45 +0000)]
faster block allocator, by dividing the free list into buckets

16 years agoallocate more blocks in one go, to reduce contention for the block allocator
Simon Marlow [Wed, 16 Apr 2008 22:38:24 +0000 (22:38 +0000)]
allocate more blocks in one go, to reduce contention for the block allocator

16 years agomeasure GC(0/1) times and work imbalance
Simon Marlow [Wed, 16 Apr 2008 22:25:39 +0000 (22:25 +0000)]
measure GC(0/1) times and work imbalance

16 years agoremove outdated comment
Simon Marlow [Wed, 16 Apr 2008 22:23:19 +0000 (22:23 +0000)]
remove outdated comment

16 years agocalculate and report slop (wasted space at the end of blocks)
Simon Marlow [Wed, 16 Apr 2008 22:15:16 +0000 (22:15 +0000)]
calculate and report slop (wasted space at the end of blocks)

16 years agofree empty blocks at the end of GC
Simon Marlow [Wed, 16 Apr 2008 22:13:56 +0000 (22:13 +0000)]
free empty blocks at the end of GC

16 years agomove the scan block pointer into the gct structure
Simon Marlow [Wed, 16 Apr 2008 22:13:31 +0000 (22:13 +0000)]
move the scan block pointer into the gct structure

16 years agoimprovements to +RTS -s output
Simon Marlow [Wed, 16 Apr 2008 22:12:24 +0000 (22:12 +0000)]
improvements to +RTS -s output
- count and report number of parallel collections
- calculate bytes scanned in addition to bytes copied per thread
- calculate "work balance factor"
- tidy up the formatting a bit

16 years agowait for threads to start up properly
Simon Marlow [Wed, 16 Apr 2008 22:10:02 +0000 (22:10 +0000)]
wait for threads to start up properly

16 years agodebug output tweaks
Simon Marlow [Wed, 16 Apr 2008 22:08:07 +0000 (22:08 +0000)]
debug output tweaks

16 years agoKeep track of an accurate count of live words in each step
Simon Marlow [Wed, 16 Apr 2008 22:06:20 +0000 (22:06 +0000)]
Keep track of an accurate count of live words in each step
This means we can calculate slop easily, and also improve
predictability of GC.

16 years agoAllow work units smaller than a block to improve load balancing
Simon Marlow [Wed, 16 Apr 2008 22:03:47 +0000 (22:03 +0000)]
Allow work units smaller than a block to improve load balancing

16 years agoin scavenge_block1(), we can use the lock-free recordMutableGen()
Simon Marlow [Wed, 16 Apr 2008 22:01:04 +0000 (22:01 +0000)]
in scavenge_block1(), we can use the lock-free recordMutableGen()

16 years agoupdate the debug counters following changes to scav_find_work()
Simon Marlow [Wed, 16 Apr 2008 21:59:45 +0000 (21:59 +0000)]
update the debug counters following changes to scav_find_work()

16 years agochange the find-work strategy: use oldest-first consistently
Simon Marlow [Wed, 16 Apr 2008 21:58:15 +0000 (21:58 +0000)]
change the find-work strategy: use oldest-first consistently

16 years agoper-thread debug output when using multiple threads, not just major gc
Simon Marlow [Wed, 16 Apr 2008 21:57:41 +0000 (21:57 +0000)]
per-thread debug output when using multiple threads, not just major gc

16 years agosmall debug output improvements
Simon Marlow [Wed, 16 Apr 2008 21:56:49 +0000 (21:56 +0000)]
small debug output improvements

16 years agoallow parallel minor collections too
Simon Marlow [Wed, 16 Apr 2008 21:55:03 +0000 (21:55 +0000)]
allow parallel minor collections too

16 years agoSpecialise evac/scav for single-threaded, not minor, GC
Simon Marlow [Wed, 16 Apr 2008 21:54:05 +0000 (21:54 +0000)]
Specialise evac/scav for single-threaded, not minor, GC
So we can parallelise minor collections too.  Sometimes it's worth it.

16 years agomove usleep(1) to gc_thread_work() from any_work()
Simon Marlow [Wed, 16 Apr 2008 21:53:25 +0000 (21:53 +0000)]
move usleep(1) to gc_thread_work() from any_work()

16 years agouse RTS_VAR()
Simon Marlow [Wed, 16 Apr 2008 21:52:45 +0000 (21:52 +0000)]
use RTS_VAR()

16 years agotreat the global work list as a queue rather than a stack
Simon Marlow [Wed, 16 Apr 2008 21:51:09 +0000 (21:51 +0000)]
treat the global work list as a queue rather than a stack

16 years agoGC: move static object processinng into thread-local storage
Simon Marlow [Wed, 16 Apr 2008 21:48:25 +0000 (21:48 +0000)]
GC: move static object processinng into thread-local storage

16 years agotmp: usleep(1) during anyWork() if no work
Simon Marlow [Wed, 16 Apr 2008 21:40:23 +0000 (21:40 +0000)]
tmp: usleep(1) during anyWork() if no work

16 years agoanyWork(): count the number of times we don't find any work
Simon Marlow [Wed, 16 Apr 2008 21:39:45 +0000 (21:39 +0000)]
anyWork(): count the number of times we don't find any work

16 years agostats fixes
Simon Marlow [Wed, 16 Apr 2008 21:35:32 +0000 (21:35 +0000)]
stats fixes

16 years agoAdd +RTS -vg flag for requesting some GC trace messages, outside DEBUG
Simon Marlow [Wed, 16 Apr 2008 21:35:04 +0000 (21:35 +0000)]
Add +RTS -vg flag for requesting some GC trace messages, outside DEBUG
DEBUG imposes a significant performance hit in the GC, yet we often
want some of the debugging output, so -vg gives us the cheap trace
messages without the sanity checking of DEBUG, just like -vs for the
scheduler.

16 years agoGC: rearrange storage to reduce memory accesses in the inner loop
Simon Marlow [Wed, 16 Apr 2008 21:34:36 +0000 (21:34 +0000)]
GC: rearrange storage to reduce memory accesses in the inner loop

16 years agoAdd profiling of spinlocks
Simon Marlow [Wed, 16 Apr 2008 21:33:58 +0000 (21:33 +0000)]
Add profiling of spinlocks

16 years agorename StgSync to SpinLock
Simon Marlow [Wed, 16 Apr 2008 21:11:52 +0000 (21:11 +0000)]
rename StgSync to SpinLock

16 years agoRelease some of the memory allocated to a stack when it shrinks (#2090)
simonmar@microsoft.com [Thu, 28 Feb 2008 15:31:29 +0000 (15:31 +0000)]
Release some of the memory allocated to a stack when it shrinks (#2090)
When a stack is occupying less than 1/4 of the memory it owns, and is
larger than a megablock, we release half of it.  Shrinking is O(1), it
doesn't need to copy the stack.

16 years agoscavengeTSO might encounter a ThreadRelocated; cope
simonmar@microsoft.com [Thu, 28 Feb 2008 15:24:03 +0000 (15:24 +0000)]
scavengeTSO might encounter a ThreadRelocated; cope

16 years agoUpdating a thunk in raiseAsync might encounter an IND; cope
simonmar@microsoft.com [Thu, 28 Feb 2008 15:23:32 +0000 (15:23 +0000)]
Updating a thunk in raiseAsync might encounter an IND; cope
There was already a check to avoid updating an IND, but it was
originally there to avoid a bug which doesn't exist now.  Furthermore
the test and update are not atomic, so another thread could be
updating this thunk while we are.  We have to just go ahead and update
anyway - it might waste a little work, but this is a very rare case.

16 years agoadd GC(0) and GC(1) time
Simon Marlow [Fri, 22 Feb 2008 14:20:08 +0000 (14:20 +0000)]
add GC(0) and GC(1) time

16 years agoround_to_mblocks: should use StgWord not nat
Simon Marlow [Wed, 20 Feb 2008 13:01:39 +0000 (13:01 +0000)]
round_to_mblocks: should use StgWord not nat

16 years agodebugging code
Simon Marlow [Tue, 19 Feb 2008 10:26:51 +0000 (10:26 +0000)]
debugging code

16 years agorefactoring
simonmar@microsoft.com [Mon, 18 Feb 2008 13:54:58 +0000 (13:54 +0000)]
refactoring

16 years agofix off-by-one
simonmar@microsoft.com [Fri, 15 Feb 2008 13:40:17 +0000 (13:40 +0000)]
fix off-by-one

16 years agomeasure mut_elapsed_time
simonmar@microsoft.com [Fri, 15 Feb 2008 13:38:50 +0000 (13:38 +0000)]
measure mut_elapsed_time

16 years agofix build with 6.8
simonmar@microsoft.com [Fri, 15 Feb 2008 13:38:36 +0000 (13:38 +0000)]
fix build with 6.8

16 years agoadd ROUNDUP_BYTES_TO_WDS
simonmar@microsoft.com [Fri, 15 Feb 2008 13:30:40 +0000 (13:30 +0000)]
add ROUNDUP_BYTES_TO_WDS

16 years agoAllow +RTS -H0 as a way to override a previous -H<size>
simonmar@microsoft.com [Thu, 31 Jan 2008 15:36:45 +0000 (15:36 +0000)]
Allow +RTS -H0 as a way to override a previous -H<size>

16 years agocomment out a bogus assertion
simonmar@microsoft.com [Wed, 30 Jan 2008 15:09:34 +0000 (15:09 +0000)]
comment out a bogus assertion

16 years agomemInventory: optionally dump the memory inventory
simonmar@microsoft.com [Wed, 30 Jan 2008 15:09:21 +0000 (15:09 +0000)]
memInventory: optionally dump the memory inventory
in addition to checking for leaks

16 years agocalcNeeded: fix the calculation, we weren't counting G0 step 1
simonmar@microsoft.com [Wed, 30 Jan 2008 15:07:30 +0000 (15:07 +0000)]
calcNeeded: fix the calculation, we weren't counting G0 step 1

16 years agocalcNeeded: add in the large blocks too
simonmar@microsoft.com [Wed, 30 Jan 2008 13:54:18 +0000 (13:54 +0000)]
calcNeeded: add in the large blocks too