Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8145038

Simplify mut_process_buffer worker id management

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc
    • Resolved In Build:
      b105
    • CPU:
      generic
    • OS:
      generic

      Description

      DirtyCardQueueSet::mut_process_buffer uses a FreeIdSet to obtain a temporary worker id for the mutator thread. There's some complexity to deal with possibly already having an associated id. However, that complexity is all wasted code, since that situation never arises.

      The only use of JavaThread::get_claimed_par_id is here. The only uses of JavaThread::set_claimed_par_id are here. There are no other uses of the underlying JavaThread::_claimed_par_id. That field is initialized to UINT_MAX.

      If, on entry to mut_process_buffer, the thread's claimed id is UINT_MAX then the already_claimed case doesn't apply, and an attempt to allocate a new id will be made, with the result recorded in the field. [It used to be that the allocation could fail, returning UINT_MAX in that case. In the present code, allocation never fails, but this analysis doesn't care about that distinction.]

      If an id was allocated, buffer processing occurs. Then, the id is released and the thread field reset to UINT_MAX, unless in the already_claimed case.

      So if the thread's recorded id was initially UINT_MAX, it will be reset to that value. Since UINT_MAX is the initial value,

      So there is no need for the already_claimed flag. Nor is there any need for the JavaThread::_claimed_par_id field.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                aharlap Alexander Harlap (Inactive)
                Reporter:
                kbarrett Kim Barrett
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: