RFR: 8259668: Make SubTasksDone use-once

Thomas Schatzl tschatzl at openjdk.java.net
Thu Feb 4 15:06:40 UTC 2021


On Wed, 3 Feb 2021 16:26:33 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> After JDK-8260574, a instance of `SubTasksDone` is never reused, so part of its APIs could be revised: `clear()` and the code calling it is removed.
> 
> With this patch, `all_tasks_completed` contains only assertion. Kim suggested moving this assertion logic to `~SubTasksDone`, but that could defer the assertion violation. For example, in the case of `G1FullGCMarkTask::work`, there is a significant amount of code running btw the instance when all subtasks are claimed (where `all_tasks_completed` is called in this PR) and `~SubTasksDone`. In the interest of having more precise location where bugs may lie, I have kept `all_tasks_completed` in the original place. More comments on this are welcome.

Changes requested by tschatzl (Reviewer).

src/hotspot/share/gc/shared/workgroup.hpp line 314:

> 312: 
> 313:   void all_tasks_completed_impl(uint skipped[], size_t skipped_size) {
> 314: #ifdef ASSERT

Please keep the definition of the method into the .cpp file. It's too long. You can use the DEBUG_ONLY macro here to not need to define it in non-assert code.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2383


More information about the hotspot-dev mailing list