# HG changeset patch # User dholmes # Date 1368061606 14400 # Node ID c272092594bd24f5e283b5a89992a59e6f4e6e6c # Parent 39ead0411f07195ca9729e1028ff54bd4d9616b3# Parent 9b77ca4ce35e89e51db880fbfbbacff32d319117 Merge diff -r 39ead0411f07 -r c272092594bd src/share/vm/runtime/arguments.cpp --- a/src/share/vm/runtime/arguments.cpp Wed May 08 14:18:03 2013 -0700 +++ b/src/share/vm/runtime/arguments.cpp Wed May 08 21:06:46 2013 -0400 @@ -2088,6 +2088,26 @@ #endif } + // Need to limit the extent of the padding to reasonable size. + // 8K is well beyond the reasonable HW cache line size, even with the + // aggressive prefetching, while still leaving the room for segregating + // among the distinct pages. + if (ContendedPaddingWidth < 0 || ContendedPaddingWidth > 8192) { + jio_fprintf(defaultStream::error_stream(), + "ContendedPaddingWidth=" INTX_FORMAT " must be the between %d and %d\n", + ContendedPaddingWidth, 0, 8192); + status = false; + } + + // Need to enforce the padding not to break the existing field alignments. + // It is sufficient to check against the largest type size. + if ((ContendedPaddingWidth % BytesPerLong) != 0) { + jio_fprintf(defaultStream::error_stream(), + "ContendedPaddingWidth=" INTX_FORMAT " must be the multiple of %d\n", + ContendedPaddingWidth, BytesPerLong); + status = false; + } + return status; }