diff -r 6114c49b31b5 -r 735c995bf1a1 src/share/vm/runtime/arguments.cpp --- a/src/share/vm/runtime/arguments.cpp Fri May 10 11:27:55 2013 -0700 +++ b/src/share/vm/runtime/arguments.cpp Mon May 13 07:53:45 2013 +0200 @@ -2100,6 +2100,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; } @@ -3097,36 +3117,27 @@ } void Arguments::set_shared_spaces_flags() { - const bool must_share = DumpSharedSpaces || RequireSharedSpaces; - const bool might_share = must_share || UseSharedSpaces; - - // CompressedOops cannot be used with CDS. The offsets of oopmaps and - // static fields are incorrect in the archive. With some more clever - // initialization, this restriction can probably be lifted. - // ??? UseLargePages might be okay now - const bool cannot_share = UseCompressedOops || - (UseLargePages && FLAG_IS_CMDLINE(UseLargePages)); - if (cannot_share) { - if (must_share) { - warning("disabling large pages %s" - "because of %s", "" LP64_ONLY("and compressed oops "), - DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on"); - FLAG_SET_CMDLINE(bool, UseLargePages, false); - LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedOops, false)); - LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedKlassPointers, false)); - } else { - // Prefer compressed oops and large pages to class data sharing - if (UseSharedSpaces && Verbose) { - warning("turning off use of shared archive because of large pages%s", - "" LP64_ONLY(" and/or compressed oops")); +#ifdef _LP64 + const bool must_share = DumpSharedSpaces || RequireSharedSpaces; + + // CompressedOops cannot be used with CDS. The offsets of oopmaps and + // static fields are incorrect in the archive. With some more clever + // initialization, this restriction can probably be lifted. + if (UseCompressedOops) { + if (must_share) { + warning("disabling compressed oops because of %s", + DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on"); + FLAG_SET_CMDLINE(bool, UseCompressedOops, false); + FLAG_SET_CMDLINE(bool, UseCompressedKlassPointers, false); + } else { + // Prefer compressed oops to class data sharing + if (UseSharedSpaces && Verbose) { + warning("turning off use of shared archive because of compressed oops"); + } + no_shared_spaces(); } - no_shared_spaces(); } - } else if (UseLargePages && might_share) { - // Disable large pages to allow shared spaces. This is sub-optimal, since - // there may not even be a shared archive to use. - FLAG_SET_DEFAULT(UseLargePages, false); - } +#endif if (DumpSharedSpaces) { if (RequireSharedSpaces) {