RFR: 8244684: G1 abuses StarTask to also include partial objarray scan tasks

stefan.johansson at oracle.com stefan.johansson at oracle.com
Thu May 14 12:14:23 UTC 2020



On 2020-05-14 13:52, Kim Barrett wrote:
>> On May 12, 2020, at 6:26 AM, stefan.johansson at oracle.com wrote:
>> On 2020-05-11 20:11, Kim Barrett wrote:
>>> Please review this cleanup of the parallel task queue usage by G1 non-full
>>> collections.  It currently uses queues with StarTask elements, except not
>>> really. […]
>>> CR:
>>> https://bugs.openjdk.java.net/browse/JDK-8244684
>>> Webrev:
>>> https://cr.openjdk.java.net/~kbarrett/8244684/open.00/
>> Really nice cleanup. Looks good in general, just a few small things:
>>
>> gc/g1/g1ParScanThreadState.inline.hpp
>> ---
>> 139 void G1ParScanThreadState::steal_and_trim_queue(ScannerTasksQueueSet *task_queues) {
>> 140   ScannerTask stolen_task;
>> 141   while (task_queues->steal(_worker_id, stolen_task)) {
>> 142     verify_task(stolen_task);
>> 143     dispatch_task(stolen_task);
>>
>> First thing in dispatch_task() is verify_task() so this one on line 142 could be removed.
> 
> Done.
> 
>> ---
>>
>> gc/shared/taskqueue.hpp
>> ---
>> 570 class PartialArrayScanTask {
>> 571   void* _p;
>> ...
>> 578   oop to_source_array() const { return oop(_p); }
>>
>> I see no reason not to use oop instead of void* here and the getter could be obj() as in the ObjArrayTask above. If you don't like obj() or want it to be more like the ScannerTask, maybe to_obj() or to_array() is better.
> 
> I think I just made it void* for consistency with the other tasks.  But using oop here
> does seem better, so sure.  Done.
> 
> New webrevs:
> full: https://cr.openjdk.java.net/~kbarrett/8244684/open.01/
> incr: https://cr.openjdk.java.net/~kbarrett/8244684/open.01.inc/

Ship it!



More information about the hotspot-gc-dev mailing list