JDK-8143352 : Enhance TLABWasteIncrement related codes to prevent an overflow
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2015-11-19
  • Updated: 2019-02-11
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 :  
Description
JDK-8142341 will add 'range' and 'constraint' for TLABWasteIncrement.
The reason for 'constraint' is to prevent an overflow at ThreadLocalAllocBuffer::record_slow_allocation() when adding refill_waste_limit() and refill_waste_limit_increment().
As this function would be called many times, we need to prevent an overflow at record_slow_allocation() as well.

Same work should be done places which calls ThreadLocalAllocBuffer::refill_waste_limit_increment() at each generated codes. (e.g.  MacroAssembler::tlab_refill() )
Comments
Something like below at ThreadLocalAllocBuffer::record_slow_allocation(): - set_refill_waste_limit(refill_waste_limit() + refill_waste_limit_increment()); + size_t new_waste_limit = refill_waste_limit(); + // Add refill_waste_limit_increment() only when _refill_waste_limit doesn't have an overflow. + if (new_waste_limit <= max_uintx - refill_waste_limit_increment()) { + new_waste_limit += refill_waste_limit_increment(); + } + set_refill_waste_limit(new_waste_limit);
19-11-2015