370 Commits

Author SHA1 Message Date
John Cuthbertson
a484211e0b Merge 2011-01-13 17:19:21 -08:00
Y. Srinivas Ramakrishna
597a0cd214 7011940: iCMS: SIGSEGV in SweepClosure::do_already_free_chunk(FreeChunk*)+0x360
Revert a (relaxed version of the) bounds-check that was incorrectly removed in the fix for 7008136.

Reviewed-by: jmasa, johnc
2011-01-13 11:33:56 -08:00
Bengt Rutisson
2464e6b369 6941122: G1: UseLargePages does not work with G1 garbage collector
Pass the value of UseLargePages instead of false as the "large" parameter when reserving the G1 heap.

Reviewed-by: tonyp, johnc, phh
2011-01-13 04:43:30 -08:00
Antonios Printezis
bc1df68513 6994297: G1: do first-level slow-path allocations with a CAS
First attempt to allocate out the current alloc region using a CAS instead of taking the Heap_lock (first level of G1's slow allocation path). Only if that fails and it's necessary to replace the current alloc region take the Heap_lock (that's the second level of G1's slow allocation path).

Reviewed-by: johnc, brutisso, ysr
2011-01-12 16:34:25 -05:00
Antonios Printezis
5f21cb1b9b 7007068: G1: refine the BOT during evac failure handling
During evacuation failure handling we refine the BOT to reflect the location of all the objects in the regions we scan. The changeset includes some minor cleanup: a) non-product print_on() method on the G1 BOT class, b) added more complete BOT verification during heap / region verification, c) slight modification to the BOT set up for humongous regions to be more consistent with the BOT set up during evac failure handling, and d) removed a couple of unused methods.

Reviewed-by: johnc, ysr
2011-01-12 13:06:00 -05:00
Keith McGuigan
ae65c6240f 6458402: 3 jvmti tests fail with CMS and +ExplicitGCInvokesConcurrent
Make JvmtiGCMark safe to run non-safepoint and instrument CMS

Reviewed-by: ysr, dcubed
2011-01-10 17:14:53 -05:00
Y. Srinivas Ramakrishna
d921d72f20 7008136: CMS: assert((HeapWord*)nextChunk <= _limit) failed: sweep invariant
The recorded _sweep_limit may not necessarily remain a block boundary as the old generation expands during a concurrent cycle. Terminal actions inside the sweep closure need to be aware of this as they cross over the limit.

Reviewed-by: johnc, minqi
2011-01-06 23:50:02 -08:00
Antonios Printezis
2aa9ac1177 6896624: G1: hotspot:::gc and hotspot:::mem-pool-gc probes are not fired
Fire the gc-begin and gc-end probes for G1.

Reviewed-by: kamg, ysr, jcoomes
2010-12-19 20:57:16 -05:00
Y. Srinivas Ramakrishna
41bf31bff4 6807801: CMS: could save/restore fewer header words during scavenge
Age bits need not enter the mark-word preservation calculus; also affected, in addition to CMS, per CR synopsis above, were ParNew (but not DefNew), ParallelScavenge and G1, albeit to a lesser degree than CMS.

Reviewed-by: tonyp, johnc
2010-12-17 23:41:31 -08:00
John Cuthbertson
b2fa4708ad 7006113: G1: Initialize ReferenceProcessor::_is_alive_non_header field
Initialize the _is_alive_non_header field of G1's reference processor with an instance of the G1CMIsAliveClosure. This will stop adding reference objects with live referents to the discovered reference lists unnecessarily.

Reviewed-by: tonyp, ysr, jwilhelm, brutisso
2010-12-17 11:26:53 -08:00
Antonios Printezis
727333a1a3 7000559: G1: assertion failure !outer || (full_collections_started == _full_collections_completed + 1)
The concurrent marking thread can complete its operation and increment the full GC counter during a Full GC. This causes the nesting of increments to the start and end of Full GCs that we are expecting to be wrong. the fix is for the marking thread to join the suspendible thread set before incrementing the counter so that it's blocked until the Full GC (or any other safepoint) is finished. The change also includes some minor code cleanup (I renamed a parameter).

Reviewed-by: brutisso, ysr
2010-12-14 16:19:44 -05:00
Y. Srinivas Ramakrishna
874098b1c6 Merge 2010-12-09 21:47:58 -08:00
Y. Srinivas Ramakrishna
8baafdfd45 7005259: CMS: BubbleUpRef asserts referent(obj)->is_oop() failed: Enqueued a bad referent
Relaxed the assert by allowing NULL referents when discovery may be concurrent.

Reviewed-by: johnc, jcoomes
2010-12-09 09:22:57 -08:00
Y. Srinivas Ramakrishna
544b475fc5 7001033: assert(gch->gc_cause() == GCCause::_scavenge_alot || !gch->incremental_collection_failed())
7002546: regression on SpecJbb2005 on 7b118 comparing to 7b117 on small heaps

Relaxed assertion checking related to incremental_collection_failed flag to allow for ExplicitGCInvokesConcurrent behaviour where we do not want a failing scavenge to bail to a stop-world collection. Parameterized incremental_collection_will_fail() so we can selectively use, or not use, as appropriate, the statistical prediction at specific use sites. This essentially reverts the scavenge bail-out logic to what it was prior to some recent changes that had inadvertently started using the statistical prediction which can be noisy in the presence of bursty loads. Added some associated verbose non-product debugging messages.

Reviewed-by: johnc, tonyp
2010-12-07 21:55:53 -08:00
Antonios Printezis
edcfaf0f84 6994056: G1: when GC locker is active, extend the Eden instead of allocating into the old gen
Allow the eden to the expanded up to a point when the GC locker is active.

Reviewed-by: jwilhelm, johnc, ysr, jcoomes
2010-12-07 16:47:42 -05:00
Coleen Phillimore
faf320aede Merge 2010-12-06 15:37:00 -05:00
Antonios Printezis
dcf8c40e3a 7003860: G1: assert(_cur_alloc_region == NULL || !expect_null_cur_alloc_region) fails
Wrong assumption about expecting the current alloc region expected to be NULL in expand_and_allocate().

Reviewed-by: brutisso, ysr
2010-12-02 13:20:39 -05:00
John Cuthbertson
1065281a98 6983204: G1: Nightly test nsk/regression/b4958615 failing with +ExplicitGCInvokesConcurrent
Enable reference discovery during concurrent marking by setting the reference processor field of the concurrent marking closure. Keep reference objects on the discovered reference lists alive during incremental evacuation pauses until they are processed at the end of concurrent marking.

Reviewed-by: ysr, tonyp
2010-12-01 17:34:02 -08:00
Stefan Karlsson
4a33afe6c4 7003125: precompiled.hpp is included when precompiled headers are not used
Added an ifndef DONT_USE_PRECOMPILED_HEADER to precompiled.hpp. Set up DONT_USE_PRECOMPILED_HEADER when compiling with Sun Studio or when the user specifies USE_PRECOMPILED_HEADER=0. Fixed broken include dependencies.

Reviewed-by: coleenp, kvn
2010-12-01 15:04:06 +01:00
Stefan Karlsson
8006fe8f75 6989984: Use standard include model for Hospot
Replaced MakeDeps and the includeDB files with more standardized solutions.

Reviewed-by: coleenp, kvn, kamg
2010-11-23 13:22:55 -08:00
John Cuthbertson
92aa340360 Merge 2010-11-16 16:12:28 -08:00
John Cuthbertson
e5344b854c 6978187: G1: assert(ParallelGCThreads> 1 || n_yielded() == _hrrs->occupied()) strikes again
An evacuation failure while copying the roots caused an object, A, to be forwarded to itself. During the subsequent RSet updating a reference to A was processed causing the reference to be added to the RSet of A's heap region. As a result of adding to the remembered set we ran into the issue described in 6930581 - the sparse table expanded and the RSet scanning code walked the cards in one instance of RHashTable (_cur) while the occupied() counts the cards in the expanded table (_next).

Reviewed-by: tonyp, iveresov
2010-11-16 14:07:33 -08:00
Y. Srinivas Ramakrishna
9af444d011 7000578: CMS: assert(SafepointSynchronize::is_at_safepoint()) failed: Else races are possible
Weakened assert in onj_is_alive() to allow its use at initialization time when is_at_safepoint() normally reports false; added some related asserts to check order of is_init_completed() after Universe::is_fully_initialized().

Reviewed-by: jcoomes
2010-11-16 13:58:48 -08:00
Jon Masamitsu
fbe476856f Merge 2010-11-15 16:25:14 -08:00
Y. Srinivas Ramakrishna
579c9e4b03 6996613: CompactibleFreeListSpace::print should call CompactibleFreeListSpace::print_on, not Space::print_on
Reviewed-by: tonyp
2010-11-09 10:47:20 -08:00
Igor Veresov
39ef076af4 Merge 2010-11-08 14:33:48 -08:00
Y. Srinivas Ramakrishna
fe147ae592 6997298: fatal error: must own lock CMS_markBitMap_lock during heap dump
Since we are at a stop-world pause, the existing CMS-phase checks are sufficient for safety, and the locking check can be safely elided. Elaborated documentation comment to the case where class unloading and verification are disabled, and the query happens when we aren't in the sweeping phase, where the answer "false" would be (almost everywhere) too pessimistic.

Reviewed-by: jmasa, johnc, tonyp
2010-11-05 13:20:37 -07:00
Y. Srinivas Ramakrishna
cbc7f8756a 6896603: CMS/GCH: collection_attempt_is_safe() ergo should use more recent data
Deprecated HandlePromotionFailure, removing the ability to turn off that feature, did away with one epoch look-ahead when deciding if a scavenge is likely to fail, relying on current data.

Reviewed-by: jmasa, johnc, poonam
2010-10-23 23:03:49 -07:00
Y. Srinivas Ramakrishna
554e77efb4 6992998: CMSWaitDuration=0 causes hangs with +ExplicitGCInvokesConcurrent
Closed a timing hole during which concurrent full gc requests can be missed. The hole can increase the latency of the response to a full gc request by up to the value of CMSWaitDuration. If CMSWaitDuration=0 is, as currently, interpreted as an unbounded wait, suitable in certain tuning scenarios, the application can potentially hang. Made two obscure tunables, including CMSWaitDuration, manageable.

Reviewed-by: jcoomes, tonyp
2010-10-21 17:29:24 -07:00
Tom Rodriguez
1571a4a56f 6970683: improvements to hs_err output
Reviewed-by: kvn, jrose, dholmes, coleenp
2010-10-21 11:55:10 -07:00
Antonios Printezis
0c660e1f60 6991377: G1: race between concurrent refinement and humongous object allocation
There is a race between the concurrent refinement threads and the humongous object allocation that can cause the concurrent refinement threads to corrupt the part of the BOT that it is being initialized by the humongous object allocation operation. The solution is to do the humongous object allocation in careful steps to ensure that the concurrent refinement threads always have a consistent view over the BOT, region contents, and top. The fix includes some very minor tidying up in sparsePRT.

Reviewed-by: jcoomes, johnc, ysr
2010-10-16 17:12:19 -04:00
John Cuthbertson
f6acb9efb0 6988458: G1: assert(mr.end() <= _cm->finger()) failed: otherwise the region shouldn't be on the stack
The changes from 6941395 did not clear the CMTask::_aborted_region fields when concurrent marking aborted because of overflow. As a result, the next time around we could see a memory region whose start address was above the global finger and the assertion tripped. Moved the clearing of the aborted regions to ConcurrentMark::clear_marking_state, which is executed on all of the exit paths.

Reviewed-by: tonyp, ysr, jmasa
2010-10-18 15:01:41 -07:00
Antonios Printezis
0c9bfb6003 6992189: G1: inconsistent base used in sparse rem set iterator
The remembered set iterator for sparse tables incorrectly assumes that index 0 corresponds to the bottom of the heap, not address 0 as it is the case.

Reviewed-by: ysr, jmasa
2010-10-15 17:26:56 -04:00
Antonios Printezis
e79a62412f 6990359: G1: don't push a stolen entry on the taskqueue, deal with it directly
When an entry is stolen, don't push it on the task queue but process it directly.

Reviewed-by: iveresov, ysr, jcoomes
2010-10-14 10:38:14 -04:00
John Coomes
d85b042fca 6989448: G1: refactor and simplify G1ParScanThreadState
Reviewed-by: iveresov, tonyp
2010-10-12 11:29:45 -07:00
John Cuthbertson
02bad20969 6971296: G1: simplify G1RemSet class hierarchy
Remove G1RemSet base class and StupidG1RemSet class; rename HRInto_G1RemSet to just G1RemSet.

Reviewed-by: ysr, tonyp
2010-10-12 09:36:48 -07:00
Antonios Printezis
189be5a71f 6980838: G1: guarantee(false) failed: thread has an unexpected active value in its SATB queue
Under certain circumstances a safepoint could happen between a JavaThread object being created and that object being added to the Java threads list. This could cause the active field of that thread's SATB queue to get out-of-sync with respect to the other Java threads. The solution is to activate the SATB queue, when necessary, before adding the thread to the Java threads list, not when the JavaThread object is created. The changeset also includes a small fix to rename the surrogate locker thread from "Surrogate Locker Thread (CMS)" to "Surrogate Locker Thread (Concurrent GC)" since it's also used in G1.

Reviewed-by: iveresov, ysr, johnc, jcoomes
2010-10-01 16:43:05 -04:00
John Cuthbertson
8980543dc1 Merge 2010-10-01 21:48:40 -07:00
John Cuthbertson
20289fbffd 6983311: G1: LoopTest hangs when run with -XX:+ExplicitInvokesConcurrent
Clear the concurrent marking "in progress" flag while the FullGCCount_lock is held. This avoids a race that can cause back to back System.gc() calls, when ExplicitGCInvokesConcurrent is enabled, to fail to initiate a marking cycle causing the requesting thread to hang.

Reviewed-by: tonyp, ysr
2010-10-01 18:23:16 -07:00
Y. Srinivas Ramakrishna
8fbdf5c7f0 6794422: Perm gen expansion policy for concurrent collectors
Concurrent collectors should expand the perm gen without a full STW GC, but possibly by triggering a concurrent collection. Temporary band-aid for G1 where no concurrent collection is kicked off since the perm gen is not collected concurrently.

Reviewed-by: johnc
2010-10-01 16:12:54 -07:00
Y. Srinivas Ramakrishna
cf2163334f 6692906: CMS: parallel concurrent marking may be prone to hanging or stalling mutators for periods of time
Inserted missing yield(check)s in closures used during the work-stealing phase of parallel concurrent marking, a missing synchronous yield-request in the cms perm gen allocation path, and a terminator-terminator for the offer_termination invocation that monitors the yield status of the concurrent marking task. Elaborated some documentation comments and made some task queue termination loop flags configurable at start-up to aid debugging in the field.

Reviewed-by: jmasa, johnc, poonam
2010-09-29 16:17:02 -07:00
John Coomes
1cdd538ea5 6423256: GC stacks should use a better data structure
6942771: SEGV in ParScanThreadState::take_from_overflow_stack

Reviewed-by: apetrusenko, ysr, pbk
2010-09-28 15:56:15 -07:00
John Cuthbertson
aff36499e7 6941395: G1: Use only lock-free versions of region stack push() and pop()
Re-enable use of the lock-free versions of region stack push() and pop() by recording aborted regions in a thread-local structure, which are then processed when scanning of the region stack restarts. The previous locking versions of these routines are retained for diagnostic purposes.

Reviewed-by: tonyp, ysr
2010-09-28 09:51:37 -07:00
Jon Masamitsu
28e56b8970 6984287: Regularize how GC parallel workers are specified
Associate number of GC workers with the workgang as opposed to the task.

Reviewed-by: johnc, ysr
2010-09-20 14:38:38 -07:00
John Cuthbertson
2b0e8a56df 6981746: G1: SEGV with -XX:+TraceGen0Time
Pass correct value for length to NumberSeq constructor. Guard dereferences of "body_summary" pointer with a NULL check.

Reviewed-by: tonyp, ysr
2010-09-13 10:00:24 -07:00
Y. Srinivas Ramakrishna
f53d569221 6983930: CMS: Various small cleanups ca September 2010
Fixed comment/documentation typos; converted some guarantee()s to assert()s.

Reviewed-by: jmasa
2010-09-10 17:07:55 -07:00
John Coomes
be6d973a49 6978300: G1: debug builds crash if ParallelGCThreads==0
Reviewed-by: tonyp, ysr
2010-08-25 14:39:55 -07:00
Antonios Printezis
bb23e30511 6974966: G1: unnecessary direct-to-old allocations
This change revamps the slow allocation path of G1. Improvements include the following: a) Allocations directly to old regions are now totally banned. G1 now only allows allocations out of young regions (with the only exception being humongous regions). b) The thread that allocates a new region (which is now guaranteed to be young) does not dirty all its cards. Each thread that successfully allocates out of a young region is now responsible for dirtying the cards that corresponding to the "block" that just got allocated. c) allocate_new_tlab() and mem_allocate() are now implemented differently and TLAB allocations are only done by allocate_new_tlab(). d) If a thread schedules an evacuation pause in order to satisfy an allocation request, it will perform the allocation at the end of the safepoint so that the thread that initiated the GC also gets "first pick" of any space made available by the GC. e) If a thread is unable to allocate a humongous object it will schedule an evacuation pause in case it reclaims enough regions so that the humongous allocation can be satisfied aftewards. f) The G1 policy is more careful to set the young list target length to be the survivor number +1. g) Lots of code tidy up, removal, refactoring to make future changes easier.

Reviewed-by: johnc, ysr
2010-08-24 17:24:33 -04:00
Y. Srinivas Ramakrishna
23ee6aa5f6 6910183: CMS: assert(_index < capacity(),"_index out of bounds")
Weakened a too-strong, off-by-one assert; added code to keep track of and report any overflows at appropriate level of verbosity.

Reviewed-by: jcoomes, tonyp
2010-08-23 17:51:10 -07:00
Y. Srinivas Ramakrishna
fc61f2721e 6977970: CMS: concurrentMarkSweepGeneration.cpp:7947 assert(addr <= _limit) failed: sweep invariant
Allow for the possibility (when the heap is expanding) that the sweep might skip over and past, rather than necessarily step on, the sweep limit determined at the beginning of a concurrent marking cycle.

Reviewed-by: jmasa, tonyp
2010-08-18 11:39:21 -07:00