JDK-8159586 : Improve task queue steal protocol
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2016-06-15
  • Updated: 2022-06-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
In some micro-benchmarks, more than 50% of cpu time is spent in GenericTaskQueueSet::steal_best_of_2 due to evacuation threads repeatedly trying to steal when there is very little to steal, and being too eager about it.

Significant improvements can be shown by:
- reducing the number of steal attempts per steal round
- not trying to steal if the victim queue is almost empty as well (because then the next thing that happens is that the victim will try to steal immediately)
- if unsuccessful to steal (and at least some elements are in the queues), give up the CPU immediately instead of doing long active waiting (after looking if we can terminate)

Comments
Another option is to improve on backoff depending on amount of contention (e.g. after X unsuccessful steals) at a finer grain
22-06-2022

See also Michihiro Horie, Kazunori Ogata, Mikio Takeuchi, and Hiroshi Horii. 2019. Scaling up parallel GC work-stealing in many-core environments. In Proceedings of the 2019 ACM SIGPLAN International Symposium on Memory Management (ISMM 2019). ACM, New York, NY, USA, 27-40. DOI: https://doi.org/10.1145/3315573.3329985 for some additional ideas.
01-10-2019

One way to reduce steal attempts (or at least the time spent there) would probably be stealing of multiple entries (like 50%) as suggested in other libraries
25-01-2017