Sun, 02 Mar 2008 16:10:12 -0800
6557851: CMS: ergonomics defaults are not set with FLAG_SET_ERGO
Summary: Default values set by cms ergonomics are set with FLAG_SET_DEFAULT so down stream the values look like the default values and affect how later parameters are set. Set these values with FLAG_SET_ERGO instead and adjust how later parameters are interpreted.
Reviewed-by: iveresov, apetrusenko, pbk, ysr
duke@435 | 1 | /* |
duke@435 | 2 | * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | * |
duke@435 | 19 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
duke@435 | 20 | * CA 95054 USA or visit www.sun.com if you need additional information or |
duke@435 | 21 | * have any questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
duke@435 | 25 | inline PSPromotionManager* PSPromotionManager::manager_array(int index) { |
duke@435 | 26 | assert(_manager_array != NULL, "access of NULL manager_array"); |
duke@435 | 27 | assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access"); |
duke@435 | 28 | return _manager_array[index]; |
duke@435 | 29 | } |
duke@435 | 30 | |
duke@435 | 31 | inline void PSPromotionManager::claim_or_forward_internal_depth(oop* p) { |
duke@435 | 32 | if (p != NULL) { |
duke@435 | 33 | oop o = *p; |
duke@435 | 34 | if (o->is_forwarded()) { |
duke@435 | 35 | o = o->forwardee(); |
duke@435 | 36 | |
duke@435 | 37 | // Card mark |
duke@435 | 38 | if (PSScavenge::is_obj_in_young((HeapWord*) o)) { |
duke@435 | 39 | PSScavenge::card_table()->inline_write_ref_field_gc(p, o); |
duke@435 | 40 | } |
duke@435 | 41 | *p = o; |
duke@435 | 42 | } else { |
duke@435 | 43 | push_depth(p); |
duke@435 | 44 | } |
duke@435 | 45 | } |
duke@435 | 46 | } |
duke@435 | 47 | |
duke@435 | 48 | inline void PSPromotionManager::claim_or_forward_internal_breadth(oop* p) { |
duke@435 | 49 | if (p != NULL) { |
duke@435 | 50 | oop o = *p; |
duke@435 | 51 | if (o->is_forwarded()) { |
duke@435 | 52 | o = o->forwardee(); |
duke@435 | 53 | } else { |
duke@435 | 54 | o = copy_to_survivor_space(o, false); |
duke@435 | 55 | } |
duke@435 | 56 | |
duke@435 | 57 | // Card mark |
duke@435 | 58 | if (PSScavenge::is_obj_in_young((HeapWord*) o)) { |
duke@435 | 59 | PSScavenge::card_table()->inline_write_ref_field_gc(p, o); |
duke@435 | 60 | } |
duke@435 | 61 | *p = o; |
duke@435 | 62 | } |
duke@435 | 63 | } |
duke@435 | 64 | |
duke@435 | 65 | inline void PSPromotionManager::flush_prefetch_queue() { |
duke@435 | 66 | assert(!depth_first(), "invariant"); |
duke@435 | 67 | for (int i=0; i<_prefetch_queue.length(); i++) { |
duke@435 | 68 | claim_or_forward_internal_breadth(_prefetch_queue.pop()); |
duke@435 | 69 | } |
duke@435 | 70 | } |
duke@435 | 71 | |
duke@435 | 72 | inline void PSPromotionManager::claim_or_forward_depth(oop* p) { |
duke@435 | 73 | assert(depth_first(), "invariant"); |
duke@435 | 74 | assert(PSScavenge::should_scavenge(*p, true), "revisiting object?"); |
duke@435 | 75 | assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); |
duke@435 | 76 | assert(Universe::heap()->is_in(p), "pointer outside heap"); |
duke@435 | 77 | |
duke@435 | 78 | claim_or_forward_internal_depth(p); |
duke@435 | 79 | } |
duke@435 | 80 | |
duke@435 | 81 | inline void PSPromotionManager::claim_or_forward_breadth(oop* p) { |
duke@435 | 82 | assert(!depth_first(), "invariant"); |
duke@435 | 83 | assert(PSScavenge::should_scavenge(*p, true), "revisiting object?"); |
duke@435 | 84 | assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); |
duke@435 | 85 | assert(Universe::heap()->is_in(p), "pointer outside heap"); |
duke@435 | 86 | |
duke@435 | 87 | if (UsePrefetchQueue) { |
duke@435 | 88 | claim_or_forward_internal_breadth(_prefetch_queue.push_and_pop(p)); |
duke@435 | 89 | } else { |
duke@435 | 90 | // This option is used for testing. The use of the prefetch |
duke@435 | 91 | // queue can delay the processing of the objects and thus |
duke@435 | 92 | // change the order of object scans. For example, remembered |
duke@435 | 93 | // set updates are typically the clearing of the remembered |
duke@435 | 94 | // set (the cards) followed by updates of the remembered set |
duke@435 | 95 | // for young-to-old pointers. In a situation where there |
duke@435 | 96 | // is an error in the sequence of clearing and updating |
duke@435 | 97 | // (e.g. clear card A, update card A, erroneously clear |
duke@435 | 98 | // card A again) the error can be obscured by a delay |
duke@435 | 99 | // in the update due to the use of the prefetch queue |
duke@435 | 100 | // (e.g., clear card A, erroneously clear card A again, |
duke@435 | 101 | // update card A that was pushed into the prefetch queue |
duke@435 | 102 | // and thus delayed until after the erronous clear). The |
duke@435 | 103 | // length of the delay is random depending on the objects |
duke@435 | 104 | // in the queue and the delay can be zero. |
duke@435 | 105 | claim_or_forward_internal_breadth(p); |
duke@435 | 106 | } |
duke@435 | 107 | } |
duke@435 | 108 | |
duke@435 | 109 | inline void PSPromotionManager::process_popped_location_depth(oop* p) { |
duke@435 | 110 | if (is_oop_masked(p)) { |
duke@435 | 111 | assert(PSChunkLargeArrays, "invariant"); |
duke@435 | 112 | oop const old = unmask_chunked_array_oop(p); |
duke@435 | 113 | process_array_chunk(old); |
duke@435 | 114 | } else { |
duke@435 | 115 | PSScavenge::copy_and_push_safe_barrier(this, p); |
duke@435 | 116 | } |
duke@435 | 117 | } |