1. 26 Jun, 2002 1 commit
    • stolz's avatar
      [project @ 2002-06-26 08:18:38 by stolz] · fbbed914
      stolz authored
      - Make TSO "stable" again: The thread label was changing the size of the
         TSO if you were building a debugging-RTS, leading to binary
         incompatibility. Now we map TSOs to strings using Hash.c.
      
      - API change for labelThread: Label arbitrary threads.
      fbbed914
  2. 11 May, 2002 1 commit
    • sof's avatar
      [project @ 2002-05-11 00:16:11 by sof] · 32a27624
      sof authored
      As a result of calling exitScheduler(), enter into a
      'shutting-down' state, so that the subsequent (sequential)
      execution of finalisers won't get stuck inside the
      Scheduler waiting for more work.
      
      Cleanest way I could think of solving this problem on a
      Friday afternoon.
      32a27624
  3. 26 Apr, 2002 1 commit
    • sof's avatar
      [project @ 2002-04-26 22:35:54 by sof] · 6a268d86
      sof authored
      When the OS thread is all out of work, shut down in a gentler
      manner by calling shutdownHaskell() rather than
      shutdownHaskellAndExit(). Give up the sched_mutex lock also.
      6a268d86
  4. 04 Feb, 2002 1 commit
  5. 12 Dec, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-12-12 14:31:42 by simonmar] · 55c8be52
      simonmar authored
      - Add a new type of restriction: -hC, which restricts to closures
        whose CCS contains the specified CCs *anywhere* (not just at the
        top).
      
      - Complain if the user tries to request both retainer and biographical
        profiling.  We don't support both simultaneously, because they use
        the same header word in the closure.
      
      - Allow for the fact that the heap might contain some closures which
        don't have a valid retainer set during the heap census.  The only
        known closures of this kind so far are DEAD_WEAK closures.
      
      - Some cruft-removal and renaming of functions to follow conventions.
      55c8be52
  6. 06 Dec, 2001 1 commit
    • sof's avatar
      [project @ 2001-12-06 07:07:12 by sof] · b240523e
      sof authored
      startupHaskell: if invoked more than once, do run initModules() each time,
      as there might be more than one 'root module'.
      b240523e
  7. 27 Nov, 2001 1 commit
    • sof's avatar
      [project @ 2001-11-27 01:51:23 by sof] · e30e0fb8
      sof authored
      Rearranged how the virtual timer 'subsystem' is brought up and down:
      
      * "int startVirtTimer(nat ms)" now starts the vtimer/ticker.
      * "int stopVirtTimer()" shuts down the ticker.
      
      i.e., removed install_vtalrm_handler() and initialize_virtual_timer().
      e30e0fb8
  8. 26 Nov, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-11-26 16:54:21 by simonmar] · dbef766c
      simonmar authored
      Profiling cleanup.
      
      This commit eliminates some duplication in the various heap profiling
      subsystems, and generally centralises much of the machinery.  The key
      concept is the separation of a heap *census* (which is now done in one
      place only instead of three) from the calculation of retainer sets.
      Previously the retainer profiling code also did a heap census on the
      fly, and lag-drag-void profiling had its own census machinery.
      
      Value-adds:
      
         - you can now restrict a heap profile to certain retainer sets,
           but still display by cost centre (or type, or closure or
           whatever).
      
         - I've added an option to restrict the maximum retainer set size
           (+RTS -R<size>, defaulting to 8).
      
         - I've cleaned up the heap profiling options at the request of
           Simon PJ.  See the help text for details.  The new scheme
           is backwards compatible with the old.
      
         - I've removed some odd bits of LDV or retainer profiling-specific
           code from various parts of the system.
      
         - the time taken doing heap censuses (and retainer set calculation)
           is now accurately reported by the RTS when you say +RTS -Sstderr.
      
      Still to come:
      
         - restricting a profile to a particular biography
           (lag/drag/void/use).  This requires keeping old heap censuses
           around, but the infrastructure is now in place to do this.
      dbef766c
  9. 22 Nov, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-11-22 14:25:11 by simonmar] · db61851c
      simonmar authored
      Retainer Profiling / Lag-drag-void profiling.
      
      This is mostly work by Sungwoo Park, who spent a summer internship at
      MSR Cambridge this year implementing these two types of heap profiling
      in GHC.
      
      Relative to Sungwoo's original work, I've made some improvements to
      the code:
      
         - it's now possible to apply constraints to retainer and LDV profiles
           in the same way as we do for other types of heap profile (eg.
           +RTS -hc{foo,bar} -hR -RTS gives you a retainer profiling considering
           only closures with cost centres 'foo' and 'bar').
      
         - the heap-profile timer implementation is cleaned up.
      
         - heap profiling no longer has to be run in a two-space heap.
      
         - general cleanup of the code and application of the SDM C coding
           style guidelines.
      
      Profiling will be a little slower and require more space than before,
      mainly because closures have an extra header word to support either
      retainer profiling or LDV profiling (you can't do both at the same
      time).
      
      We've used the new profiling tools on GHC itself, with moderate
      success.  Fixes for some space leaks in GHC to follow...
      db61851c
  10. 08 Nov, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-11-08 12:46:31 by simonmar] · 0671ef05
      simonmar authored
      Fix the large block allocation bug (Yay!)
      -----------------------------------------
      
      In order to do this, I had to
      
       1. in each heap-check failure branch, return the amount of heap
          actually requested, in a known location (I added another slot
          in StgRegTable called HpAlloc for this purpose).  This is
          useful for other reasons - in particular it makes it possible
          to get accurate allocation statistics.
      
       2. In the scheduler, if a heap check fails and we wanted more than
          BLOCK_SIZE_W words, then allocate a special large block and place
          it in the nursery.  The nursery now has to be double-linked so
          we can insert the new block in the middle.
      
       3. The garbage collector has to be able to deal with multiple objects
          in a large block.  It turns out that this isn't a problem as long as
          the large blocks only occur in the nursery, because we always copy
          objects from the nursery during GC.  One small change had to be
          made: in evacuate(), we may need to follow the link field from the
          block descriptor to get to the block descriptor for the head of a
          large block.
      
       4. Various other parts of the storage manager had to be modified
          to cope with a nursery containing a mixture of block sizes.
      
      Point (3) causes a slight pessimization in the garbage collector.  I
      don't see a way to avoid this.  Point (1) causes some code bloat (a
      rough measurement is around 5%), so to offset this I made the
      following change which I'd been meaning to do for some time:
      
        - Store the values of some commonly-used absolute addresses
          (eg. stg_update_PAP) in the register table.  This lets us use
          shorter instruction forms for some absolute jumps and saves some
          code space.
      
        - The type of Capability is no longer the same as an StgRegTable.
          MainRegTable renamed to MainCapability.  See Regs.h for details.
      
      Other minor changes:
      
        - remove individual declarations for the heap-check-failure jump
          points, and declare them all in StgMiscClosures.h instead.  Remove
          HeapStackCheck.h.
      
      Updates to the native code generator to follow.
      0671ef05
  11. 31 Oct, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-10-31 10:34:29 by simonmar] · 760f104f
      simonmar authored
      Fix a problem when a Haskell process is suspended/resumed using shell
      job control in Unix.  The shell tends to put stdin back into blocking
      mode before resuming the process, so we have to catch SIGCONT and put
      it back into O_NONBLOCK.
      
      Also:
      
        - fix a bug in the scheduler: reverse the order of the check
          for pending signals and the call to awaitEvent to block on I/O.
      
        - do a style sweep in Signals.c
      760f104f
  12. 04 Sep, 2001 1 commit
    • ken's avatar
      [project @ 2001-09-04 18:29:20 by ken] · fb7a723b
      ken authored
      THIS CHANGE AFFECTS ALL OBJECT FILES COMPILED FROM HASKELL.
      Please say "make -C ghc/lib/std clean; make -C hslibs clean".
      
      This commit eliminates spurious warning messages when compiling on
      the Alpha.  There are two kinds of spurious warning messages:
      
      (1) gcc: -noprefix_recognition: linker input file unused since linking not done
      
          This warning is because we pass the flag "-Xlinker -noprefix_recognition"
          to gcc.  We remove this warning by no longer passing the flag to gcc,
          and by removing the reason we were passing the flag in the first place:
          __init_* is now renamed to __stginit_*.
      
      (2) .../includes/Regs.h: warning: call-clobbered register used for global
          register variable
      
          This warning and all other warnings except (1), we eliminate by
          passing the -w flag to gcc.
      
      MERGE TO STABLE BRANCH
      fb7a723b
  13. 14 Aug, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-08-14 13:40:07 by sewardj] · bc5c8021
      sewardj authored
      Change the story about POSIX headers in C compilation.
      
      Until now, all C code in the RTS and library cbits has by default been
      compiled with settings for POSIXness enabled, that is:
         #define _POSIX_SOURCE   1
         #define _POSIX_C_SOURCE 199309L
         #define _ISOC9X_SOURCE
      If you wanted to negate this, you'd have to define NON_POSIX_SOURCE
      before including headers.
      
      This scheme has some bad effects:
      
      * It means that ccall-unfoldings exported via interfaces from a
        module compiled with -DNON_POSIX_SOURCE may not compile when
        imported into a module which does not -DNON_POSIX_SOURCE.
      
      * It overlaps with the feature tests we do with autoconf.
      
      * It seems to have caused borkage in the Solaris builds for some
        considerable period of time.
      
      The New Way is:
      
      * The default changes to not-being-in-Posix mode.
      
      * If you want to force a C file into Posix mode, #include as
        the **first** include the new file ghc/includes/PosixSource.h.
        Most of the RTS C sources have this include now.
      
      * NON_POSIX_SOURCE is almost totally expunged.  Unfortunately
        we have to retain some vestiges of it in ghc/compiler so that
        modules compiled via C on Solaris using older compilers don't
        break.
      bc5c8021
  14. 25 May, 2001 1 commit
  15. 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
  16. 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
  17. 09 Feb, 2001 2 commits
  18. 19 Dec, 2000 1 commit
  19. 04 Dec, 2000 1 commit
  20. 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
  21. 06 Oct, 2000 1 commit
  22. 20 Apr, 2000 1 commit
  23. 11 Apr, 2000 1 commit
  24. 10 Apr, 2000 1 commit
  25. 03 Apr, 2000 2 commits
  26. 31 Mar, 2000 1 commit
    • hwloidl's avatar
      [project @ 2000-03-31 03:09:35 by hwloidl] · dd4c28a9
      hwloidl authored
      Numerous changes in the RTS to get GUM-4.06 working (currently works with
      parfib-ish programs). Most changes are isolated in the rts/parallel dir.
      
      rts/parallel/:
        The most important changes are a rewrite of the (un-)packing code (Pack.c)
        and changes in LAGA, GALA table operations (Global.c) expecially in
        rebuilding the tables during GC.
      
      rts/:
        Minor changes in Schedule.c, GC.c (interface to par specific root marking
        and evacuation), and lots of additions to Sanity.c (surprise ;-)
        Main.c change for startup: I use a new function rts_evalNothing to
        start non-main-PEs in a PAR || SMP setup (RtsAPI.c)
      
      includes/:
        Updated GranSim macros in PrimOps.h.
      
      lib/std:
        Few changes in PrelHandle.c etc replacing ForeignObj by Addr in a PAR
        setup (we still don't support ForeignObjs or WeakPtrs in GUM).
        Typically use
          #define FILE_OBJECT	    Addr
        when dealing with files.
      
      hslibs/lang/:
        Same as above (in Foreign(Obj).lhs, Weak.lhs, IOExts.lhs etc).
      
      -- HWL
      dd4c28a9
  27. 30 Mar, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-03-30 12:03:30 by simonmar] · c108d3f6
      simonmar authored
      HEADS UP!!!
      
      change the type of startupHaskell():
      
         void startupHaskell  ( int argc, char *argv[], void *init_root );
      
      the extra parameter is a pointer to the initialisation function for
      the root module in the program.  eg., Main.c now passes __init_Main for
      this parameter.  It can be left as NULL if there is no root module.
      
      This interface may need to be revised, since in some circumstances
      there may be more than one "root module".
      
      Sigbjorn: H/Direct will need some changes to stay in sync here.
      c108d3f6
  28. 21 Mar, 2000 1 commit
  29. 14 Mar, 2000 2 commits
    • sewardj's avatar
      [project @ 2000-03-14 14:34:47 by sewardj] · 51464cf3
      sewardj authored
      Update Hugs so as to work with the new way of referencing Prelude
      symbols from the RTS.  The main action is in fixupRTStoPreludeRefs()
      in rts/Prelude.c.
      51464cf3
    • simonmar's avatar
      [project @ 2000-03-14 09:55:05 by simonmar] · 3ddfe34b
      simonmar authored
      Handle references from the RTS to the Prelude in a more consistent
      way.
      
      	- For statically-linked binaries, nothing has changed.
      
      	- For the interpreter, refs from the RTS to the Prelude
      	  are now indirected.  The indirections need to be
      	  filled in at some point during startup by calling
      	  fixupPreludeRefs (in Prelude.c).
      
      	- The CHARLIKE and INTLIKE tables are now handled in
      	  the same way for both Hugs and DLLs.
      
      Hugs will be broken for a short while until Julian sorts out the Hugs
      parts of this change.
      3ddfe34b
  30. 09 Mar, 2000 1 commit
  31. 08 Mar, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-03-08 17:48:24 by simonmar] · de896403
      simonmar authored
      - generalise the per-module initialisation stubs so that we use it
        in normal (non-profiled) code too.  The initialisation stubs are
        now called '__init_<module>' rather than '_reg<module>'.
      
      - Register foreign exported functions as stable pointers in the
        initialisation code for the module.  This fixes the foreign export
        problems reported by several people.
      
      - remove the concept of "module groups" from the profiling subsystem.
      
      - change the profiling semantics slightly; it should be unnecessary
        to use '-caf-all' to get reasonable profiles now.
      de896403
  32. 22 Feb, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-02-22 12:09:23 by simonmar] · b310c854
      simonmar authored
      Ignore SIGPIPE, since our I/O library handles EPIPE properly and
      SIGPIPE tends to cause the Haskell program to exit silently and
      mysteriously.
      
      Found-by: furiously pressing the refresh button in a browser connected
      to my Haskell web server :-)
      b310c854
  33. 17 Feb, 2000 1 commit
  34. 07 Feb, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-02-07 20:57:58 by simonmar] · 4d12e452
      simonmar authored
      I'm utterly bemused, but it seems that someone called simonpj disabled
      the virtual timer in rev 1.25:
      
      	+ #if 0 /* tmp--SDM */
            		initialize_virtual_timer(TICK_MILLISECS);
      	+ #endif
      
      and tried to blame it on me by putting my name in the comment :-)
      
      (Simon - perhaps you copied this file out of my working tree and
      committed it by mistake or something?)
      4d12e452
  35. 14 Jan, 2000 1 commit
  36. 13 Jan, 2000 1 commit
    • hwloidl's avatar
      [project @ 2000-01-13 14:33:57 by hwloidl] · 1b28d4e1
      hwloidl authored
      Merged GUM-4-04 branch into the main trunk. In particular merged GUM and
      SMP code. Most of the GranSim code in GUM-4-04 still has to be carried over.
      1b28d4e1
  37. 20 Dec, 1999 1 commit
    • simonpj's avatar
      [project @ 1999-12-20 10:34:27 by simonpj] · e921b2e3
      simonpj authored
      This commit implements a substantial re-organisation of the Prelude
      It also fixes a couple of small renamer bugs that were reported recently
      	(notably, Sven pointed out that we weren't reporting
      	unused imports properly)
      
      My original goal was to get rid of all "orphan" modules (i.e. ones
      with instance decls that don't belong either to a tycon or a class
      defined in the same module).  This should reduce the number of
      interface files that have to be read when compiling small Haskell
      modules.
      
      But like most expeditions into the Prelude Swamp, it spiraled out
      of control.  The result is quite satisfactory, though.
      
      	GONE AWAY:	PrelCCall, PrelNumExtra
      
      	NEW:		PrelReal, PrelFloat, PrelByteArr, PrelNum.hi-boot
      
      (The extra PrelNum.hi-boot is because of a tiresome thin-air Id, addr2Integer,
      which used to be in PrelBase.)
      
      Quite a lot of types have moved from one module to another,
      which entails some changes to part of the compiler (PrelInfo, PrelMods) etc,
      and there are a few places in the RTS includes and even in the driver
      that know about these home modules (alas).
      
      So the rough structure is as follows, in (linearised) dependency order
      	[this list now appears in PrelBase.lhs]
      
      PrelGHC		Has no implementation.  It defines built-in things, and
      		by importing it you bring them into scope.
      		The source file is PrelGHC.hi-boot, which is just
      		copied to make PrelGHC.hi
      
      		Classes: CCallable, CReturnable
      
      PrelBase	Classes: Eq, Ord, Functor, Monad
      		Types:   list, (), Int, Bool, Ordering, Char, String
      
      PrelTup		Types: tuples, plus instances for PrelBase classes
      
      PrelShow	Class: Show, plus instances for PrelBase/PrelTup types
      
      PrelEnum	Class: Enum,  plus instances for PrelBase/PrelTup types
      
      PrelMaybe	Type: Maybe, plus instances for PrelBase classes
      
      PrelNum		Class: Num, plus instances for Int
      		Type:  Integer, plus instances for all classes so far (Eq, Ord, Num, Show)
      
      		Integer is needed here because it is mentioned in the signature
      		of 'fromInteger' in class Num
      
      PrelReal	Classes: Real, Integral, Fractional, RealFrac
      			 plus instances for Int, Integer
      		Types:  Ratio, Rational
      			plus intances for classes so far
      
      		Rational is needed here because it is mentioned in the signature
      		of 'toRational' in class Real
      
      Ix		Classes: Ix, plus instances for Int, Bool, Char, Integer, Ordering, tuples
      
      PrelArr		Types: Array, MutableArray, MutableVar
      
      		Does *not* contain any ByteArray stuff (see PrelByteArr)
      		Arrays are used by a function in PrelFloat
      
      PrelFloat	Classes: Floating, RealFloat
      		Types:   Float, Double, plus instances of all classes so far
      
      		This module contains everything to do with floating point.
      		It is a big module (900 lines)
      		With a bit of luck, many modules can be compiled without ever reading PrelFloat.hi
      
      PrelByteArr	Types: ByteArray, MutableByteArray
      
      		We want this one to be after PrelFloat, because it defines arrays
      		of unboxed floats.
      
      
      Other Prelude modules are much easier with fewer complex dependencies.
      e921b2e3