1. 03 May, 2014 1 commit
    • Sergei Trofimovich's avatar
      fix rts exported symbols base_GHCziIOziException_allocationLimitExceeded_closure · 54b31f74
      Sergei Trofimovich authored
      Commit  b0534f78
      
       added new exported rts symbols,
      but slightly misspelled them.
      
      Observer on first compiled program:
      > Linking dist/build/haskell-updater/haskell-updater ...
      > /usr/lib64/ghc-7.9.20140503/rts-1.0/libHSrts.a(Schedule.o): In function `scheduleWaitThread':
      > (.text+0xc4c): undefined reference to `base_GHCziIOziException_allocationLimitExceeded_closure'
      > /usr/lib64/ghc-7.9.20140503/rts-1.0/libHSrts.a(RtsStartup.o): In function `hs_init_ghc':
      > (.text+0x2fa): undefined reference to `base_GHCziIOziException_allocationLimitExceeded_closure'
      > collect2: error: ld returned 1 exit status
      
      CC: Simon Marlow <marlowsd@gmail.com>
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      54b31f74
  2. 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.
      b0534f78
  3. 29 Apr, 2014 7 commits
  4. 27 Apr, 2014 5 commits
  5. 22 Apr, 2014 1 commit
  6. 13 Apr, 2014 2 commits
  7. 07 Apr, 2014 2 commits
  8. 04 Apr, 2014 3 commits
  9. 01 Apr, 2014 1 commit
    • Simon Marlow's avatar
      Support thin archive format · 5d7f5901
      Simon Marlow authored
      This is a patch from FB's internal build of GHC that I'm pushing
      upstream.
      
      Author: Andrew Gallagher <agallagher@fb.com>
      
      This diff adds simple thin archive support to ghc's linker code, which
      basically just entails finding the member data from disk rather than
      from inside the archive (except for the case of the symbol index and
      gnu filename index, where the member data is still inline).
      5d7f5901
  10. 29 Mar, 2014 4 commits
    • tibbe's avatar
      Add more missing linker symbols · 4de517f5
      tibbe authored
      4de517f5
    • tibbe's avatar
      PrimOps.cmm: whitespace only · dd028509
      tibbe authored
      Harmonize the indentation amount. The file mixed 4, 2, and in some
      cases 3 spaces for indentation.
      dd028509
    • tibbe's avatar
      Add missing symbols to linker · 838bfb22
      tibbe authored
      The copy array family of primops were moved out-of-line.
      838bfb22
    • 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.
      90329b6c
  11. 28 Mar, 2014 1 commit
    • tibbe's avatar
      Make copy array ops out-of-line by default · e54828bf
      tibbe authored
      This should reduce code size when there's little to gain from inlining
      these primops, while still retaining the inlining benefit when the
      size of the copy is known statically.
      e54828bf
  12. 27 Mar, 2014 1 commit
  13. 22 Mar, 2014 1 commit
    • tibbe's avatar
      codeGen: inline allocation optimization for clone array primops · 1eece456
      tibbe authored
      The inline allocation version is 69% faster than the out-of-line
      version, when cloning an array of 16 unit elements on a 64-bit
      machine.
      
      Comparing the new and the old primop implementations isn't
      straightforward. The old version had a missing heap check that I
      discovered during the development of the new version. Comparing the
      old and the new version would requiring fixing the old version, which
      in turn means reimplementing the equivalent of MAYBE_CG in StgCmmPrim.
      
      The inline allocation threshold is configurable via
      -fmax-inline-alloc-size which gives the maximum array size, in bytes,
      to allocate inline. The size does not include the closure header size.
      
      Allowing the same primop to be either inline or out-of-line has some
      implication for how we lay out heap checks. We always place a heap
      check around out-of-line primops, as they may allocate outside of our
      knowledge. However, for the inline primops we only allow allocation
      via the standard means (i.e. virtHp). Since the clone primops might be
      either inline or out-of-line the heap check layout code now consults
      shouldInlinePrimOp to know whether a primop will be inlined.
      1eece456
  14. 21 Mar, 2014 1 commit
  15. 20 Mar, 2014 1 commit
    • tibbe's avatar
      Don't use gcptr for interior pointers · a6939ec2
      tibbe authored
      gcptr should only be used for pointers that the GC should
      follow. While this didn't cause any bugs right now, since these
      variables aren't live over a GC, it's clearer to use the right type.
      a6939ec2
  16. 13 Mar, 2014 2 commits
    • awson's avatar
      Fix incorrect maxStkSize calculation (#8858) · b99ace39
      awson authored
      
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      b99ace39
    • tibbe's avatar
      Fix two issues in stg_newArrayzh · 46d05ba0
      tibbe authored
      The implementations of newArray# and newArrayArray#, stg_newArrayzh
      and stg_newArrayArrayzh, had three issues:
      
       * The condition for the loop that fills the array with the initial
         element was incorrect. It would write into the card table as
         well. The condition for the loop that filled the card table was
         never executed, as its condition was also wrong. In the end this
         didn't lead to any disasters as the value of the card table doesn't
         matter for newly allocated arrays.
      
       * The card table was unnecessarily initialized. The card table is
         only used when the array isn't copied, which new arrays always
         are. By not writing the card table at all we save some cycles.
      
       * The ticky allocation accounting was wrong. The second argument to
         TICK_ALLOC_PRIM is the size of the closure excluding the header
         size, but the header size was incorrectly included.
      
      Fixes #8867.
      46d05ba0
  17. 27 Feb, 2014 2 commits
  18. 20 Feb, 2014 1 commit
  19. 17 Feb, 2014 3 commits