make arena extent allocator more flexible
commitbd19dcc7462751161fb8d8b4596c555bb16bb8a1
authorBin Liu <binliu@fb.com>
Wed, 17 Apr 2019 14:20:34 +0000 (17 07:20 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 17 Apr 2019 14:38:40 +0000 (17 07:38 -0700)
tree38a9c5d57d8dbd126becf1572ace831ffd47a4e8
parentd19e99b35ab13f5bf00ea844f83a4c2b37233839
make arena extent allocator more flexible

Summary:
Previously we create two arenas, each having its own address range and is bump allocated when feeding pages to jemalloc.  This diff rewrites the extent hooks and make it more flexible in two ways:

(1) allow bump allocation from both ends of the range, so that cold and hot data can be split easily.

(2) allow a M:N relation between arenas and address ranges, rather than the old 1:1 mapping; this makes it possible to split the low arena into two in a later diff, because some data are preferably allocated in lower 2G address space to allow the offset to be folded in the TC.

This diff doesn't really create more arenas or separate hot/cold data, but enables future diffs to do so easily.

Reviewed By: markw65

Differential Revision: D14869230

fbshipit-source-id: 3db3286d6552848dfe4158d2a7d2fd7be0ebc4a3
hphp/util/address-range.cpp [new file with mode: 0644]
hphp/util/address-range.h [new file with mode: 0644]
hphp/util/alloc.cpp
hphp/util/alloc.h
hphp/util/bump-mapper.cpp
hphp/util/bump-mapper.h
hphp/util/extent-hooks.cpp
hphp/util/extent-hooks.h
hphp/util/managed-arena.cpp
hphp/util/managed-arena.h