1. 27 Oct, 2005 4 commits
    • simonmar's avatar
      [project @ 2005-10-27 15:17:11 by simonmar] · 02019841
      simonmar authored
      unpark_tso: call unblockOne() instead of doing the job inline.  This
      properly migrates the thread, setting its task to point back to the
      right capability, if necessary.
      02019841
    • simonmar's avatar
      [project @ 2005-10-27 08:00:03 by simonmar] · 7f9c0373
      simonmar authored
      Fix getThreadLocalVar() on Win32 - thanks for Krasimir for finding the bug.
      7f9c0373
    • sof's avatar
      [project @ 2005-10-27 01:39:40 by sof] · 2909e6fb
      sof authored
      [mingw/msys only]
      Undo long-standing workaround for buggy GNU ld's on mingw/msys; i.e.,
      the linker wasn't correctly generating relocatable object files when
      the number of relocs exceeded 2^16. Worked around the issue by
      hackily splitting up the GHCi object file for the larger packages
      ('base', 'ObjectIO' and 'win32') into a handful of object files,
      each with a manageable number of relocs. Tiresome and error-prone
      (but the hack has served us well!)
      
      This commit imposes a restriction on the 'ld' you use to compile
      up GHC with; it now has to be ld-2.15.x or later (something GHC
      binary dists have shipped with since 6.2.2)
      2909e6fb
    • sof's avatar
      [project @ 2005-10-27 01:27:37 by sof] · 53068b73
      sof authored
      ocGetNames_PEi386(): fix bug in previous commit to this function;
      the correct .bss size for object files wasn't being passed to
      addProddableBlock().
      Not directly harmful, but triggers ASSERT() failure w/ DEBUG.
      
      Merge to STABLE.
      53068b73
  2. 26 Oct, 2005 10 commits
    • sof's avatar
      [project @ 2005-10-26 22:33:20 by sof] · b25ebcf6
      sof authored
      ASSERT_TASK_ID(): THREADED_RTS-only assert
      b25ebcf6
    • simonmar's avatar
      [project @ 2005-10-26 15:36:06 by simonmar] · 9348149e
      simonmar authored
      Package up the various properties of Capabilities/Tasks that we were
      asserting all over the place, and put them in a single macro
      ASSERT_CAPABILITY_INVARIANTS().
      9348149e
    • simonmar's avatar
      [project @ 2005-10-26 15:22:08 by simonmar] · d3cfe894
      simonmar authored
      The prev/next link fields in struct Capability_ aren't used
      d3cfe894
    • simonmar's avatar
      [project @ 2005-10-26 15:20:59 by simonmar] · 05fa9867
      simonmar authored
      - forkProcess fix: add a forgotten rts_unlock()
      - add a couple more ASSERTs
      05fa9867
    • simonpj's avatar
      [project @ 2005-10-26 14:53:30 by simonpj] · e8a78f0f
      simonpj authored
      awaitRequests: blocked_queue_tl was being set to NULL rather than
      END_TSO_QUEUE if the thread being removed was at the end of the queue.
      
      This bug has been in the code since 2003 - I have absolutely no idea
      why it hasn't manifested until today.
      e8a78f0f
    • simonmar's avatar
      [project @ 2005-10-26 13:58:40 by simonmar] · 4305e52b
      simonmar authored
      forkOS_createThreadWrapper: oops, better use the result from rts_evalStableIO()
      4305e52b
    • simonmar's avatar
      [project @ 2005-10-26 11:58:57 by simonmar] · 559295a0
      simonmar authored
      x86_64 fix: I was a bit sloppy before and assumed that the malloc()'d
      memory would be in the low 2Gb, so I could use 32-bit offset
      addressing.  It appears that this sometimes isn't the case, so do it
      properly and use 64-bit absolute addressing.
      559295a0
    • simonmar's avatar
      [project @ 2005-10-26 11:41:51 by simonmar] · 48d21c1f
      simonmar authored
      fix to previous change: allow workers to exit
      48d21c1f
    • simonmar's avatar
      [project @ 2005-10-26 10:42:54 by simonmar] · 7c82b4a8
      simonmar authored
      - change the type of StgRun(): now we return the Capability that the
        thread currently holds.  The return status of the thread is now
        stored in cap->r.rRet (a new slot in the reg table).
      
        This was necessary because on return from StgRun(), the current
        TSO may be blocked, so it no longer belongs to us.  If it is a bound
        thread, then the Task may have been already woken up on another
        Capability, so the scheduler can't use task->cap to find the
        capability it currently owns.
      
      - when shutting down, allow a bound thread to remove its TSO from
        the run queue when exiting (eliminates an error condition in
        releaseCapability()).
      7c82b4a8
    • simonpj's avatar
      [project @ 2005-10-26 08:41:32 by simonpj] · 7f59c72a
      simonpj authored
      Fix PUSH_ON_RUN_QUEUE bug on Win32
      7f59c72a
  3. 25 Oct, 2005 2 commits
    • simonmar's avatar
      [project @ 2005-10-25 15:27:22 by simonmar] · 1bc861a6
      simonmar authored
      Fix bug in allocateLocal, we weren't assigning bd->step properly
      1bc861a6
    • wolfgang's avatar
      [project @ 2005-10-25 02:57:47 by wolfgang] · ee6e44cc
      wolfgang authored
      Mac OS X/Darwin PowerPC: Fix a problem introduced by the recent Darwin/x86
      commit.
      
      Remember how we deliberately misaligned the .o file in memory to compensate
      for Mach-O's lax alignment rules.
      This should have been comitted along with Linker.c 1.203 about two weeks ago.
      ee6e44cc
  4. 24 Oct, 2005 2 commits
  5. 21 Oct, 2005 7 commits
    • simonmar's avatar
      [project @ 2005-10-21 15:23:59 by simonmar] · b587ed53
      simonmar authored
      more Win32 fixes
      b587ed53
    • simonmar's avatar
      [project @ 2005-10-21 15:14:06 by simonmar] · 9b6f67f3
      simonmar authored
      Fix Win32 build
      9b6f67f3
    • simonmar's avatar
      [project @ 2005-10-21 14:47:36 by simonmar] · 7bb59f38
      simonmar authored
      No need to import platform-specific stuff now.
      7bb59f38
    • simonmar's avatar
      [project @ 2005-10-21 14:45:59 by simonmar] · 685095d3
      simonmar authored
      Itimer.h has moved into posix/
      685095d3
    • simonmar's avatar
      [project @ 2005-10-21 14:42:47 by simonmar] · ce51bc83
      simonmar authored
      wibble
      ce51bc83
    • simonmar's avatar
      [project @ 2005-10-21 14:41:04 by simonmar] · 0b580ba0
      simonmar authored
      oops, remove old file
      0b580ba0
    • simonmar's avatar
      [project @ 2005-10-21 14:02:17 by simonmar] · 03a9ff01
      simonmar authored
      Big re-hash of the threaded/SMP runtime
      
      This is a significant reworking of the threaded and SMP parts of
      the runtime.  There are two overall goals here:
      
        - To push down the scheduler lock, reducing contention and allowing
          more parts of the system to run without locks.  In particular,
          the scheduler does not require a lock any more in the common case.
      
        - To improve affinity, so that running Haskell threads stick to the
          same OS threads as much as possible.
      
      At this point we have the basic structure working, but there are some
      pieces missing.  I believe it's reasonably stable - the important
      parts of the testsuite pass in all the (normal,threaded,SMP) ways.
      
      In more detail:
      
        - Each capability now has a run queue, instead of one global run
          queue.  The Capability and Task APIs have been completely
          rewritten; see Capability.h and Task.h for the details.
      
        - Each capability has its own pool of worker Tasks.  Hence, Haskell
          threads on a Capability's run queue will run on the same worker
          Task(s).  As long as the OS is doing something reasonable, this
          should mean they usually stick to the same CPU.  Another way to
          look at this is that we're assuming each Capability is associated
          with a fixed CPU.
      
        - What used to be StgMainThread is now part of the Task structure.
          Every OS thread in the runtime has an associated Task, and it
          can ask for its current Task at any time with myTask().
      
        - removed RTS_SUPPORTS_THREADS symbol, use THREADED_RTS instead
          (it is now defined for SMP too).
      
        - The RtsAPI has had to change; we must explicitly pass a Capability
          around now.  The previous interface assumed some global state.
          SchedAPI has also changed a lot.
      
        - The OSThreads API now supports thread-local storage, used to
          implement myTask(), although it could be done more efficiently
          using gcc's __thread extension when available.
      
        - I've moved some POSIX-specific stuff into the posix subdirectory,
          moving in the direction of separating out platform-specific
          implementations.
      
        - lots of lock-debugging and assertions in the runtime.  In particular,
          when DEBUG is on, we catch multiple ACQUIRE_LOCK()s, and there is
          also an ASSERT_LOCK_HELD() call.
      
      What's missing so far:
      
        - I have almost certainly broken the Win32 build, will fix soon.
      
        - any kind of thread migration or load balancing.  This is high up
          the agenda, though.
      
        - various performance tweaks to do
      
        - throwTo and forkProcess still do not work in SMP mode
      03a9ff01
  6. 20 Oct, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-10-20 11:45:19 by simonmar] · 4f0f4342
      simonmar authored
      changes to exitScheduler(): instead of waiting for all the tasks to
      stop, which is unreasonable, we just wait for the run queue to drain.
      This is much quicker, but not ideal (see comments).
      4f0f4342
  7. 19 Oct, 2005 1 commit
    • sof's avatar
      [project @ 2005-10-19 16:04:38 by sof] · 3d8a0867
      sof authored
      ocGetNames_PEi386(): correctly allocate .bss sections in relocatable
       object files. See commit for details; fixes misc GHCi crashes reported
       against 6.4.1.
      
      Merge to STABLE.
      3d8a0867
  8. 17 Oct, 2005 1 commit
  9. 14 Oct, 2005 1 commit
  10. 12 Oct, 2005 5 commits
  11. 24 Sep, 2005 1 commit
  12. 16 Sep, 2005 2 commits
  13. 13 Sep, 2005 2 commits
  14. 12 Sep, 2005 1 commit