Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
5962:8a729074feae | 5963:64bf7c8270cb |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
41 HeapWord* _result; | 41 HeapWord* _result; |
42 bool _pause_succeeded; | 42 bool _pause_succeeded; |
43 | 43 |
44 public: | 44 public: |
45 VM_G1OperationWithAllocRequest(unsigned int gc_count_before, | 45 VM_G1OperationWithAllocRequest(unsigned int gc_count_before, |
46 size_t word_size) | 46 size_t word_size, |
47 : VM_GC_Operation(gc_count_before, GCCause::_allocation_failure), | 47 GCCause::Cause gc_cause) |
48 : VM_GC_Operation(gc_count_before, gc_cause), | |
48 _word_size(word_size), _result(NULL), _pause_succeeded(false) { } | 49 _word_size(word_size), _result(NULL), _pause_succeeded(false) { } |
49 HeapWord* result() { return _result; } | 50 HeapWord* result() { return _result; } |
50 bool pause_succeeded() { return _pause_succeeded; } | 51 bool pause_succeeded() { return _pause_succeeded; } |
51 }; | 52 }; |
52 | 53 |
75 }; | 76 }; |
76 | 77 |
77 class VM_G1IncCollectionPause: public VM_G1OperationWithAllocRequest { | 78 class VM_G1IncCollectionPause: public VM_G1OperationWithAllocRequest { |
78 private: | 79 private: |
79 bool _should_initiate_conc_mark; | 80 bool _should_initiate_conc_mark; |
81 bool _should_retry_gc; | |
80 double _target_pause_time_ms; | 82 double _target_pause_time_ms; |
81 unsigned int _full_collections_completed_before; | 83 unsigned int _full_collections_completed_before; |
82 public: | 84 public: |
83 VM_G1IncCollectionPause(unsigned int gc_count_before, | 85 VM_G1IncCollectionPause(unsigned int gc_count_before, |
84 size_t word_size, | 86 size_t word_size, |
85 bool should_initiate_conc_mark, | 87 bool should_initiate_conc_mark, |
86 double target_pause_time_ms, | 88 double target_pause_time_ms, |
87 GCCause::Cause gc_cause); | 89 GCCause::Cause gc_cause); |
88 virtual VMOp_Type type() const { return VMOp_G1IncCollectionPause; } | 90 virtual VMOp_Type type() const { return VMOp_G1IncCollectionPause; } |
91 virtual bool doit_prologue(); | |
89 virtual void doit(); | 92 virtual void doit(); |
90 virtual void doit_epilogue(); | 93 virtual void doit_epilogue(); |
91 virtual const char* name() const { | 94 virtual const char* name() const { |
92 return "garbage-first incremental collection pause"; | 95 return "garbage-first incremental collection pause"; |
93 } | 96 } |
97 bool should_retry_gc() const { return _should_retry_gc; } | |
94 }; | 98 }; |
95 | 99 |
96 // Concurrent GC stop-the-world operations such as remark and cleanup; | 100 // Concurrent GC stop-the-world operations such as remark and cleanup; |
97 // consider sharing these with CMS's counterparts. | 101 // consider sharing these with CMS's counterparts. |
98 class VM_CGC_Operation: public VM_Operation { | 102 class VM_CGC_Operation: public VM_Operation { |
99 VoidClosure* _cl; | 103 VoidClosure* _cl; |
100 const char* _printGCMessage; | 104 const char* _printGCMessage; |
105 bool _needs_pll; | |
101 | 106 |
102 protected: | 107 protected: |
103 // java.lang.ref.Reference support | 108 // java.lang.ref.Reference support |
104 void acquire_pending_list_lock(); | 109 void acquire_pending_list_lock(); |
105 void release_and_notify_pending_list_lock(); | 110 void release_and_notify_pending_list_lock(); |
106 | 111 |
107 public: | 112 public: |
108 VM_CGC_Operation(VoidClosure* cl, const char *printGCMsg) | 113 VM_CGC_Operation(VoidClosure* cl, const char *printGCMsg, bool needs_pll) |
109 : _cl(cl), _printGCMessage(printGCMsg) { } | 114 : _cl(cl), _printGCMessage(printGCMsg), _needs_pll(needs_pll) { } |
110 virtual VMOp_Type type() const { return VMOp_CGC_Operation; } | 115 virtual VMOp_Type type() const { return VMOp_CGC_Operation; } |
111 virtual void doit(); | 116 virtual void doit(); |
112 virtual bool doit_prologue(); | 117 virtual bool doit_prologue(); |
113 virtual void doit_epilogue(); | 118 virtual void doit_epilogue(); |
114 virtual const char* name() const { | 119 virtual const char* name() const { |