1. 02 May, 2014 1 commit
    • Simon Marlow's avatar
      Per-thread allocation counters and limits · b0534f78
      Simon Marlow authored
      This tracks the amount of memory allocation by each thread in a
      counter stored in the TSO.  Optionally, when the counter drops below
      zero (it counts down), the thread can be sent an asynchronous
      exception: AllocationLimitExceeded.  When this happens, given a small
      additional limit so that it can handle the exception.  See
      documentation in GHC.Conc for more details.
      Allocation limits are similar to timeouts, but
        - timeouts use real time, not CPU time.  Allocation limits do not
          count anything while the thread is blocked or in foreign code.
        - timeouts don't re-trigger if the thread catches the exception,
          allocation limits do.
        - timeouts can catch non-allocating loops, if you use
          -fno-omit-yields.  This doesn't work for allocation limits.
      I couldn't measure any impact on benchmarks with these changes, even
      for nofib/smp.
  2. 29 Apr, 2014 1 commit
    • Arash Rouhani's avatar
      Rts: Consistently use StgWord for sizes of bitmaps · 43b3bab3
      Arash Rouhani authored
      A long debate is in issue #8742, but the main motivation is that this
      allows for applying a patch to reuse the function scavenge_small_bitmap
      without changing the .o-file output.
      Similarly, I changed the types in rts/sm/Compact.c, so I can create
      a STATIC_INLINE function for the redundant code block:
              while (size > 0) {
                  if ((bitmap & 1) == 0) {
                      thread((StgClosure **)p);
                  bitmap = bitmap >> 1;
  3. 29 Mar, 2014 1 commit
    • tibbe's avatar
      Add SmallArray# and SmallMutableArray# types · 90329b6c
      tibbe authored
      These array types are smaller than Array# and MutableArray# and are
      faster when the array size is small, as they don't have the overhead
      of a card table. Having no card table reduces the closure size with 2
      words in the typical small array case and leads to less work when
      updating or GC:ing the array.
      Reduces both the runtime and memory allocation by 8.8% on my insert
      benchmark for the HashMap type in the unordered-containers package,
      which makes use of lots of small arrays. With tuned GC settings
      (i.e. `+RTS -A6M`) the runtime reduction is 15%.
      Fixes #8923.
  4. 13 Mar, 2014 1 commit
  5. 19 Jan, 2014 1 commit
  6. 04 Dec, 2013 2 commits
    • parcs's avatar
      Move the allocation of CAF blackholes into 'newCAF' (#8590) · 55c703b8
      parcs authored
      We now do the allocation of the blackhole indirection closure inside the
      RTS procedure 'newCAF' instead of generating the allocation code inline
      in the closure body of each CAF.  This slightly decreases code size in
      modules with a lot of CAFs.
      As a result of this change, for example, the size of DynFlags.o drops by
      ~60KB and HsExpr.o by ~100KB.
    • parcs's avatar
      Untab ClosureTypes.h and ClosureFlags.c · 4f603db2
      parcs authored
  7. 22 Nov, 2013 3 commits
  8. 21 Nov, 2013 2 commits
    • Simon Marlow's avatar
      Allow the linker to be used without retaining CAFs unconditionally · 5874f13f
      Simon Marlow authored
      This creates a new C API:
         initLinker_ (int retain_cafs)
      The old initLinker() was left as-is for backwards compatibility.  See
      documentation in Linker.h.
    • Simon Marlow's avatar
      In the DEBUG rts, track when CAFs are GC'd · e82fa829
      Simon Marlow authored
      This resurrects some old code and makes it work again.  The idea is
      that we want to get an error message if we ever enter a CAF that has
      been GC'd, rather than following its indirection which will likely
      cause a segfault.  Without this patch, these bugs are hard to track
      down in gdb, because the IND_STATIC code overwrites R1 (the pointer to
      the CAF) with its indirectee before jumping into bad memory, so we've
      lost the address of the CAF that got GC'd.
      Some associated refactoring while I was here.
  9. 25 Oct, 2013 3 commits
  10. 11 Oct, 2013 2 commits
  11. 01 Oct, 2013 1 commit
  12. 23 Sep, 2013 3 commits
  13. 15 Sep, 2013 1 commit
  14. 08 Sep, 2013 2 commits
  15. 04 Sep, 2013 1 commit
  16. 06 Aug, 2013 1 commit
  17. 16 Jul, 2013 1 commit
  18. 10 Jul, 2013 1 commit
  19. 09 Jul, 2013 1 commit
  20. 22 Jun, 2013 1 commit
  21. 15 Jun, 2013 3 commits
  22. 14 Jun, 2013 1 commit
  23. 08 Jun, 2013 1 commit
  24. 21 May, 2013 1 commit
  25. 19 May, 2013 1 commit
  26. 17 May, 2013 1 commit
  27. 29 Mar, 2013 1 commit
    • nfrisby's avatar
      ticky enhancements · 460abd75
      nfrisby authored
        * the new StgCmmArgRep module breaks a dependency cycle; I also
          untabified it, but made no real changes
        * updated the documentation in the wiki and change the user guide to
          point there
        * moved the allocation enters for ticky and CCS to after the heap check
          * I left LDV where it was, which was before the heap check at least
            once, since I have no idea what it is
        * standardized all (active?) ticky alloc totals to bytes
        * in order to avoid double counting StgCmmLayout.adjustHpBackwards
          no longer bumps ALLOC_HEAP_ctr
        * I resurrected the SLOW_CALL counters
          * the new module StgCmmArgRep breaks cyclic dependency between
            Layout and Ticky (which the SLOW_CALL counters cause)
          * renamed them SLOW_CALL_fast_<pattern> and VERY_SLOW_CALL
        * added ALLOC_RTS_ctr and _tot ticky counters
          * eg allocation by Storage.c:allocate or a BUILD_PAP in stg_ap_*_info
          * resurrected ticky counters for ALLOC_THK, ALLOC_PAP, and
          * added -ticky and -DTICKY_TICKY in ways.mk for debug ways
        * added a ticky counter for total LNE entries
        * new flags for ticky: -ticky-allocd -ticky-dyn-thunk -ticky-LNE
          * all off by default
          * -ticky-allocd: tracks allocation *of* closure in addition to
             allocation *by* that closure
          * -ticky-dyn-thunk tracks dynamic thunks as if they were functions
          * -ticky-LNE tracks LNEs as if they were functions
        * updated the ticky report format, including making the argument
          categories (more?) accurate again
        * the printed name for things in the report include the unique of
          their ticky parent as well as if they are not top-level
  28. 07 Mar, 2013 1 commit