RFR: 8280438: Improve BufferNode::Allocator::release to avoid walking pending list [v3]
Kim Barrett
kbarrett at openjdk.java.net
Wed Feb 9 04:42:58 UTC 2022
> Please review this change to BufferNode::Allocator::release to avoid needing
> to walk the pending list in preparation for transferring it to the free list.
> We need to have both the head and the tail of the pending list to perform that
> transfer.
>
> Rather than using a LockFreeStack to accumulate the pending list, we now use a
> bespoke data structure that only supports concurrent additions, since that's
> all we need. This simplifies the code, and also makes it easy to capture the
> first pushed node as the tail.
>
> To make the transfer from the pending list to the free list, we double-buffer
> the pending list. Additions are made to the currently active pending list. A
> transfer flips which pending list is active, and transfers from the list that
> was just deactivated. Additions are made in a critical section. The critical
> section synchronization already performed when transferring now does double
> duty, also synchronizing the pending list flip.
>
> Testing:
> mach5 tier1-3
>
> Ran a test with -Xlog:gc,ptrqueue,freelist and verified transfers were
> occurring as expected.
Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
- Merge branch 'master' into buffer_release
- update copyrights
- change _pending_lists init for compiler bug workaround
- double-buffer pending list
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/7210/files
- new: https://git.openjdk.java.net/jdk/pull/7210/files/70c52abb..b08a9cf6
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7210&range=02
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7210&range=01-02
Stats: 15843 lines in 685 files changed: 10584 ins; 2771 del; 2488 mod
Patch: https://git.openjdk.java.net/jdk/pull/7210.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/7210/head:pull/7210
PR: https://git.openjdk.java.net/jdk/pull/7210
More information about the hotspot-gc-dev
mailing list