1. 08 Aug, 2001 2 commits
    • simonmar's avatar
      [project @ 2001-08-08 13:45:02 by simonmar] · dfebb20f
      simonmar authored
      wibble
      dfebb20f
    • simonmar's avatar
      [project @ 2001-08-08 10:50:36 by simonmar] · 52c07834
      simonmar authored
      Had a brainwave on the way to work this morning, and realised that the
      garbage collector can handle "pinned objects" as long as they don't
      contain any pointers.
      
      This is absolutely ideal for doing temporary allocation in the FFI,
      because what we really want to do is allocate a pinned ByteArray and
      let the GC clean it up later.  So this set of changes adds the
      required framework.
      
      There are two new primops:
      
       newPinnedByteArray# :: Int# -> State# s -> (# State# s, MutByteArr# s #)
       byteArrayContents#  :: ByteArr# -> Addr#
      
      obviously byteArrayContents# is highly unsafe.
      
      Allocating a pinned ByteArr# isn't the default, because a pinned
      ByteArr# will hold an entire block (currently 4k) live until it is
      garbage collected (that doesn't mean each pinned ByteArr# requires
      4k of storage, just that if a block contains a single live pinned
      ByteArray, the whole block must be retained).
      52c07834
  2. 07 Aug, 2001 2 commits
    • simonmar's avatar
      [project @ 2001-08-07 10:49:49 by simonmar] · 8553e558
      simonmar authored
      (forced commit)
      
      Note that the previous commit also fixed the bug reported by Ken Shan
      yesterday, namely that the conc004.hs test was failing.
      8553e558
    • simonmar's avatar
      [project @ 2001-08-07 09:20:52 by simonmar] · 433cdcad
      simonmar authored
      - Allow RTS options to be given using the GHCRTS environment variable.
      
      - Fix the heap size calculation to take into account all generations.
        It's more conservative than it used to be, but now it is less likely
        that the maximum heap size will be exceeded.
      
      - Compacting collection is turned on automatically when residency
        reaches 30% of the maximum heap size, tunable with +RTS -c<n>.
        +RTS -c turns off compaction altogether.
      
      - The maximum heap size is off by default.  NOTE: this also means no
        compaction by default.  It is recommended that people enable a maximum
        heap size for their system using the GHCRTS environment var; eg:
        GHCRTS=-M128m.
      433cdcad
  3. 04 Aug, 2001 1 commit
  4. 02 Aug, 2001 1 commit
  5. 30 Jul, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-07-30 12:54:12 by simonmar] · a5381464
      simonmar authored
      - Bugfix: mark the weak pointer list before GC, instead of the
        (strange) old mechanism which involved "cleaning it up" after GC.
      
      - size the old generation properly when doing compacting GC.
      a5381464
  6. 26 Jul, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-07-26 14:29:26 by simonmar] · bc51f1af
      simonmar authored
      Fall back to doing a linear scan of the old generation when the mark
      stack fills up.
      
      The compacting collector should work for all programs now, but there's
      still some work to do on the speed of the collector - don't expect
      programs to go any faster :)
      bc51f1af
  7. 25 Jul, 2001 2 commits
    • simonmar's avatar
      [project @ 2001-07-25 12:18:26 by simonmar] · f7341243
      simonmar authored
      - move the call to scavenge_mark_stack() inside the inner scavenge loop,
        so it gets called more often and there's less chance of the mark
        stack filling up.  None of the nofib tests cause the mark stack to
        fill up now.
      
      - remove some experimental code from scavenge_mark_stack().
      f7341243
    • simonmar's avatar
      [project @ 2001-07-25 09:14:21 by simonmar] · e16e9973
      simonmar authored
      - bugfix (was erroneously ignoring the return value from scavenge_one() and
        checking failed_to_evac instead, which was always false)
      
      - printf format fix (shut gcc up).
      e16e9973
  8. 24 Jul, 2001 3 commits
    • simonmar's avatar
      [project @ 2001-07-24 16:36:43 by simonmar] · 76a51a41
      simonmar authored
      Bugfixes; take large objects into account in stats output.
      76a51a41
    • ken's avatar
      [project @ 2001-07-24 06:31:35 by ken] · d888cbcb
      ken authored
      Innocent changes to resurrect/add 64-bit support.
      d888cbcb
    • ken's avatar
      [project @ 2001-07-24 05:04:58 by ken] · 030787e5
      ken authored
      Removed 32-bit dependencies in the generation and handling of
      liveness mask bitmaps.  We now support both 32-bit and 64-bit
      machines with identical .hc files.  Support for >64-bit machines
      would be easy to add.  Note that old .hc files are incompatible
      with the changes made to ghc/include/InfoMacros.h!
      030787e5
  9. 23 Jul, 2001 2 commits
    • simonmar's avatar
      [project @ 2001-07-23 17:23:19 by simonmar] · dfd7d6d0
      simonmar authored
      Add a compacting garbage collector.
      
      It isn't enabled by default, as there are still a couple of problems:
      there's a fallback case I haven't implemented yet which means it will
      occasionally bomb out, and speed-wise it's quite a bit slower than the
      copying collector (about 1.8x slower).
      
      Until I can make it go faster, it'll only be useful when you're
      actually running low on real memory.
      
      '+RTS -c' to enable it.
      
      Oh, and I cleaned up a few things in the RTS while I was there, and
      fixed one or two possibly real bugs in the existing GC.
      dfd7d6d0
    • simonmar's avatar
      [project @ 2001-07-23 10:47:16 by simonmar] · 6f83fbc0
      simonmar authored
      Small changes to improve GC performance slightly:
      
        - store the generation *number* in the block descriptor rather
          than a pointer to the generation structure, since the most
          common operation is to pull out the generation number, and
          it's one less indirection this way.
      
        - cache the generation number in the step structure too, which
          avoids an extra indirection in several places.
      6f83fbc0
  10. 03 Apr, 2001 1 commit
  11. 02 Apr, 2001 1 commit
  12. 22 Mar, 2001 1 commit
    • hwloidl's avatar
      [project @ 2001-03-22 03:51:08 by hwloidl] · 20fc2f0c
      hwloidl authored
      -*- outline -*-
      Time-stamp: <Thu Mar 22 2001 03:50:16 Stardate: [-30]6365.79 hwloidl>
      
      This commit covers changes in GHC to get GUM (way=mp) and GUM/GdH (way=md)
      working. It is a merge of my working version of GUM, based on GHC 4.06,
      with GHC 4.11. Almost all changes are in the RTS (see below).
      
      GUM is reasonably stable, we used the 4.06 version in large-ish programs for
      recent papers. Couple of things I want to change, but nothing urgent.
      GUM/GdH has just been merged and needs more testing. Hope to do that in the
      next weeks. It works in our working build but needs tweaking to run.
      GranSim doesn't work yet (*sigh*). Most of the code should be in, but needs
      more debugging.
      
      ToDo: I still want to make the following minor modifications before the release
      - Better wrapper skript for parallel execution [ghc/compiler/main]
      - Update parallel docu: started on it but it's minimal [ghc/docs/users_guide]
      - Clean up [nofib/parallel]: it's a real mess right now (*sigh*)
      - Update visualisation tools (minor things only IIRC) [ghc/utils/parallel]
      - Add a Klingon-English glossary
      
      * RTS:
      
      Almost all changes are restricted to ghc/rts/parallel and should not
      interfere with the rest. I only comment on changes outside the parallel
      dir:
      
      - Several changes in Schedule.c (scheduling loop; createThreads etc);
        should only affect parallel code
      - Added ghc/rts/hooks/ShutdownEachPEHook.c
      - ghc/rts/Linker.[ch]: GUM doesn't know about Stable Names (ifdefs)!!
      - StgMiscClosures.h: END_TSO_QUEUE etc now defined here (from StgMiscClosures.hc)
                           END_ECAF_LIST was missing a leading stg_
      - SchedAPI.h: taskStart now defined in here; it's only a wrapper around
                    scheduleThread now, but might use some init, shutdown later
      - RtsAPI.h: I have nuked the def of rts_evalNothing
      
      * Compiler:
      
      - ghc/compiler/main/DriverState.hs
        added PVM-ish flags to the parallel way
        added new ways for parallel ticky profiling and distributed exec
      
      - ghc/compiler/main/DriverPipeline.hs
        added a fct run_phase_MoveBinary which is called with way=mp after linking;
        it moves the bin file into a PVM dir and produces a wrapper script for
        parallel execution
        maybe cleaner to add a MoveBinary phase in DriverPhases.hs but this way
        it's less intrusive and MoveBinary makes probably only sense for mp anyway
      
      * Nofib:
      
      - nofib/spectral/Makefile, nofib/real/Makefile, ghc/tests/programs/Makefile:
        modified to skip some tests if HWL_NOFIB_HACK is set; only tmp to record
        which test prgs cause problems in my working build right now
      20fc2f0c
  13. 20 Mar, 2001 1 commit
  14. 02 Mar, 2001 2 commits
    • simonmar's avatar
      [project @ 2001-03-02 16:15:53 by simonmar] · 435b1086
      simonmar authored
      ASSERT in updateWithIndirection() that we haven't already updated this
      object with an indirection, and fix two places in the RTS where this
      could happen.
      
      The problem only occurs when we're in a black-hole-style loop, and
      there are multiple update frames on the stack pointing to the same
      object (this is possible because of lazy black-holing).  Both stack
      squeezing and asynchronous exception raising walk down the stack and
      remove update frames, updating their contents with indirections.  If
      we don't protect against multiple updates, the mutable list in the old
      generation may get into a bogus state.
      435b1086
    • simonmar's avatar
      [project @ 2001-03-02 14:28:44 by simonmar] · 18f73b07
      simonmar authored
      Yet another good bug (I'm on a roll today! :-)
      
      When squeezing update frames, make sure the updatee pointers aren't
      identical before updating one to point to the other.  This is mostly
      harmless, but in one example I have caused the program to go into an
      infinite loop rather than fall down a black hole.
      
      To be merged into the 4.08 branch.
      18f73b07
  15. 11 Feb, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-02-11 17:51:07 by simonmar] · 6d35596c
      simonmar authored
      Bite the bullet and make GHCi support non-optional in the RTS.  GHC
      4.11 should be able to build GHCi without any additional tweaks now.
      
      - the Linker is split into two parts: LinkerBasic.c, containing the
        routines required by the rest of the RTS, and Linker.c, containing
        the linker proper, which is not referred to from the rest of the RTS.
        Only Linker.c requires -ldl, so programs which don't make use of the
        linker (everything except GHC, in other words) won't need -ldl.
      6d35596c
  16. 08 Feb, 2001 1 commit
  17. 31 Jan, 2001 1 commit
  18. 29 Jan, 2001 1 commit
  19. 16 Jan, 2001 1 commit
  20. 11 Dec, 2000 1 commit
  21. 04 Dec, 2000 1 commit
  22. 20 Nov, 2000 1 commit
  23. 13 Nov, 2000 2 commits
  24. 01 Nov, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-11-01 11:41:47 by simonmar] · 39a99171
      simonmar authored
      Add a basic "front panel" for GHC-compiled programs.
      
      How to use it:
      
      	- re-autoconf & configure to detect GTK+
      
      	- add "GhcRtsWithFrontPanel = YES" to mk/build.mk
      
      	- rebuild the RTS
      
      	- compile up a program, add `gtk-config --libs` to the
      	  link command line
      
      	- run with program with +RTS -f,
      
      	- sit back & watch the show :-)  Programs with lots of
      	  heap-resident data are the most interesting.  For extra
      	  kicks, turn up the number of generations & steps like so:
      	  +RTS -f -G5 -T3.
      
      	- Bootstrap your compiler, and see in glorious technicolor
      	  just how much of a lumbering beast GHC really is.
      
      This is a work in progress.  There's lots more stuff we could display
      on the panel: suggestions/comments are of course welcome.  The window
      layout was designed with GLADE, I'll commit the config file shortly.
      
      I haven't quite figured out how we're going to integrate this with the
      release yet (ie. whether we'll distribute two separate RTS's or what).
      39a99171
  25. 06 Oct, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-10-06 15:38:06 by simonmar] · 1b8911b4
      simonmar authored
      The GC needs to be cleverer about which address ranges are in
      text/data space if we're dynamically loading modules.
      
      (BTW, this linking stuff is mostly ported from code written by Julian
      Seward for STG Hugs).
      1b8911b4
  26. 15 Aug, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-08-15 14:18:43 by simonmar] · b86f4b95
      simonmar authored
      Make the TSO structure shorter by 2 words:
      
      	- remove splim.  It was always equal to &(tso->stack) +
      	  RESERVED_STACK_WORDS.
      
      	- make two enum fields 16 bits each instead of 32.
      b86f4b95
  27. 26 May, 2000 1 commit
  28. 23 May, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-05-23 13:57:53 by simonmar] · c88e235f
      simonmar authored
      Fix a Real Bug(TM) in the new code for detecting dead threads: we
      weren't taking into account the case when a ThreadRelocated is found
      on the all_threads list.
      c88e235f
  29. 27 Apr, 2000 1 commit
  30. 14 Apr, 2000 2 commits
    • panne's avatar
      [project @ 2000-04-14 16:47:43 by panne] · 0e36d5e3
      panne authored
      Reduce number of warnings and raise chances of successful compilation
      when *not* building an interpreter :-)
      0e36d5e3
    • sewardj's avatar
      [project @ 2000-04-14 15:18:05 by sewardj] · 9ff75d08
      sewardj authored
      Clean up the runtime heap before deleting modules (and, currently, after
      every evaluation) so that the combined system can safely throw away
      modules and info tables without creating dangling refs from the heap.
      9ff75d08
  31. 11 Apr, 2000 1 commit
    • sewardj's avatar
      [project @ 2000-04-11 16:36:53 by sewardj] · d5087432
      sewardj authored
      Ensure that when Hugs decides to unload a module (nukeModule()), there are
      no closures anywhere in the system which refers to infotables defined
      in that module.  That means reverting all CAFs and doing a major GC
      prior to deleting the module.  A flag is used to avoid redundant GCs.
      d5087432