From a71320f229612017af9340810ba3345f28c32bd4 Mon Sep 17 00:00:00 2001 From: John Cuthbertson Date: Fri, 2 Dec 2011 12:39:23 -0800 Subject: [PATCH 1/4] 7114095: G1: assert(obj == oopDesc::load_decode_heap_oop(p)) failed: p should still be pointing to obj As a result of the changes for 4965777, the G1 reference field scanning closure could be applied to the discovered field of a reference object twice. The failing assert is too strong if the result of the first application of the closure is stolen, and the referenced object, evacuated by another worker thread. Reviewed-by: ysr, tonyp --- .../share/vm/gc_implementation/g1/g1OopClosures.inline.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp index ed01774c4a7..26b951d961f 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp @@ -84,8 +84,11 @@ template inline void G1ParScanClosure::do_oop_nv(T* p) { // slightly paranoid test; I'm trying to catch potential // problems before we go into push_on_queue to know where the // problem is coming from - assert(obj == oopDesc::load_decode_heap_oop(p), - "p should still be pointing to obj"); + assert((obj == oopDesc::load_decode_heap_oop(p)) || + (obj->is_forwarded() && + obj->forwardee() == oopDesc::load_decode_heap_oop(p)), + "p should still be pointing to obj or to its forwardee"); + _par_scan_state->push_on_queue(p); } else { _par_scan_state->update_rs(_from, p, _par_scan_state->queue_num()); From fcdf022370258afa313eb2312b9800aaef538f28 Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Mon, 28 Nov 2011 10:19:26 +0100 Subject: [PATCH 2/4] 7112034: Parallel CMS fails to properly mark reference objects Enabled reference processing when work stealing during concurrent marking Reviewed-by: jmasa, brutisso --- .../concurrentMarkSweep/concurrentMarkSweepGeneration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp index 84b6d640a09..bff5b40ab9a 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @@ -4052,7 +4052,7 @@ class Par_ConcMarkingClosure: public Par_KlassRememberingOopClosure { Par_ConcMarkingClosure(CMSCollector* collector, CMSConcMarkingTask* task, OopTaskQueue* work_queue, CMSBitMap* bit_map, CMSMarkStack* overflow_stack, CMSMarkStack* revisit_stack): - Par_KlassRememberingOopClosure(collector, NULL, revisit_stack), + Par_KlassRememberingOopClosure(collector, collector->ref_processor(), revisit_stack), _task(task), _span(collector->_span), _work_queue(work_queue), From 78d7be03bfbd5e08193c059c93df0dd6596270d1 Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Mon, 28 Nov 2011 14:58:31 +0100 Subject: [PATCH 3/4] 7116081: USE_PRECOMPILED_HEADER=0 triggers a single threaded build of the JVM Changed the conditional to see if the precompiled header has been specified. Also, removed the unused PrecompiledOption. Reviewed-by: dholmes, brutisso --- hotspot/make/bsd/makefiles/gcc.make | 3 +-- hotspot/make/bsd/makefiles/top.make | 8 +++----- hotspot/make/linux/makefiles/gcc.make | 3 +-- hotspot/make/linux/makefiles/top.make | 8 +++----- hotspot/make/solaris/makefiles/gcc.make | 3 +-- 5 files changed, 9 insertions(+), 16 deletions(-) diff --git a/hotspot/make/bsd/makefiles/gcc.make b/hotspot/make/bsd/makefiles/gcc.make index 62148457083..c54433e32c4 100644 --- a/hotspot/make/bsd/makefiles/gcc.make +++ b/hotspot/make/bsd/makefiles/gcc.make @@ -86,7 +86,6 @@ CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2) ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0" # Allow the user to turn off precompiled headers from the command line. ifneq ($(USE_PRECOMPILED_HEADER),0) -USE_PRECOMPILED_HEADER=1 PRECOMPILED_HEADER_DIR=. PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch @@ -216,7 +215,7 @@ DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d) endif # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp. -ifneq ($(USE_PRECOMPILED_HEADER),1) +ifeq ($(USE_PRECOMPILED_HEADER),0) CFLAGS += -DDONT_USE_PRECOMPILED_HEADER endif diff --git a/hotspot/make/bsd/makefiles/top.make b/hotspot/make/bsd/makefiles/top.make index f85d196490a..7b237c467d7 100644 --- a/hotspot/make/bsd/makefiles/top.make +++ b/hotspot/make/bsd/makefiles/top.make @@ -47,12 +47,10 @@ VM = $(GAMMADIR)/src/share/vm Plat_File = $(Platform_file) CDG = cd $(GENERATED); -ifdef USE_PRECOMPILED_HEADER -PrecompiledOption = -DUSE_PRECOMPILED_HEADER -UpdatePCH = $(MAKE) -f vm.make $(PRECOMPILED_HEADER) $(MFLAGS) +ifneq ($(USE_PRECOMPILED_HEADER),0) +UpdatePCH = $(MAKE) -f vm.make $(PRECOMPILED_HEADER) $(MFLAGS) else -UpdatePCH = \# precompiled header is not used -PrecompiledOption = +UpdatePCH = \# precompiled header is not used endif Cached_plat = $(GENERATED)/platform.current diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make index 2da52739b6a..ba5206c9080 100644 --- a/hotspot/make/linux/makefiles/gcc.make +++ b/hotspot/make/linux/makefiles/gcc.make @@ -50,7 +50,6 @@ CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2) ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0" # Allow the user to turn off precompiled headers from the command line. ifneq ($(USE_PRECOMPILED_HEADER),0) -USE_PRECOMPILED_HEADER=1 PRECOMPILED_HEADER_DIR=. PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch @@ -165,7 +164,7 @@ DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d) endif # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp. -ifneq ($(USE_PRECOMPILED_HEADER),1) +ifeq ($(USE_PRECOMPILED_HEADER),0) CFLAGS += -DDONT_USE_PRECOMPILED_HEADER endif diff --git a/hotspot/make/linux/makefiles/top.make b/hotspot/make/linux/makefiles/top.make index 1b674dce957..d89f8ff75d2 100644 --- a/hotspot/make/linux/makefiles/top.make +++ b/hotspot/make/linux/makefiles/top.make @@ -47,12 +47,10 @@ VM = $(GAMMADIR)/src/share/vm Plat_File = $(Platform_file) CDG = cd $(GENERATED); -ifdef USE_PRECOMPILED_HEADER -PrecompiledOption = -DUSE_PRECOMPILED_HEADER -UpdatePCH = $(MAKE) -f vm.make $(PRECOMPILED_HEADER) $(MFLAGS) +ifneq ($(USE_PRECOMPILED_HEADER),0) +UpdatePCH = $(MAKE) -f vm.make $(PRECOMPILED_HEADER) $(MFLAGS) else -UpdatePCH = \# precompiled header is not used -PrecompiledOption = +UpdatePCH = \# precompiled header is not used endif Cached_plat = $(GENERATED)/platform.current diff --git a/hotspot/make/solaris/makefiles/gcc.make b/hotspot/make/solaris/makefiles/gcc.make index 15e43ea8d66..37257491b07 100644 --- a/hotspot/make/solaris/makefiles/gcc.make +++ b/hotspot/make/solaris/makefiles/gcc.make @@ -49,7 +49,6 @@ $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2) ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0" # Allow the user to turn off precompiled headers from the command line. ifneq ($(USE_PRECOMPILED_HEADER),0) -USE_PRECOMPILED_HEADER=1 PRECOMPILED_HEADER_DIR=. PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch @@ -142,7 +141,7 @@ DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d) endif # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp. -ifneq ($(USE_PRECOMPILED_HEADER),1) +ifeq ($(USE_PRECOMPILED_HEADER),0) CFLAGS += -DDONT_USE_PRECOMPILED_HEADER endif From 4799ed65a40751fe6dc3fe1da47561fd72575c56 Mon Sep 17 00:00:00 2001 From: Antonios Printezis Date: Wed, 7 Dec 2011 12:54:51 -0500 Subject: [PATCH 4/4] 7118202: G1: eden size unnecessarily drops to a minimum An integer underflow can cause the RSet lengths to be massively overpredicted which forces the eden size to the minimum. Reviewed-by: brutisso, johnc --- .../vm/gc_implementation/g1/g1CollectorPolicy.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp index caca2905e56..2ed1cc8a8bb 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @@ -1549,9 +1549,15 @@ void G1CollectorPolicy::record_collection_pause_end(int no_of_gc_threads) { _partially_young_cards_per_entry_ratio_seq->add(cards_per_entry_ratio); } - size_t rs_length_diff = _max_rs_lengths - _recorded_rs_lengths; - if (rs_length_diff >= 0) - _rs_length_diff_seq->add((double) rs_length_diff); + // It turns out that, sometimes, _max_rs_lengths can get smaller + // than _recorded_rs_lengths which causes rs_length_diff to get + // very large and mess up the RSet length predictions. We'll be + // defensive until we work out why this happens. + size_t rs_length_diff = 0; + if (_max_rs_lengths > _recorded_rs_lengths) { + rs_length_diff = _max_rs_lengths - _recorded_rs_lengths; + } + _rs_length_diff_seq->add((double) rs_length_diff); size_t copied_bytes = surviving_bytes; double cost_per_byte_ms = 0.0;