comparison src/share/vm/runtime/arguments.cpp @ 10260:711016f146fd

8006997: ContendedPaddingWidth should be range-checked Summary: Constrain between zero and 8K Reviewed-by: dholmes, rbackman Contributed-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
author dholmes
date Wed, 08 May 2013 19:28:54 -0400
parents e01e02a9fcb6
children 9b77ca4ce35e
comparison
equal deleted inserted replaced
10232:7243490a6847 10260:711016f146fd
2084 warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled"); 2084 warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled");
2085 PrintNMTStatistics = false; 2085 PrintNMTStatistics = false;
2086 #if INCLUDE_NMT 2086 #if INCLUDE_NMT
2087 } 2087 }
2088 #endif 2088 #endif
2089 }
2090
2091 // Need to limit the extent of the padding to reasonable size.
2092 // 8K is well beyond the reasonable HW cache line size, even with the
2093 // aggressive prefetching, while still leaving the room for segregating
2094 // among the distinct pages.
2095 if (ContendedPaddingWidth < 0 || ContendedPaddingWidth > 8192) {
2096 jio_fprintf(defaultStream::error_stream(),
2097 "ContendedPaddingWidth=" INTX_FORMAT " must be the between %d and %d\n",
2098 ContendedPaddingWidth, 0, 8192);
2099 status = false;
2100 }
2101
2102 // Need to enforce the padding not to break the existing field alignments.
2103 // It is sufficient to check against the largest type size.
2104 if ((ContendedPaddingWidth % BytesPerLong) != 0) {
2105 jio_fprintf(defaultStream::error_stream(),
2106 "ContendedPaddingWidth=" INTX_FORMAT " must be the multiple of %d\n",
2107 ContendedPaddingWidth, BytesPerLong);
2108 status = false;
2089 } 2109 }
2090 2110
2091 return status; 2111 return status;
2092 } 2112 }
2093 2113