From ed7472e0dd1b01bfd39d06b9ffcae6c45da7ea19 Mon Sep 17 00:00:00 2001 From: Sangheon Kim Date: Fri, 18 Mar 2016 21:01:28 -0700 Subject: [PATCH] 8152118: MinTLABSize should be less than TLAB max Add a constraint for MinTLABSize to be less than or equal to TLAB max Reviewed-by: brutisso, drwhite, jmasa --- .../share/vm/runtime/commandLineFlagConstraintsGC.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsGC.cpp b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsGC.cpp index 0f324acd010..2df34f81a5d 100644 --- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsGC.cpp +++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsGC.cpp @@ -606,9 +606,15 @@ Flag::Error MinTLABSizeConstraintFunc(size_t value, bool verbose) { "greater than or equal to reserved area in TLAB (" SIZE_FORMAT ")\n", value, ThreadLocalAllocBuffer::alignment_reserve_in_bytes()); return Flag::VIOLATES_CONSTRAINT; - } else { - return Flag::SUCCESS; } + if (value > (ThreadLocalAllocBuffer::max_size() * HeapWordSize)) { + CommandLineError::print(verbose, + "MinTLABSize (" SIZE_FORMAT ") must be " + "less than or equal to ergonomic TLAB maximum (" SIZE_FORMAT ")\n", + value, ThreadLocalAllocBuffer::max_size() * HeapWordSize); + return Flag::VIOLATES_CONSTRAINT; + } + return Flag::SUCCESS; } Flag::Error TLABSizeConstraintFunc(size_t value, bool verbose) {