comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 2149:7e37af9d69ef

7011379: G1: overly long concurrent marking cycles Summary: This changeset introduces filtering of SATB buffers at the point when they are about to be enqueued. If this filtering clears enough entries on each buffer, the buffer can then be re-used and not enqueued. This cuts down the number of SATB buffers that need to be processed by the concurrent marking threads. Reviewed-by: johnc, ysr
author tonyp
date Wed, 19 Jan 2011 09:35:17 -0500
parents 7246a374a9f2
children 0fa27f37d4d4
comparison
equal deleted inserted replaced
2137:ffd725ff6943 2149:7e37af9d69ef
1 /* 1 /*
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 2011, 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.
1169 // Clear the flag. We do not need it any more. 1169 // Clear the flag. We do not need it any more.
1170 clear_has_overflown(); 1170 clear_has_overflown();
1171 if (G1TraceMarkStackOverflow) 1171 if (G1TraceMarkStackOverflow)
1172 gclog_or_tty->print_cr("\nRemark led to restart for overflow."); 1172 gclog_or_tty->print_cr("\nRemark led to restart for overflow.");
1173 } else { 1173 } else {
1174 SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
1174 // We're done with marking. 1175 // We're done with marking.
1175 // This is the end of the marking cycle, we're expected all 1176 // This is the end of the marking cycle, we're expected all
1176 // threads to have SATB queues with active set to true. 1177 // threads to have SATB queues with active set to true.
1177 JavaThread::satb_mark_queue_set().set_active_all_threads( 1178 satb_mq_set.set_active_all_threads(false, /* new active value */
1178 false, /* new active value */ 1179 true /* expected_active */);
1179 true /* expected_active */);
1180 1180
1181 if (VerifyDuringGC) { 1181 if (VerifyDuringGC) {
1182 HandleMark hm; // handle scope 1182 HandleMark hm; // handle scope
1183 gclog_or_tty->print(" VerifyDuringGC:(after)"); 1183 gclog_or_tty->print(" VerifyDuringGC:(after)");
1184 Universe::heap()->prepare_for_verify(); 1184 Universe::heap()->prepare_for_verify();