-
Enhancement
-
Resolution: Fixed
-
P4
-
24
-
master
In the current implementation, the location of the remembered set is established at compile time. We would have shorter time at init-mark safepoint in the current implementation if we could change the location of the remembered set within the init-mark safepoint. This would allow us to maintain two copies of the remembered set. We would:
1. Concurrently clear one copy of the remembered set prior to init-mark.
2. At init-mark safepoint, we would save a pointer to the existing remembered set and change the remembered set base to the newly cleared remembered set.
3. During concurrent marking, we would use the remembered set copy that was saved at init mark to guide our scanning of the remembered set. If pointers from old to young are found during remembered set scanning, we will mark these cards as dirty as in the existing implementation.
The main benefit of making this change for the current implementation is that it allows us to avoid copying and zeroing of the remembered set within the init-mark safepoint. Thus, we can shorten the typical time of this safepoint.
A second benefit of making this change is that it allows us to replace the init-mark safepoint with an init-mark handshake. *** This change will be implemented after this issue has been resolved. *** Under that new protocol, we plan that:
1. The second copy of the remembered set will be cleared before we trigger the init-mark handshake. We will remember the base address of the current remembered set.
2. In its handshake, each mutator thread will change its thread-local pointer to points to the newly cleared remembered set.
3. As each thread leaves its handshake, it will begin to dirty the newly cleared remembered set to represent the creation of any new pointers from old to young generations.
4. After all mutator threads have completed their handshake, we concurrently merge the current remembered set into the previously current remembered set. Then we use this previously current remembered set to guide remembered set scanning for the new concurrent marking effort.
This mechanism, which will require no further compiler/barrier changes, will allow us to eliminate the init-mark safepoint and replace it with an init-mark handshake.
At minimum, we desire support for x86 and aarch64. Support for additional architectures can be implemented after we prove value of this approach.
1. Concurrently clear one copy of the remembered set prior to init-mark.
2. At init-mark safepoint, we would save a pointer to the existing remembered set and change the remembered set base to the newly cleared remembered set.
3. During concurrent marking, we would use the remembered set copy that was saved at init mark to guide our scanning of the remembered set. If pointers from old to young are found during remembered set scanning, we will mark these cards as dirty as in the existing implementation.
The main benefit of making this change for the current implementation is that it allows us to avoid copying and zeroing of the remembered set within the init-mark safepoint. Thus, we can shorten the typical time of this safepoint.
A second benefit of making this change is that it allows us to replace the init-mark safepoint with an init-mark handshake. *** This change will be implemented after this issue has been resolved. *** Under that new protocol, we plan that:
1. The second copy of the remembered set will be cleared before we trigger the init-mark handshake. We will remember the base address of the current remembered set.
2. In its handshake, each mutator thread will change its thread-local pointer to points to the newly cleared remembered set.
3. As each thread leaves its handshake, it will begin to dirty the newly cleared remembered set to represent the creation of any new pointers from old to young generations.
4. After all mutator threads have completed their handshake, we concurrently merge the current remembered set into the previously current remembered set. Then we use this previously current remembered set to guide remembered set scanning for the new concurrent marking effort.
This mechanism, which will require no further compiler/barrier changes, will allow us to eliminate the init-mark safepoint and replace it with an init-mark handshake.
At minimum, we desire support for x86 and aarch64. Support for additional architectures can be implemented after we prove value of this approach.
- relates to
-
JDK-8351456 Build failure with --disable-jvm-feature-shenandoahgc after 8343468
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk/4e1367e3
-
Review(master) openjdk/jdk/23170