rts: Make MBLOCK_SPACE_SIZE dynamic
ClosedPublic

Authored by bgamari on Oct 22 2015, 2:31 PM.

Details

Summary

Previously this was introduced in D524 as a compile-time constant. Sadly, this isn't flexible
enough to allow for environments where ulimits restrict the maximum
address space size (see, for instance, Trac #10877).

Consequently, we are forced to make this dynamic. In principle this
shouldn't be so terrible as we can place both the beginning and end
addresses within the same cache line, likely incurring only one or so
additional instruction in HEAP_ALLOCED.

Test Plan

validate

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bgamari retitled this revision from to rts: Make MBLOCK_SPACE_SIZE dynamic.Oct 22 2015, 2:31 PM
bgamari updated this object.
bgamari edited the test plan for this revision. (Show Details)
bgamari added a reviewer: simonmar.
bgamari updated the Trac tickets for this revision.
simonmar added inline comments.Oct 22 2015, 3:16 PM
rts/sm/HeapAlloc.h
53–58

Suggest putting these in a struct with enough padding to fill up a cache line. We really really don't want these sharing a cache line with anything else. See GCThread.h where we play similar tricks.

bgamari updated this revision to Diff 4611.Oct 23 2015, 3:40 AM

Prevent false sharing

bgamari marked an inline comment as done.Oct 23 2015, 3:41 AM
bgamari added inline comments.
rts/sm/HeapAlloc.h
53–59

Done.

bgamari updated this revision to Diff 4623.Oct 23 2015, 4:20 AM
bgamari marked an inline comment as done.

Fix

simonmar accepted this revision.Oct 28 2015, 6:43 PM

Looks good to go.

This revision is now accepted and ready to land.Oct 28 2015, 6:43 PM
austin accepted this revision.Oct 30 2015, 3:32 PM

Seems fine to me, maybe after this we can add an RTS option to control it as well for more explicit scenarios (aside from what D1405 offers).

This revision was automatically updated to reflect the committed changes.