Mercurial > hg > truffle
diff src/share/vm/gc_implementation/g1/vm_operations_g1.hpp @ 5963:64bf7c8270cb
7147724: G1: hang in SurrogateLockerThread::manipulatePLL
Summary: Attempting to initiate a marking cycle when allocating a humongous object can, if a marking cycle is successfully initiated by another thread, result in the allocating thread spinning until the marking cycle is complete. Eliminate a deadlock between the main ConcurrentMarkThread, the SurrogateLocker thread, the VM thread, and a mutator thread waiting on the SecondaryFreeList_lock (while free regions are going to become available) by not manipulating the pending list lock during the prologue and epilogue of the cleanup pause.
Reviewed-by: brutisso, jcoomes, tonyp
author | johnc |
---|---|
date | Mon, 12 Mar 2012 14:59:00 -0700 |
parents | db89aa49298f |
children | 37552638d24a |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp Fri Mar 16 16:14:04 2012 +0100 +++ b/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp Mon Mar 12 14:59:00 2012 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,8 +43,9 @@ public: VM_G1OperationWithAllocRequest(unsigned int gc_count_before, - size_t word_size) - : VM_GC_Operation(gc_count_before, GCCause::_allocation_failure), + size_t word_size, + GCCause::Cause gc_cause) + : VM_GC_Operation(gc_count_before, gc_cause), _word_size(word_size), _result(NULL), _pause_succeeded(false) { } HeapWord* result() { return _result; } bool pause_succeeded() { return _pause_succeeded; } @@ -77,6 +78,7 @@ class VM_G1IncCollectionPause: public VM_G1OperationWithAllocRequest { private: bool _should_initiate_conc_mark; + bool _should_retry_gc; double _target_pause_time_ms; unsigned int _full_collections_completed_before; public: @@ -86,11 +88,13 @@ double target_pause_time_ms, GCCause::Cause gc_cause); virtual VMOp_Type type() const { return VMOp_G1IncCollectionPause; } + virtual bool doit_prologue(); virtual void doit(); virtual void doit_epilogue(); virtual const char* name() const { return "garbage-first incremental collection pause"; } + bool should_retry_gc() const { return _should_retry_gc; } }; // Concurrent GC stop-the-world operations such as remark and cleanup; @@ -98,6 +102,7 @@ class VM_CGC_Operation: public VM_Operation { VoidClosure* _cl; const char* _printGCMessage; + bool _needs_pll; protected: // java.lang.ref.Reference support @@ -105,8 +110,8 @@ void release_and_notify_pending_list_lock(); public: - VM_CGC_Operation(VoidClosure* cl, const char *printGCMsg) - : _cl(cl), _printGCMessage(printGCMsg) { } + VM_CGC_Operation(VoidClosure* cl, const char *printGCMsg, bool needs_pll) + : _cl(cl), _printGCMessage(printGCMsg), _needs_pll(needs_pll) { } virtual VMOp_Type type() const { return VMOp_CGC_Operation; } virtual void doit(); virtual bool doit_prologue();