RFR: JDK-8307356: Metaspace: simplify BinList handling [v2]
Thomas Stuefe
stuefe at openjdk.org
Thu May 4 12:50:34 UTC 2023
> In preparation for Lilliput, I'd like to simplify BinList handling a bit.
>
> BinList are a data structure that stores small blocks that had been prematurely deallocated for re-use. Due to the way BinList is implemented we need the blocks to be at least two words. That causes ripples all across metaspace, including testing code. We can get rid of this complexity by shrinking a Block to just one word.
>
> ----
>
> Details:
>
> A BinList block before:
> ``` Block { Block* next; size_t size; }```
> A BinList block now:
> ``` Block { Block* next; }```
>
> We don't need to store the block size, since all blocks in a single sub list have the same size. In fact, we used the block size only for verification.
>
> That means that for 64-bit gross- and net-allocation size in Metaspace are the same (see `get_raw_word_size_for_requested_word_size`), which in turn will make writing tests that try to predict metaspace usage based on allocation pattern a lot less onerous to write.
Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
feedback roman
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/13776/files
- new: https://git.openjdk.org/jdk/pull/13776/files/31f44b61..3259f571
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=13776&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=13776&range=00-01
Stats: 12 lines in 4 files changed: 6 ins; 0 del; 6 mod
Patch: https://git.openjdk.org/jdk/pull/13776.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/13776/head:pull/13776
PR: https://git.openjdk.org/jdk/pull/13776
More information about the hotspot-runtime-dev
mailing list