Mon, 04 Feb 2013 12:51:25 -0800
Merge
src/share/vm/runtime/vmStructs.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java Mon Feb 04 12:01:07 2013 -0800 1.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java Mon Feb 04 12:51:25 2013 -0800 1.3 @@ -467,7 +467,7 @@ 1.4 liveRegions.add(tlab.start()); 1.5 liveRegions.add(tlab.start()); 1.6 liveRegions.add(tlab.top()); 1.7 - liveRegions.add(tlab.end()); 1.8 + liveRegions.add(tlab.hardEnd()); 1.9 } 1.10 } 1.11 }
2.1 --- a/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java Mon Feb 04 12:01:07 2013 -0800 2.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java Mon Feb 04 12:51:25 2013 -0800 2.3 @@ -27,6 +27,7 @@ 2.4 import java.io.*; 2.5 import java.util.*; 2.6 import sun.jvm.hotspot.debugger.*; 2.7 +import sun.jvm.hotspot.oops.*; 2.8 import sun.jvm.hotspot.types.*; 2.9 2.10 /** <P> ThreadLocalAllocBuffer: a descriptor for thread-local storage 2.11 @@ -62,9 +63,22 @@ 2.12 super(addr); 2.13 } 2.14 2.15 - public Address start() { return startField.getValue(addr); } 2.16 - public Address end() { return endField.getValue(addr); } 2.17 - public Address top() { return topField.getValue(addr); } 2.18 + public Address start() { return startField.getValue(addr); } 2.19 + public Address end() { return endField.getValue(addr); } 2.20 + public Address top() { return topField.getValue(addr); } 2.21 + public Address hardEnd() { return end().addOffsetTo(alignmentReserve()); } 2.22 + 2.23 + private long alignmentReserve() { 2.24 + return Oop.alignObjectSize(endReserve()); 2.25 + } 2.26 + 2.27 + private long endReserve() { 2.28 + long minFillerArraySize = Array.baseOffsetInBytes(BasicType.T_INT); 2.29 + long reserveForAllocationPrefetch = VM.getVM().getReserveForAllocationPrefetch(); 2.30 + long heapWordSize = VM.getVM().getHeapWordSize(); 2.31 + 2.32 + return Math.max(minFillerArraySize, reserveForAllocationPrefetch * heapWordSize); 2.33 + } 2.34 2.35 /** Support for iteration over heap -- not sure how this will 2.36 interact with GC in reflective system, but necessary for the
3.1 --- a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Mon Feb 04 12:01:07 2013 -0800 3.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Mon Feb 04 12:51:25 2013 -0800 3.3 @@ -114,6 +114,7 @@ 3.4 private int invalidOSREntryBCI; 3.5 private ReversePtrs revPtrs; 3.6 private VMRegImpl vmregImpl; 3.7 + private int reserveForAllocationPrefetch; 3.8 3.9 // System.getProperties from debuggee VM 3.10 private Properties sysProps; 3.11 @@ -293,6 +294,10 @@ 3.12 vmRelease = CStringUtilities.getString(releaseAddr); 3.13 Address vmInternalInfoAddr = vmVersion.getAddressField("_s_internal_vm_info_string").getValue(); 3.14 vmInternalInfo = CStringUtilities.getString(vmInternalInfoAddr); 3.15 + 3.16 + CIntegerType intType = (CIntegerType) db.lookupType("int"); 3.17 + CIntegerField reserveForAllocationPrefetchField = vmVersion.getCIntegerField("_reserve_for_allocation_prefetch"); 3.18 + reserveForAllocationPrefetch = (int)reserveForAllocationPrefetchField.getCInteger(intType); 3.19 } catch (Exception exp) { 3.20 throw new RuntimeException("can't determine target's VM version : " + exp.getMessage()); 3.21 } 3.22 @@ -778,6 +783,10 @@ 3.23 return vmInternalInfo; 3.24 } 3.25 3.26 + public int getReserveForAllocationPrefetch() { 3.27 + return reserveForAllocationPrefetch; 3.28 + } 3.29 + 3.30 public boolean isSharingEnabled() { 3.31 if (sharingEnabled == null) { 3.32 Flag flag = getCommandLineFlag("UseSharedSpaces");
4.1 --- a/src/share/vm/gc_implementation/g1/concurrentMark.cpp Mon Feb 04 12:01:07 2013 -0800 4.2 +++ b/src/share/vm/gc_implementation/g1/concurrentMark.cpp Mon Feb 04 12:51:25 2013 -0800 4.3 @@ -571,19 +571,14 @@ 4.4 _sleep_factor = 0.0; 4.5 _marking_task_overhead = 1.0; 4.6 } else { 4.7 - if (ConcGCThreads > 0) { 4.8 - // notice that ConcGCThreads overwrites G1MarkingOverheadPercent 4.9 + if (!FLAG_IS_DEFAULT(ConcGCThreads) && ConcGCThreads > 0) { 4.10 + // Note: ConcGCThreads has precedence over G1MarkingOverheadPercent 4.11 // if both are set 4.12 - 4.13 - _parallel_marking_threads = (uint) ConcGCThreads; 4.14 - _max_parallel_marking_threads = _parallel_marking_threads; 4.15 _sleep_factor = 0.0; 4.16 _marking_task_overhead = 1.0; 4.17 } else if (G1MarkingOverheadPercent > 0) { 4.18 - // we will calculate the number of parallel marking threads 4.19 - // based on a target overhead with respect to the soft real-time 4.20 - // goal 4.21 - 4.22 + // We will calculate the number of parallel marking threads based 4.23 + // on a target overhead with respect to the soft real-time goal 4.24 double marking_overhead = (double) G1MarkingOverheadPercent / 100.0; 4.25 double overall_cm_overhead = 4.26 (double) MaxGCPauseMillis * marking_overhead / 4.27 @@ -596,17 +591,22 @@ 4.28 double sleep_factor = 4.29 (1.0 - marking_task_overhead) / marking_task_overhead; 4.30 4.31 - _parallel_marking_threads = (uint) marking_thread_num; 4.32 - _max_parallel_marking_threads = _parallel_marking_threads; 4.33 + FLAG_SET_ERGO(uintx, ConcGCThreads, (uint) marking_thread_num); 4.34 _sleep_factor = sleep_factor; 4.35 _marking_task_overhead = marking_task_overhead; 4.36 } else { 4.37 - _parallel_marking_threads = scale_parallel_threads((uint)ParallelGCThreads); 4.38 - _max_parallel_marking_threads = _parallel_marking_threads; 4.39 + // Calculate the number of parallel marking threads by scaling 4.40 + // the number of parallel GC threads. 4.41 + uint marking_thread_num = scale_parallel_threads((uint) ParallelGCThreads); 4.42 + FLAG_SET_ERGO(uintx, ConcGCThreads, marking_thread_num); 4.43 _sleep_factor = 0.0; 4.44 _marking_task_overhead = 1.0; 4.45 } 4.46 4.47 + assert(ConcGCThreads > 0, "Should have been set"); 4.48 + _parallel_marking_threads = (uint) ConcGCThreads; 4.49 + _max_parallel_marking_threads = _parallel_marking_threads; 4.50 + 4.51 if (parallel_marking_threads() > 1) { 4.52 _cleanup_task_overhead = 1.0; 4.53 } else {
5.1 --- a/src/share/vm/memory/metaspace.cpp Mon Feb 04 12:01:07 2013 -0800 5.2 +++ b/src/share/vm/memory/metaspace.cpp Mon Feb 04 12:51:25 2013 -0800 5.3 @@ -1737,10 +1737,10 @@ 5.4 *class_chunk_word_size = ClassSmallChunk; 5.5 break; 5.6 } 5.7 - assert(chunk_word_size != 0 && class_chunk_word_size != 0, 5.8 + assert(*chunk_word_size != 0 && *class_chunk_word_size != 0, 5.9 err_msg("Initial chunks sizes bad: data " SIZE_FORMAT 5.10 " class " SIZE_FORMAT, 5.11 - chunk_word_size, class_chunk_word_size)); 5.12 + *chunk_word_size, *class_chunk_word_size)); 5.13 } 5.14 5.15 size_t SpaceManager::sum_free_in_chunks_in_use() const { 5.16 @@ -2040,7 +2040,7 @@ 5.17 align_size_up(humongous_chunks->word_size(), 5.18 HumongousChunkGranularity), 5.19 err_msg("Humongous chunk size is wrong: word size " SIZE_FORMAT 5.20 - " granularity " SIZE_FORMAT, 5.21 + " granularity %d", 5.22 humongous_chunks->word_size(), HumongousChunkGranularity)); 5.23 Metachunk* next_humongous_chunks = humongous_chunks->next(); 5.24 chunk_manager->humongous_dictionary()->return_chunk(humongous_chunks); 5.25 @@ -2264,7 +2264,8 @@ 5.26 } 5.27 MutexLockerEx cl(lock(), Mutex::_no_safepoint_check_flag); 5.28 assert(allocation_total() == sum_used_in_chunks_in_use(), 5.29 - err_msg("allocation total is not consistent %d vs %d", 5.30 + err_msg("allocation total is not consistent " SIZE_FORMAT 5.31 + " vs " SIZE_FORMAT, 5.32 allocation_total(), sum_used_in_chunks_in_use())); 5.33 } 5.34 5.35 @@ -2578,7 +2579,8 @@ 5.36 // argument passed in is at the top of the compressed space 5.37 void Metaspace::initialize_class_space(ReservedSpace rs) { 5.38 // The reserved space size may be bigger because of alignment, esp with UseLargePages 5.39 - assert(rs.size() >= ClassMetaspaceSize, err_msg("%d != %d", rs.size(), ClassMetaspaceSize)); 5.40 + assert(rs.size() >= ClassMetaspaceSize, 5.41 + err_msg(SIZE_FORMAT " != " UINTX_FORMAT, rs.size(), ClassMetaspaceSize)); 5.42 _class_space_list = new VirtualSpaceList(rs); 5.43 } 5.44
6.1 --- a/src/share/vm/runtime/vmStructs.cpp Mon Feb 04 12:01:07 2013 -0800 6.2 +++ b/src/share/vm/runtime/vmStructs.cpp Mon Feb 04 12:51:25 2013 -0800 6.3 @@ -1161,6 +1161,7 @@ 6.4 static_field(Abstract_VM_Version, _vm_major_version, int) \ 6.5 static_field(Abstract_VM_Version, _vm_minor_version, int) \ 6.6 static_field(Abstract_VM_Version, _vm_build_number, int) \ 6.7 + static_field(Abstract_VM_Version, _reserve_for_allocation_prefetch, int) \ 6.8 \ 6.9 static_field(JDK_Version, _current, JDK_Version) \ 6.10 nonstatic_field(JDK_Version, _partially_initialized, bool) \