# HG changeset patch # User aoqi # Date 1466759533 -28800 # Node ID 873fd82b133d518b254c92d241c7bef64f457cb3 # Parent d2be62fdfa50725b677555c0942680b08a8b2350 [Code Reorganization] Removed GC related modifications made by Loongson, for example, UseOldNUMA. diff -r d2be62fdfa50 -r 873fd82b133d src/os/linux/vm/os_linux.cpp --- a/src/os/linux/vm/os_linux.cpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/os/linux/vm/os_linux.cpp Fri Jun 24 17:12:13 2016 +0800 @@ -251,7 +251,7 @@ #define SYS_gettid 186 #elif __sparc__ #define SYS_gettid 143 -#elif __mips__ +#elif __mips__ #define SYS_gettid 4222 #else #error define gettid for the arch @@ -2841,16 +2841,6 @@ return 0; } -int os::numa_get_cpu_id() { - int cpu_id = Linux::sched_getcpu(); - if(cpu_id != -1) - return cpu_id; - else { - tty->print_cr("cpu_id got a unacceptable value"); - return 0; - } -} - size_t os::numa_get_leaf_groups(int *ids, size_t size) { for (size_t i = 0; i < size; i++) { ids[i] = i; @@ -4925,20 +4915,6 @@ } } -/*Liao:2013/11/18 UseOldNUMA: Let OldGen support NUMA*/ - if(UseNUMA == true && UseOldNUMA == true) { - UseOldNUMA = true; - } else { - UseOldNUMA = false; - } - - if(UseOldNUMA == false) { - UseNUMAGC = false; - UseNUMAThreadRoots = false; - UseNUMASteal = false; - BindGCTaskThreadsToCPUs = false; - } - if (MaxFDLimit) { // set the number of file descriptors to max. print out error // if getrlimit/setrlimit fails but continue regardless. @@ -5028,24 +5004,8 @@ } bool os::bind_to_processor(uint processor_id) { - /* 2014/7/7 implemented by Liao */ - if(BindGCTaskThreadsToCPUs) { - cpu_set_t mask; - cpu_set_t get; - CPU_ZERO(&mask); - CPU_SET(processor_id, &mask); - - if(sched_setaffinity(0, sizeof(mask), &mask) == -1) { - tty->print_cr("Can't bind to processor_id = %d!", processor_id); - return false; - } - else { - return true; - } - } - else { - return false; - } + // Not yet implemented. + return false; } /// diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp --- a/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #include "precompiled.hpp" #include "gc_implementation/parallelScavenge/cardTableExtension.hpp" #include "gc_implementation/parallelScavenge/gcTaskManager.hpp" @@ -207,13 +201,7 @@ worker_end_card = end_card; } - /* 2014/2/12/ Liao: In UseOldNUMA, when FullGC occurs, all live objects in old-gen are - * compacted to the low end of old-gen. If the size of live objects is larger than lgrp0, - * and the last object in lgrp0 spans both lgrp0 and lgrp1, then the slice_end is greater - * than sp_top. (The lgrp0 is full, so the sp_top equals to sp_end.) - * This situtation is reasonable in UseOldNUMA.*/ - if(!UseOldNUMA) - assert(slice_end <= (HeapWord*)sp_top, "Last object in slice crosses space boundary"); + assert(slice_end <= (HeapWord*)sp_top, "Last object in slice crosses space boundary"); assert(is_valid_card_address(worker_start_card), "Invalid worker start card"); assert(is_valid_card_address(worker_end_card), "Invalid worker end card"); // Note that worker_start_card >= worker_end_card is legal, and happens when @@ -331,213 +319,6 @@ } } -void CardTableExtension::scavenge_contents_parallel_oldnuma(ObjectStartArray* start_array, - MutableSpace* sp_below, - MutableSpace* sp, - HeapWord* space_top, - PSPromotionManager* pm, - uint stripe_number, - uint stripe_total) { - int ssize = 128; // Naked constant! Work unit = 64k. - int dirty_card_count = 0; - - // It is a waste to get here if empty. - assert(sp->bottom() < sp->top(), "Should not be called if empty"); - oop* sp_top = (oop*)space_top; - jbyte* start_card = byte_for(sp->bottom()); - jbyte* end_card = byte_for(sp_top - 1) + 1; - oop* last_scanned = NULL; // Prevent scanning objects more than once - // The width of the stripe ssize*stripe_total must be - // consistent with the number of stripes so that the complete slice - // is covered. - size_t slice_width = ssize * stripe_total; - for (jbyte* slice = start_card; slice < end_card; slice += slice_width) { - jbyte* worker_start_card = slice + stripe_number * ssize; - if (worker_start_card >= end_card) - return; // We're done. - - jbyte* worker_end_card = worker_start_card + ssize; - if (worker_end_card > end_card) - worker_end_card = end_card; - - // We do not want to scan objects more than once. In order to accomplish - // this, we assert that any object with an object head inside our 'slice' - // belongs to us. We may need to extend the range of scanned cards if the - // last object continues into the next 'slice'. - // - // Note! ending cards are exclusive! - HeapWord* slice_start = addr_for(worker_start_card); - HeapWord* slice_end = MIN2((HeapWord*) sp_top, addr_for(worker_end_card)); - -#ifdef ASSERT - if (GCWorkerDelayMillis > 0) { - // Delay 1 worker so that it proceeds after all the work - // has been completed. - if (stripe_number < 2) { - os::sleep(Thread::current(), GCWorkerDelayMillis, false); - } - } -#endif - - // If there are not objects starting within the chunk, skip it. - if (!start_array->object_starts_in_range(slice_start, slice_end)) { - continue; - } - // Update our beginning addr - HeapWord* first_object; - if(sp_below->top() == sp->bottom()) - first_object = start_array->object_start(slice_start); - else - first_object = start_array->object_start_oldnuma(slice_start, sp->bottom()); - debug_only(oop* first_object_within_slice = (oop*) first_object;) - if (first_object < slice_start) { - last_scanned = (oop*)(first_object + oop(first_object)->size()); - debug_only(first_object_within_slice = last_scanned;) - worker_start_card = byte_for(last_scanned); - } - - // Update the ending addr - if (slice_end < (HeapWord*)sp_top) { - // The subtraction is important! An object may start precisely at slice_end. - HeapWord* last_object; - if(sp_below->top() == sp->bottom()) - last_object = start_array->object_start(slice_end - 1); - else - last_object = start_array->object_start_oldnuma(slice_end - 1, sp->bottom()); - slice_end = last_object + oop(last_object)->size(); - // worker_end_card is exclusive, so bump it one past the end of last_object's - // covered span. - worker_end_card = byte_for(slice_end) + 1; - - if (worker_end_card > end_card) - worker_end_card = end_card; - } - - assert(is_valid_card_address(worker_start_card), "Invalid worker start card"); - assert(is_valid_card_address(worker_end_card), "Invalid worker end card"); - // Note that worker_start_card >= worker_end_card is legal, and happens when - // an object spans an entire slice. - assert(worker_start_card <= end_card, "worker start card beyond end card"); - assert(worker_end_card <= end_card, "worker end card beyond end card"); - - jbyte* current_card = worker_start_card; - while (current_card < worker_end_card) { - // Find an unclean card. - while (current_card < worker_end_card && card_is_clean(*current_card)) { - current_card++; - } - jbyte* first_unclean_card = current_card; - - // Find the end of a run of contiguous unclean cards - while (current_card < worker_end_card && !card_is_clean(*current_card)) { - while (current_card < worker_end_card && !card_is_clean(*current_card)) { - current_card++; - } - - if (current_card < worker_end_card) { - // Some objects may be large enough to span several cards. If such - // an object has more than one dirty card, separated by a clean card, - // we will attempt to scan it twice. The test against "last_scanned" - // prevents the redundant object scan, but it does not prevent newly - // marked cards from being cleaned. - HeapWord* last_object_in_dirty_region; - if(sp_below->top() == sp->bottom()) - last_object_in_dirty_region = start_array->object_start(addr_for(current_card)-1); - else - last_object_in_dirty_region = start_array->object_start_oldnuma(addr_for(current_card)-1, sp->bottom()); - size_t size_of_last_object = oop(last_object_in_dirty_region)->size(); - HeapWord* end_of_last_object = last_object_in_dirty_region + size_of_last_object; - jbyte* ending_card_of_last_object = byte_for(end_of_last_object); - assert(ending_card_of_last_object <= worker_end_card, "ending_card_of_last_object is greater than worker_end_card"); - if (ending_card_of_last_object > current_card) { - // This means the object spans the next complete card. - // We need to bump the current_card to ending_card_of_last_object - current_card = ending_card_of_last_object; - } - } - } - jbyte* following_clean_card = current_card; - - if (first_unclean_card < worker_end_card) { - oop* p; - if(sp_below->top() == sp->bottom()) - p = (oop*) start_array->object_start(addr_for(first_unclean_card)); - else - p = (oop*) start_array->object_start_oldnuma(addr_for(first_unclean_card), sp->bottom()); - assert((HeapWord*)p <= addr_for(first_unclean_card), "checking"); - // "p" should always be >= "last_scanned" because newly GC dirtied - // cards are no longer scanned again (see comment at end - // of loop on the increment of "current_card"). Test that - // hypothesis before removing this code. - // If this code is removed, deal with the first time through - // the loop when the last_scanned is the object starting in - // the previous slice. - assert((p >= last_scanned) || - (last_scanned == first_object_within_slice), - "Should no longer be possible"); - if (p < last_scanned) { - // Avoid scanning more than once; this can happen because - // newgen cards set by GC may a different set than the - // originally dirty set - p = last_scanned; - } - oop* to = (oop*)addr_for(following_clean_card); - - // Test slice_end first! - if ((HeapWord*)to > slice_end) { - to = (oop*)slice_end; - } else if (to > sp_top) { - to = sp_top; - } - - // we know which cards to scan, now clear them - if (first_unclean_card <= worker_start_card+1) - first_unclean_card = worker_start_card+1; - if (following_clean_card >= worker_end_card-1) - following_clean_card = worker_end_card-1; - - while (first_unclean_card < following_clean_card) { - *first_unclean_card++ = clean_card; - } - - const int interval = PrefetchScanIntervalInBytes; - // scan all objects in the range - if (interval != 0) { - while (p < to) { - Prefetch::write(p, interval); - oop m = oop(p); - assert(m->is_oop_or_null(), "check for header"); - m->push_contents(pm); - p += m->size(); - } - pm->drain_stacks_cond_depth(); - } else { - while (p < to) { - oop m = oop(p); - assert(m->is_oop_or_null(), "check for header"); - m->push_contents(pm); - p += m->size(); - } - pm->drain_stacks_cond_depth(); - } - last_scanned = p; - } - // "current_card" is still the "following_clean_card" or - // the current_card is >= the worker_end_card so the - // loop will not execute again. - assert((current_card == following_clean_card) || - (current_card >= worker_end_card), - "current_card should only be incremented if it still equals " - "following_clean_card"); - // Increment current_card so that it is not processed again. - // It may now be dirty because a old-to-young pointer was - // found on it an updated. If it is now dirty, it cannot be - // be safely cleaned in the next iteration. - current_card++; - } - } -} - // This should be called before a scavenge. void CardTableExtension::verify_all_young_refs_imprecise() { CheckForUnmarkedObjects check; diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp --- a/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_CARDTABLEEXTENSION_HPP #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_CARDTABLEEXTENSION_HPP @@ -73,15 +67,6 @@ uint stripe_number, uint stripe_total); - void scavenge_contents_parallel_oldnuma(ObjectStartArray* start_array, - MutableSpace* sp_below, - MutableSpace* sp, - HeapWord* space_top, - PSPromotionManager* pm, - uint stripe_number, - uint stripe_total); - - // Verification static void verify_all_young_refs_imprecise(); static void verify_all_young_refs_precise(); diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp --- a/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #include "precompiled.hpp" #include "gc_implementation/parallelScavenge/gcTaskManager.hpp" #include "gc_implementation/parallelScavenge/gcTaskThread.hpp" @@ -286,41 +280,6 @@ return result; } -// Dequeue one task, preferring one with numa_aware. -GCTask* GCTaskQueue::numa_dequeue(int numa_id) { - if (TraceGCTaskQueue) { - tty->print_cr("[" INTPTR_FORMAT "]" - " GCTaskQueue::dequeue(%u)", this, numa_id); - print("before:"); - } - assert(!is_empty(), "shouldn't dequeue from empty list"); - // Look down to the next barrier for a task with this affinity. - GCTask* result = NULL; - for (GCTask* element = remove_end(); - element != NULL; - element = element->newer()) { - if (element->is_barrier_task()) { - // Don't consider barrier tasks, nor past them. - result = NULL; - break; - } - if (element->task_numa_id() == numa_id) { - result = remove(element); - break; - } - } - // If we didn't find anything with affinity, just take the next task. - if (result == NULL) { - result = remove(); - } - - if (TraceGCTaskQueue) { - tty->print_cr(" return: " INTPTR_FORMAT, result); - print("after:"); - } - return result; -} - GCTask* GCTaskQueue::remove() { // Dequeue from remove end. GCTask* result = remove_end(); @@ -452,11 +411,10 @@ // Distribute the workers among the available processors, // unless we were told not to, or if the os doesn't want to. uint* processor_assignment = NEW_C_HEAP_ARRAY(uint, workers(), mtGC); - if (BindGCTaskThreadsToCPUs || + if (!BindGCTaskThreadsToCPUs || !os::distribute_processes(workers(), processor_assignment)) { for (uint a = 0; a < workers(); a += 1) { - /*2014/7/7 Liao: Bind GCThread [a] to processor [a] */ - processor_assignment[a] = a; + processor_assignment[a] = sentinel_worker(); } } _thread = NEW_C_HEAP_ARRAY(GCTaskThread*, workers(), mtGC); @@ -701,13 +659,7 @@ if (UseGCTaskAffinity) { result = queue()->dequeue(which); } else { - /* 2014/7/7 Liao: GCThread get task on numa machines with numa_aware. */ - if(UseNUMAThreadRoots) { - result = queue()->numa_dequeue(os::numa_get_group_id()); - } - else { - result = queue()->dequeue(); - } + result = queue()->dequeue(); } if (result->is_barrier_task()) { assert(which != sentinel_worker(), diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.hpp --- a/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.hpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.hpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GCTASKMANAGER_HPP #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GCTASKMANAGER_HPP @@ -80,7 +74,6 @@ // Instance state. const Kind::kind _kind; // For runtime type checking. const uint _affinity; // Which worker should run task. - int _numa_id; //Which numa node should run task. GCTask* _newer; // Tasks are on doubly-linked ... GCTask* _older; // ... lists. public: @@ -95,12 +88,6 @@ uint affinity() const { return _affinity; } - uint set_task_numa_id(int id) { - _numa_id = id; - } - int task_numa_id() { - return _numa_id; - } GCTask* newer() const { return _newer; } @@ -186,8 +173,6 @@ GCTask* dequeue(); // Dequeue one task, preferring one with affinity. GCTask* dequeue(uint affinity); - // Dequeue one task, preferring on with numa_aware. - GCTask* numa_dequeue(int numa_id); protected: // Constructor. Clients use factory, but there might be subclasses. GCTaskQueue(bool on_c_heap); @@ -276,10 +261,6 @@ guarantee(own_lock(), "don't own the lock"); return unsynchronized_queue()->dequeue(affinity); } - GCTask* numa_dequeue(int numa_id) { - guarantee(own_lock(), "don't own the lock"); - return unsynchronized_queue()->numa_dequeue(numa_id); - } uint length() const { guarantee(own_lock(), "don't own the lock"); return unsynchronized_queue()->length(); diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp --- a/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_OBJECTSTARTARRAY_HPP #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_OBJECTSTARTARRAY_HPP @@ -160,32 +154,6 @@ return scroll_forward; } - HeapWord* object_start_oldnuma(HeapWord* addr, HeapWord* bottom) const { - assert(_covered_region.contains(addr), "Must be in covered region"); - jbyte* block = block_for_addr(addr); - HeapWord* scroll_forward; - if(bottom == addr) - return bottom; - else - scroll_forward = offset_addr_for_block(block--); - while (scroll_forward > addr) { - scroll_forward = offset_addr_for_block(block--); - } - - HeapWord* next = scroll_forward; - while (next <= addr) { - if(oop(next)->is_oop_or_null()) { - scroll_forward = next; - next += oop(next)->size(); - } - else - next++; - } - assert(scroll_forward <= addr, "wrong order for current and arg"); - assert(addr <= next, "wrong order for arg and next"); - return scroll_forward; - } - bool is_block_allocated(HeapWord* addr) { assert(_covered_region.contains(addr), "Must be in covered region"); jbyte* block = block_for_addr(addr); diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp --- a/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,18 +22,11 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #include "precompiled.hpp" #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" #include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp" #include "gc_implementation/parallelScavenge/psOldGen.hpp" -#include "gc_implementation/shared/mutableNUMASpace.hpp" #include "gc_implementation/shared/spaceDecorator.hpp" #include "memory/cardTableModRefBS.hpp" #include "memory/gcLocker.inline.hpp" @@ -135,12 +128,8 @@ // // ObjectSpace stuff // - if(UseOldNUMA) { - _object_space = new MutableNUMASpace(virtual_space()->alignment()); - } - else { - _object_space = new MutableSpace(virtual_space()->alignment()); - } + + _object_space = new MutableSpace(virtual_space()->alignment()); if (_object_space == NULL) vm_exit_during_initialization("Could not allocate an old gen space"); @@ -225,12 +214,12 @@ return allocate_noexpand(word_size); } -HeapWord* PSOldGen::expand_and_cas_allocate(size_t word_size, int node) { +HeapWord* PSOldGen::expand_and_cas_allocate(size_t word_size) { expand(word_size*HeapWordSize); if (GCExpandToAllocateDelayMillis > 0) { os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false); } - return cas_allocate_noexpand(word_size, node); + return cas_allocate_noexpand(word_size); } void PSOldGen::expand(size_t bytes) { @@ -413,16 +402,10 @@ Universe::heap()->barrier_set()->resize_covered_region(new_memregion); // ALWAYS do this last!! - if(UseOldNUMA) { - HeapWord* const virtual_space_high = (HeapWord*) virtual_space()->high(); - object_space()->set_end(virtual_space_high); - } - else { - object_space()->initialize(new_memregion, - SpaceDecorator::DontClear, - SpaceDecorator::DontMangle); - } - + object_space()->initialize(new_memregion, + SpaceDecorator::DontClear, + SpaceDecorator::DontMangle); + assert(new_word_size == heap_word_size(object_space()->capacity_in_bytes()), "Sanity"); } diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp --- a/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSOLDGEN_HPP #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSOLDGEN_HPP @@ -35,7 +29,6 @@ #include "gc_implementation/parallelScavenge/psGenerationCounters.hpp" #include "gc_implementation/parallelScavenge/psVirtualspace.hpp" #include "gc_implementation/shared/mutableSpace.hpp" -#include "gc_implementation/shared/mutableNUMASpace.hpp" #include "gc_implementation/shared/spaceCounters.hpp" #include "runtime/safepoint.hpp" @@ -80,15 +73,9 @@ // Support for MT garbage collection. CAS allocation is lower overhead than grabbing // and releasing the heap lock, which is held during gc's anyway. This method is not // safe for use at the same time as allocate_noexpand()! - HeapWord* cas_allocate_noexpand(size_t word_size, int node) { + HeapWord* cas_allocate_noexpand(size_t word_size) { assert(SafepointSynchronize::is_at_safepoint(), "Must only be called at safepoint"); - HeapWord* res; - if(UseOldNUMA) { - res = object_space()->cas_allocate_oldnuma(word_size, node); - } - else { - res = object_space()->cas_allocate(word_size); - } + HeapWord* res = object_space()->cas_allocate(word_size); if (res != NULL) { _start_array.allocate_block(res); } @@ -96,13 +83,13 @@ } // Support for MT garbage collection. See above comment. - HeapWord* cas_allocate(size_t word_size, int node) { - HeapWord* res = cas_allocate_noexpand(word_size, node); - return (res == NULL) ? expand_and_cas_allocate(word_size, node) : res; + HeapWord* cas_allocate(size_t word_size) { + HeapWord* res = cas_allocate_noexpand(word_size); + return (res == NULL) ? expand_and_cas_allocate(word_size) : res; } HeapWord* expand_and_allocate(size_t word_size); - HeapWord* expand_and_cas_allocate(size_t word_size, int node); + HeapWord* expand_and_cas_allocate(size_t word_size); void expand(size_t bytes); bool expand_by(size_t bytes); bool expand_to_reserved(); @@ -160,22 +147,6 @@ size_t capacity_in_bytes() const { return object_space()->capacity_in_bytes(); } size_t used_in_bytes() const { return object_space()->used_in_bytes(); } size_t free_in_bytes() const { return object_space()->free_in_bytes(); } - size_t free_in_bytes_numa() const { - size_t min_size, free_bytes; - MutableNUMASpace* s = (MutableNUMASpace*) object_space(); - int i = s->lgrp_spaces()->length(); - int j; - MutableNUMASpace::LGRPSpace *ls; - MutableSpace* sp; - for(j = 0; j < i; j++) { - ls = s->lgrp_spaces()->at(j); - sp = ls->space(); - free_bytes = sp->free_in_bytes(); - if(j == 0) min_size = free_bytes; - if(free_bytes < min_size) min_size = free_bytes; - } - return min_size; - } size_t capacity_in_words() const { return object_space()->capacity_in_words(); } size_t used_in_words() const { return object_space()->used_in_words(); } diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp --- a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #include "precompiled.hpp" #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" @@ -2105,11 +2099,7 @@ // Let the size policy know we're done size_policy->major_collection_end(old_gen->used_in_bytes(), gc_cause); - /* 2014/2/12/ Liao: In UseOldNUMA, the size of old-gen should not be changed as the young-gen, - * when minorGC happens, the eden size will be emptied, so we can change the size of the eden - * size and then bind to each NUMA group, but in fullGC, the old-gen should not be emptied, so - * we let the old-gen should not be changed here. */ - if (UseAdaptiveSizePolicy && !UseOldNUMA) { + if (UseAdaptiveSizePolicy) { if (PrintAdaptiveSizePolicy) { gclog_or_tty->print("AdaptiveSizeStart: "); gclog_or_tty->stamp(); diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp --- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,17 +22,10 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #include "precompiled.hpp" #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/psPromotionLAB.hpp" #include "gc_implementation/shared/mutableSpace.hpp" -#include "gc_implementation/shared/mutableNUMASpace.hpp" #include "oops/oop.inline.hpp" size_t PSPromotionLAB::filler_header_size; @@ -164,28 +157,8 @@ PSOldGen* old_gen = heap->old_gen(); MemRegion used = old_gen->object_space()->used_region(); - /* 2014/2/12/ Liao: In UseOldNUMA, the new lab may be allocated out of the current used_region. - * For example, a new plab should be allocated in lgrp2, while the top of current used_region - * is in lgrp1. The original checking will return invalid, while this situation is reasonable. - * So we should check whether the lab is in one of the lgrps. */ - if(UseOldNUMA) { - MutableSpace* sp; - MutableNUMASpace::LGRPSpace *ls; - MutableNUMASpace* s = (MutableNUMASpace*) old_gen->object_space(); - int i, j; - i = s->lgrp_spaces()->length(); - for(j = 0; j < i; j++) { - ls = s->lgrp_spaces()->at(j); - sp = ls->space(); - used = sp ->used_region(); - if (used.contains(lab)) - return true; - } - } - else { - if (used.contains(lab)) { - return true; - } + if (used.contains(lab)) { + return true; } return false; diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp --- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #include "precompiled.hpp" #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/psOldGen.hpp" @@ -35,7 +29,6 @@ #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" #include "gc_implementation/shared/gcTrace.hpp" #include "gc_implementation/shared/mutableSpace.hpp" -#include "gc_implementation/shared/mutableNUMASpace.hpp" #include "memory/allocation.inline.hpp" #include "memory/memRegion.hpp" #include "memory/padded.inline.hpp" @@ -48,7 +41,6 @@ OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL; PSOldGen* PSPromotionManager::_old_gen = NULL; MutableSpace* PSPromotionManager::_young_space = NULL; -int node_ex = 0; void PSPromotionManager::initialize() { ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); @@ -165,16 +157,7 @@ assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); // We set the old lab's start array. - if(UseOldNUMA) { - MutableNUMASpace* s = (MutableNUMASpace*) heap->old_gen()->object_space(); - int i; - for(i = 0; i < s->lgrp_spaces()->length(); i++) { - _old_lab_oldnuma[i].set_start_array(old_gen()->start_array()); - } - } - else { - _old_lab.set_start_array(old_gen()->start_array()); - } + _old_lab.set_start_array(old_gen()->start_array()); uint queue_size; claimed_stack_depth()->initialize(); @@ -210,21 +193,7 @@ _young_gen_is_full = false; lab_base = old_gen()->object_space()->top(); - if(UseOldNUMA) { - MutableNUMASpace* s = (MutableNUMASpace*) heap->old_gen()->object_space(); - int i; - MutableNUMASpace::LGRPSpace *ls; - MutableSpace *sp; - for(i = 0; i < s->lgrp_spaces()->length(); i++) { - ls = s->lgrp_spaces()->at(i); - sp = ls->space(); - lab_base = sp->top(); - _old_lab_oldnuma[i].initialize(MemRegion(lab_base, (size_t)0)); - } - } - else { - _old_lab.initialize(MemRegion(lab_base, (size_t)0)); - } + _old_lab.initialize(MemRegion(lab_base, (size_t)0)); _old_gen_is_full = false; _promotion_failed_info.reset(); @@ -232,8 +201,8 @@ TASKQUEUE_STATS_ONLY(reset_stats()); } + void PSPromotionManager::drain_stacks_depth(bool totally_drain) { - Thread* thr = Thread::current(); totally_drain = totally_drain || _totally_drain; #ifdef ASSERT @@ -278,20 +247,9 @@ if (!_young_lab.is_flushed()) _young_lab.flush(); - if(UseOldNUMA) { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - MutableNUMASpace* s = (MutableNUMASpace*) heap->old_gen()->object_space(); - int i; - for(i = 0; i < s->lgrp_spaces()->length(); i++) { - if (!_old_lab_oldnuma[i].is_flushed()) - _old_lab_oldnuma[i].flush(); - } - } - else { - assert(!_old_lab.is_flushed() || _old_gen_is_full, "Sanity"); - if (!_old_lab.is_flushed()) - _old_lab.flush(); - } + assert(!_old_lab.is_flushed() || _old_gen_is_full, "Sanity"); + if (!_old_lab.is_flushed()) + _old_lab.flush(); // Let PSScavenge know if we overflowed if (_young_gen_is_full) { @@ -384,87 +342,3 @@ return obj; } - -//Used to recognise the location of oop o, in eden_space or old_space, or others? -int PSPromotionManager::get_oop_location(oop o) { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - MutableSpace* sp_eden = heap->young_gen()->eden_space(); - MutableSpace* sp_old = heap->old_gen()->object_space(); - HeapWord* temp_o = (HeapWord*) o; - if(temp_o > sp_eden->bottom() && temp_o < sp_eden->end()) - return 1; - else if (temp_o > sp_old->bottom() && temp_o < sp_old->end()) - return 2; - else - return (-1); -} - -// Used to get numa_node_id of Oop o, location = 1 means Oop o is in eden space, -// location = 2 means Oops o is in old space - -int PSPromotionManager::get_oop_node_id(oop o, int location) { - HeapWord* temp_o = (HeapWord*) o; - ParallelScavengeHeap* heap = (ParallelScavengeHeap*) Universe::heap(); - MutableNUMASpace* sp_eden = (MutableNUMASpace*) heap->young_gen()->eden_space(); - MutableNUMASpace* sp_old = (MutableNUMASpace*) heap->old_gen()->object_space(); - MutableNUMASpace::LGRPSpace *ls; - MutableSpace* sp_temp; - int i = sp_eden->lgrp_spaces()->length(); - int j; - - if(location == 1) { - for(j = 0; j < i; j++) { - ls = sp_eden->lgrp_spaces()->at(j); - sp_temp = ls->space(); - if(temp_o > sp_temp->bottom() && temp_o < sp_temp->end()) - return j; - } - } - else if(location == 2){ - for(j = 0; j < i; j++) { - ls = sp_old->lgrp_spaces()->at(j); - sp_temp = ls->space(); - if(temp_o > sp_temp->bottom() && temp_o < sp_temp->end()) - return j; - } - } - else { - tty->print_cr("Warning:Should not reach here!!!"); - } -} - -extern int task_tag[16]; -extern int each_total_num[16]; -extern int each_eden_total_num[3][16]; -extern int each_eden_aligned_num[3][16]; - -void PSPromotionManager::stastic_scavenge(oop o) { - // oop o is in eden - if(get_oop_location(o) == 1) { - each_total_num[os::numa_get_cpu_id()]++; - - // Used to stastic which Task handle this oop - if(task_tag[os::numa_get_cpu_id()] == 1) { - each_eden_total_num[0][os::numa_get_cpu_id()]++; - } - else if(task_tag[os::numa_get_cpu_id()] == 2) { - each_eden_total_num[1][os::numa_get_cpu_id()]++; - } - else if(task_tag[os::numa_get_cpu_id()] == 3) { - each_eden_total_num[2][os::numa_get_cpu_id()]++; - } - - // Used to stastic the propotion of oop on the same node of GC Thread - if(get_oop_node_id(o, 1) == os::numa_get_group_id()) { - if(task_tag[os::numa_get_cpu_id()] == 1) { - each_eden_aligned_num[0][os::numa_get_cpu_id()]++; - } - else if(task_tag[os::numa_get_cpu_id()] == 2) { - each_eden_aligned_num[1][os::numa_get_cpu_id()]++; - } - else if(task_tag[os::numa_get_cpu_id()] == 3) { - each_eden_aligned_num[2][os::numa_get_cpu_id()]++; - } - } - } -} diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp --- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP @@ -83,7 +77,6 @@ PSYoungPromotionLAB _young_lab; PSOldPromotionLAB _old_lab; - PSOldPromotionLAB _old_lab_oldnuma[4]; bool _young_gen_is_full; bool _old_gen_is_full; @@ -183,11 +176,6 @@ bool old_gen_is_full() { return _old_gen_is_full; } void set_old_gen_is_full(bool state) { _old_gen_is_full = state; } - //Stastic methods - int get_oop_location(oop o); - int get_oop_node_id(oop o, int location); - void stastic_scavenge(oop o); - // Promotion methods template oop copy_to_survivor_space(oop o); oop oop_promotion_failed(oop obj, markOop obj_mark); diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp --- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,19 +22,12 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP #include "gc_implementation/parallelScavenge/psOldGen.hpp" #include "gc_implementation/parallelScavenge/psPromotionManager.hpp" #include "gc_implementation/parallelScavenge/psScavenge.hpp" -#include "gc_implementation/shared/mutableNUMASpace.hpp" #include "oops/oop.psgc.inline.hpp" inline PSPromotionManager* PSPromotionManager::manager_array(int index) { @@ -75,11 +68,6 @@ // into smaller submethods, but we need to be careful not to hurt // performance. // - -extern int node_ex; -extern int each_gc_copy_fre[16]; -extern float each_gc_copy_time[16]; - template oop PSPromotionManager::copy_to_survivor_space(oop o) { assert(PSScavenge::should_scavenge(&o), "Sanity"); @@ -95,10 +83,6 @@ if (!test_mark->is_marked()) { bool new_obj_is_tenured = false; size_t new_obj_size = o->size(); - - if(UseStasticScavenge) { - stastic_scavenge(o); - } if (!promote_immediately) { // Find the objects age, MT safe. @@ -138,154 +122,53 @@ } #endif // #ifndef PRODUCT - if(UseOldNUMA) { -/* 2014/7/7 Liao: Copy objects to the same node of current GC thread */ - if(UseNUMAGC) { - new_obj = (oop) _old_lab_oldnuma[os::numa_get_group_id()].allocate(new_obj_size); - new_obj_is_tenured = true; + new_obj = (oop) _old_lab.allocate(new_obj_size); + new_obj_is_tenured = true; - if (new_obj == NULL) { - if (!_old_gen_is_full) { - // Do we allocate directly, or flush and refill? - if (new_obj_size > (OldPLABSize / 2)) { - // Allocate this object directly - new_obj = (oop)old_gen()->cas_allocate(new_obj_size, os::numa_get_group_id()); - } else { - // Flush and fill - _old_lab_oldnuma[os::numa_get_group_id()].flush(); + if (new_obj == NULL) { + if (!_old_gen_is_full) { + // Do we allocate directly, or flush and refill? + if (new_obj_size > (OldPLABSize / 2)) { + // Allocate this object directly + new_obj = (oop)old_gen()->cas_allocate(new_obj_size); + } else { + // Flush and fill + _old_lab.flush(); - HeapWord* lab_base = old_gen()->cas_allocate(OldPLABSize, os::numa_get_group_id()); - if(lab_base != NULL) { - _old_lab_oldnuma[os::numa_get_group_id()].initialize(MemRegion(lab_base, OldPLABSize)); - // Try the old lab allocation again. - new_obj = (oop) _old_lab_oldnuma[os::numa_get_group_id()].allocate(new_obj_size); - } + HeapWord* lab_base = old_gen()->cas_allocate(OldPLABSize); + if(lab_base != NULL) { +#ifdef ASSERT + // Delay the initialization of the promotion lab (plab). + // This exposes uninitialized plabs to card table processing. + if (GCWorkerDelayMillis > 0) { + os::sleep(Thread::current(), GCWorkerDelayMillis, false); } - } - - // This is the promotion failed test, and code handling. - // The code belongs here for two reasons. It is slightly - // different than the code below, and cannot share the - // CAS testing code. Keeping the code here also minimizes - // the impact on the common case fast path code. - - if (new_obj == NULL) { - _old_gen_is_full = true; - return oop_promotion_failed(o, test_mark); +#endif + _old_lab.initialize(MemRegion(lab_base, OldPLABSize)); + // Try the old lab allocation again. + new_obj = (oop) _old_lab.allocate(new_obj_size); } } } - else { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - MutableNUMASpace* s = (MutableNUMASpace*) heap->old_gen()->object_space(); - int i = s->lgrp_spaces()->length(); - int node; - if(i > 1) { - node = node_ex % (i - 1) + 1; - node_ex++; - } - else - node = 0; - new_obj = (oop) _old_lab_oldnuma[node].allocate(new_obj_size); - new_obj_is_tenured = true; - - if (new_obj == NULL) { - if (!_old_gen_is_full) { - // Do we allocate directly, or flush and refill? - if (new_obj_size > (OldPLABSize / 2)) { - // Allocate this object directly - new_obj = (oop)old_gen()->cas_allocate(new_obj_size, node); - } else { - // Flush and fill - _old_lab_oldnuma[node].flush(); - - HeapWord* lab_base = old_gen()->cas_allocate(OldPLABSize, node); - if(lab_base != NULL) { - _old_lab_oldnuma[node].initialize(MemRegion(lab_base, OldPLABSize)); - // Try the old lab allocation again. - new_obj = (oop) _old_lab_oldnuma[node].allocate(new_obj_size); - } - } - } - - // This is the promotion failed test, and code handling. - // The code belongs here for two reasons. It is slightly - // different than the code below, and cannot share the - // CAS testing code. Keeping the code here also minimizes - // the impact on the common case fast path code. - - if (new_obj == NULL) { - _old_gen_is_full = true; - return oop_promotion_failed(o, test_mark); - } - } - } - } - else { - new_obj = (oop) _old_lab.allocate(new_obj_size); - new_obj_is_tenured = true; + // This is the promotion failed test, and code handling. + // The code belongs here for two reasons. It is slightly + // different than the code below, and cannot share the + // CAS testing code. Keeping the code here also minimizes + // the impact on the common case fast path code. if (new_obj == NULL) { - if (!_old_gen_is_full) { - // Do we allocate directly, or flush and refill? - if (new_obj_size > (OldPLABSize / 2)) { - // Allocate this object directly - new_obj = (oop)old_gen()->cas_allocate(new_obj_size, 0); - } else { - // Flush and fill - _old_lab.flush(); - - HeapWord* lab_base = old_gen()->cas_allocate(OldPLABSize, 0); - if(lab_base != NULL) { -#ifdef ASSERT - // Delay the initialization of the promotion lab (plab). - // This exposes uninitialized plabs to card table processing. - if (GCWorkerDelayMillis > 0) { - os::sleep(Thread::current(), GCWorkerDelayMillis, false); - } -#endif - _old_lab.initialize(MemRegion(lab_base, OldPLABSize)); - // Try the old lab allocation again. - new_obj = (oop) _old_lab.allocate(new_obj_size); - } - } - } - - // This is the promotion failed test, and code handling. - // The code belongs here for two reasons. It is slightly - // different than the code below, and cannot share the - // CAS testing code. Keeping the code here also minimizes - // the impact on the common case fast path code. - - if (new_obj == NULL) { - _old_gen_is_full = true; - return oop_promotion_failed(o, test_mark); - } + _old_gen_is_full = true; + return oop_promotion_failed(o, test_mark); } } } assert(new_obj != NULL, "allocation should have succeeded"); - TimeStamp before_copy, after_copy; - - if(UseStasticCopy) { - before_copy.update(); - } - // Copy obj Copy::aligned_disjoint_words((HeapWord*)o, (HeapWord*)new_obj, new_obj_size); - if(UseStasticCopy) { - after_copy.update(); - } - - if(UseStasticCopy) { - each_gc_copy_time[os::numa_get_cpu_id()] += after_copy.ticks() - before_copy.ticks(); - each_gc_copy_fre[os::numa_get_cpu_id()]++; - } - // Now we have to CAS in the header. if (o->cas_forward_to(new_obj, test_mark)) { // We won any races, we "own" this object. @@ -322,20 +205,8 @@ // deallocate it, so we have to test. If the deallocation fails, // overwrite with a filler object. if (new_obj_is_tenured) { - if(UseOldNUMA) { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - MutableNUMASpace* s = (MutableNUMASpace*) heap->old_gen()->object_space(); - int i; - for(i = 0; i < s->lgrp_spaces()->length(); i++) { - if (!_old_lab_oldnuma[i].unallocate_object((HeapWord*) new_obj, new_obj_size)) { - CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size); - } - } - } - else { - if (!_old_lab.unallocate_object((HeapWord*) new_obj, new_obj_size)) { - CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size); - } + if (!_old_lab.unallocate_object((HeapWord*) new_obj, new_obj_size)) { + CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size); } } else if (!_young_lab.unallocate_object((HeapWord*) new_obj, new_obj_size)) { CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size); @@ -362,6 +233,7 @@ return new_obj; } + inline void PSPromotionManager::process_popped_location_depth(StarTask p) { if (is_oop_masked(p)) { assert(PSChunkLargeArrays, "invariant"); diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp --- a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #include "precompiled.hpp" #include "classfile/symbolTable.hpp" #include "code/codeCache.hpp" @@ -44,7 +38,6 @@ #include "gc_implementation/shared/gcTrace.hpp" #include "gc_implementation/shared/gcTraceTime.hpp" #include "gc_implementation/shared/isGCActiveMark.hpp" -#include "gc_implementation/shared/mutableNUMASpace.hpp" #include "gc_implementation/shared/spaceDecorator.hpp" #include "gc_interface/gcCause.hpp" #include "memory/collectorPolicy.hpp" @@ -237,15 +230,8 @@ IsGCActiveMark mark; const bool scavenge_done = PSScavenge::invoke_no_policy(); - bool need_full_gc; - if(UseOldNUMA) { - need_full_gc = !scavenge_done || - policy->should_full_GC(heap->old_gen()->free_in_bytes_numa()); - } - else { - need_full_gc = !scavenge_done || - policy->should_full_GC(heap->old_gen()->free_in_bytes()); - } + const bool need_full_gc = !scavenge_done || + policy->should_full_GC(heap->old_gen()->free_in_bytes()); bool full_gc_done = false; if (UsePerfData) { @@ -269,30 +255,6 @@ return full_gc_done; } -/* 2014/7/7 Liao: Add these variables to stastic detail information during GC. */ -/* Used for objects copy stastic. */ -float each_gc_copy_time[16]; -int each_gc_copy_fre[16]; - -/* Used for GC details stastic. */ -float total_gc_time = 0; -int total_gc_fre = 0; - -/* Used to statstic ThreadRoots optimization. */ -int task_tag[16]; -//Used to stastic each cpu -int each_total_num[16]; -int each_eden_total_num[3][16]; -int each_eden_aligned_num[3][16]; -//Used to stastic every GC -int every_total_num; -int every_eden_total_num[3]; -int every_eden_aligned_num[3]; -//Used to stastic all the time -int all_total_num; -int all_eden_total_num[3]; -int all_eden_aligned_num[3]; - // This method contains no policy. You should probably // be calling invoke() instead. bool PSScavenge::invoke_no_policy() { @@ -346,29 +308,6 @@ heap->record_gen_tops_before_GC(); } - if(UseStasticCopy) { - for(uint i = 0; i < ParallelGCThreads; i++) { - each_gc_copy_time[i] = 0; - each_gc_copy_fre[i] = 0; - } - } - - if(UseStasticScavenge) { - for(int j = 0; j < 3; j++) { - for(uint i = 0; i < ParallelGCThreads; i++) { - task_tag[i] = 0; - - each_total_num[i] = 0; - each_eden_total_num[j][i] = 0; - each_eden_aligned_num[j][i] = 0; - - every_total_num = 0; - every_eden_total_num[j] = 0; - every_eden_aligned_num[j] = 0; - } - } - } - heap->print_heap_before_gc(); heap->trace_heap_before_gc(&_gc_tracer); @@ -463,34 +402,12 @@ GCTaskQueue* q = GCTaskQueue::create(); - if(UseOldNUMA) { - MutableSpace* sp; - MutableNUMASpace::LGRPSpace *ls; - MutableNUMASpace* s = (MutableNUMASpace*) old_gen->object_space(); - int i, j; - i = s->lgrp_spaces()->length(); - HeapWord** gen_top = (HeapWord**) malloc (i * sizeof(HeapWord)); - for(j = 0; j < i; j++) { - ls = s->lgrp_spaces()->at(j); - sp = ls->space(); - *(gen_top + j) = sp->top(); - } - - if (!old_gen->object_space()->is_empty()) { - uint stripe_total = active_workers; - for(uint i=0; i < stripe_total; i++) { - q->enqueue(new OldToYoungRootsTask_OldNUMA(old_gen, gen_top, i, stripe_total)); - } - } - } - else { - if (!old_gen->object_space()->is_empty()) { - // There are only old-to-young pointers if there are objects - // in the old gen. - uint stripe_total = active_workers; - for(uint i=0; i < stripe_total; i++) { - q->enqueue(new OldToYoungRootsTask(old_gen, old_top, i, stripe_total)); - } + if (!old_gen->object_space()->is_empty()) { + // There are only old-to-young pointers if there are objects + // in the old gen. + uint stripe_total = active_workers; + for(uint i=0; i < stripe_total; i++) { + q->enqueue(new OldToYoungRootsTask(old_gen, old_top, i, stripe_total)); } } @@ -781,56 +698,6 @@ scavenge_exit.ticks()); gc_task_manager()->print_task_time_stamps(); } - - if(PrintGCDetails) { - float young_gc_time; - total_gc_fre++; - young_gc_time = ((float)(scavenge_exit.ticks() - scavenge_entry.ticks()))/1e9; - total_gc_time = total_gc_time + ((float)(scavenge_exit.ticks() - scavenge_entry.ticks()))/1e9; - tty->print_cr("total_gc_fre = %d, young_gc_time = %f, total_gc_time = %f", total_gc_fre, young_gc_time, total_gc_time); - } - - if(UseStasticCopy) { - for(uint i = 0; i < ParallelGCThreads; i++) { - tty->print_cr("each_gc_copy_time[%d] = %f", i, each_gc_copy_time[i]/each_gc_copy_fre[i]); - } - tty->print_cr(""); - for(uint i = 0; i < ParallelGCThreads; i++) { - tty->print_cr("each_gc_copy_fre[%d] = %d", i, each_gc_copy_fre[i]); - } - } - - if(UseStasticScavenge) { - for(int i = 0; i < 3; i++) { - for(uint j = 0; j < ParallelGCThreads; j++) { - every_eden_total_num[i] += each_eden_total_num[i][j]; - every_eden_aligned_num[i] += each_eden_aligned_num[i][j]; - } - } - - for(uint i = 0; i < ParallelGCThreads; i++) { - every_total_num += each_total_num[i]; - } - - all_total_num += every_total_num; - - for(int i = 0; i < 3; i++) { - all_eden_total_num[i] += every_eden_total_num[i]; - all_eden_aligned_num[i] += every_eden_aligned_num[i]; - } - - tty->print_cr("============= Every GCDetails: ============="); - tty->print_cr("ThreadRootTask: prop of all = %f, prop of aligned = %f", (float)every_eden_total_num[0]/(float)every_total_num, (float)every_eden_aligned_num[0]/(float)every_eden_total_num[0]); - tty->print_cr("OldToYoungRootTask: prop of all = %f, prop of aligned = %f", (float)every_eden_total_num[1]/(float)every_total_num, (float)every_eden_aligned_num[1]/(float)every_eden_total_num[1]); - tty->print_cr("StealTask: prop of all = %f, prop of aligned = %f", (float)every_eden_total_num[2]/(float)every_total_num, (float)every_eden_aligned_num[2]/(float)every_eden_total_num[2]); - tty->print_cr(""); - - tty->print_cr("============= Total GCDetails: ============="); - tty->print_cr("ThreadRootTask: prop of all = %f, prop of aligned = %f", (float)all_eden_total_num[0]/(float)all_total_num, (float)all_eden_aligned_num[0]/(float)all_eden_total_num[0]); - tty->print_cr("OldToYoungRootTask: prop of all = %f, prop of aligned = %f", (float)all_eden_total_num[1]/(float)all_total_num, (float)all_eden_aligned_num[1]/(float)all_eden_total_num[1]); - tty->print_cr("StealTask: prop of all = %f, prop of aligned = %f", (float)all_eden_total_num[2]/(float)all_total_num, (float)all_eden_aligned_num[2]/(float)all_eden_total_num[2]); - tty->print_cr(""); - } #ifdef TRACESPINNING ParallelTaskTerminator::print_termination_counts(); diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp --- a/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" #include "code/codeCache.hpp" @@ -38,7 +32,6 @@ #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" #include "gc_implementation/parallelScavenge/psTasks.hpp" -#include "gc_implementation/shared/mutableNUMASpace.hpp" #include "memory/iterator.hpp" #include "memory/universe.hpp" #include "oops/oop.inline.hpp" @@ -123,9 +116,8 @@ // // ThreadRootsTask // -extern int task_tag[16]; + void ThreadRootsTask::do_it(GCTaskManager* manager, uint which) { - task_tag[which] = 1; assert(Universe::heap()->is_gc_active(), "called outside gc"); PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which); @@ -148,12 +140,9 @@ // StealTask::StealTask(ParallelTaskTerminator* t) : - _terminator(t) {set_task_numa_id(-1);} + _terminator(t) {} void StealTask::do_it(GCTaskManager* manager, uint which) { - - task_tag[which] = 3; - assert(Universe::heap()->is_gc_active(), "called outside gc"); PSPromotionManager* pm = @@ -183,7 +172,6 @@ // void OldToYoungRootsTask::do_it(GCTaskManager* manager, uint which) { - task_tag[which] = 2; // There are not old-to-young pointers if the old gen is empty. assert(!_gen->object_space()->is_empty(), "Should not be called is there is no work"); @@ -209,56 +197,3 @@ pm->drain_stacks(false); } } - -// -// OldToYoungRootsTask_OldNUMA -// - -void OldToYoungRootsTask_OldNUMA::do_it(GCTaskManager* manager, uint which) { - assert(_gen != NULL, "Sanity"); - assert(_stripe_number < ParallelGCThreads, "Sanity"); - - { - PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which); - - assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - CardTableExtension* card_table = (CardTableExtension *)Universe::heap()->barrier_set(); - // FIX ME! Assert that card_table is the type we believe it to be. - - MutableNUMASpace* s = (MutableNUMASpace*) _gen->object_space(); - int i = s->lgrp_spaces()->length(); - int j; - for(j = 0; j < i; j++) { - MutableNUMASpace::LGRPSpace *ls = s->lgrp_spaces()->at(j); - MutableSpace* sp = ls->space(); - /* 2014/2/12/ Liao:[cardTableExtension.cpp] assert(sp->bottom() < sp->top(), "Should not be called if empty"); - * The situation sp->bottom() = sp->top() indicates that the lgrp is empty, - * so no need of the following operations. */ - if(sp->bottom() != sp->top()) { - if(j == 0) { - card_table->scavenge_contents_parallel(_gen->start_array(), - sp, - *(_gen_top + j), - pm, - _stripe_number, - _stripe_total); - - } - else { - MutableNUMASpace::LGRPSpace *ls_below = s->lgrp_spaces()->at(j-1); - MutableSpace* sp_below = ls_below->space(); - card_table->scavenge_contents_parallel_oldnuma(_gen->start_array(), - sp_below, - sp, - *(_gen_top + j), - pm, - _stripe_number, - _stripe_total); - } - } - } - // Do the real work - pm->drain_stacks(false); - } -} - diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp --- a/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSTASKS_HPP #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSTASKS_HPP @@ -73,7 +67,7 @@ private: RootType _root_type; public: - ScavengeRootsTask(RootType value) : _root_type(value) {set_task_numa_id(-1);} + ScavengeRootsTask(RootType value) : _root_type(value) {} char* name() { return (char *)"scavenge-roots-task"; } @@ -92,8 +86,8 @@ JavaThread* _java_thread; VMThread* _vm_thread; public: - ThreadRootsTask(JavaThread* root) : _java_thread(root), _vm_thread(NULL) {set_task_numa_id(root->lgrp_id());} - ThreadRootsTask(VMThread* root) : _java_thread(NULL), _vm_thread(root) {set_task_numa_id(root->lgrp_id());} + ThreadRootsTask(JavaThread* root) : _java_thread(root), _vm_thread(NULL) {} + ThreadRootsTask(VMThread* root) : _java_thread(NULL), _vm_thread(root) {} char* name() { return (char *)"thread-roots-task"; } @@ -179,34 +173,11 @@ _gen(gen), _gen_top(gen_top), _stripe_number(stripe_number), - _stripe_total(stripe_total) {set_task_numa_id(-1);} + _stripe_total(stripe_total) { } char* name() { return (char *)"old-to-young-roots-task"; } virtual void do_it(GCTaskManager* manager, uint which); }; -class OldToYoungRootsTask_OldNUMA : public GCTask { - private: - PSOldGen* _gen; - HeapWord** _gen_top; - uint _stripe_number; - uint _stripe_total; - - public: - OldToYoungRootsTask_OldNUMA(PSOldGen *gen, - HeapWord** gen_top, - uint stripe_number, - uint stripe_total) : - _gen(gen), - _gen_top(gen_top), - _stripe_number(stripe_number), - _stripe_total(stripe_total) {set_task_numa_id(-1);} - - char* name() { return (char *)"OldNUMA-old-to-young-roots-task"; } - - virtual void do_it(GCTaskManager* manager, uint which); -}; - - #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSTASKS_HPP diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp --- a/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp Fri Jun 24 17:12:13 2016 +0800 @@ -23,12 +23,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #include "precompiled.hpp" #include "gc_implementation/shared/mutableNUMASpace.hpp" #include "gc_implementation/shared/spaceDecorator.hpp" @@ -873,43 +867,6 @@ return p; } -HeapWord* MutableNUMASpace::cas_allocate_oldnuma(size_t size, int node) { - LGRPSpace *ls = lgrp_spaces()->at(node); - MutableSpace *s = ls->space(); - HeapWord *p = s->cas_allocate(size); - if (p != NULL) { - size_t remainder = pointer_delta(s->end(), p + size); - if (remainder < CollectedHeap::min_fill_size() && remainder > 0) { - if (s->cas_deallocate(p, size)) { - // We were the last to allocate and created a fragment less than - // a minimal object. - p = NULL; - } else { - guarantee(false, "Deallocation should always succeed"); - } - } - } - if (p != NULL) { - HeapWord* cur_top, *cur_chunk_top = p + size; - while ((cur_top = top()) < cur_chunk_top) { // Keep _top updated. - if (Atomic::cmpxchg_ptr(cur_chunk_top, top_addr(), cur_top) == cur_top) { - break; - } - } - } - - // Make the page allocation happen here if there is no static binding. - if (p != NULL && !os::numa_has_static_binding() ) { - for (HeapWord *i = p; i < p + size; i += os::vm_page_size() >> LogHeapWordSize) { - *(int*)i = 0; - } - } - if (p == NULL) { - ls->set_allocation_failed(); - } - return p; -} - void MutableNUMASpace::print_short_on(outputStream* st) const { MutableSpace::print_short_on(st); st->print(" ("); diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp --- a/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLENUMASPACE_HPP #define SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLENUMASPACE_HPP @@ -69,14 +63,6 @@ class MutableNUMASpace : public MutableSpace { friend class VMStructs; - friend class CardTableExtension; - friend class OldToYoungRootsTask; - friend class OldToYoungRootsTask_OldNUMA; - friend class PSScavenge; - friend class PSOldGen; - friend class PSYoungGen; - friend class PSPromotionManager; - friend class PSOldPromotionLAB; class LGRPSpace : public CHeapObj { int _lgrp_id; @@ -237,9 +223,6 @@ // Allocation (return NULL if full) virtual HeapWord* allocate(size_t word_size); virtual HeapWord* cas_allocate(size_t word_size); - - // Allocation for Old NUMA (return NULL if full) - virtual HeapWord* cas_allocate_oldnuma(size_t word_size, int node); // Debugging virtual void print_on(outputStream* st) const; diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/shared/mutableSpace.cpp --- a/src/share/vm/gc_implementation/shared/mutableSpace.cpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/shared/mutableSpace.cpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #include "precompiled.hpp" #include "utilities/macros.hpp" #if INCLUDE_ALL_GCS @@ -219,8 +213,6 @@ } while (true); } -HeapWord* MutableSpace::cas_allocate_oldnuma(size_t size, int node) { } - // Try to deallocate previous allocation. Returns true upon success. bool MutableSpace::cas_deallocate(HeapWord *obj, size_t size) { HeapWord* expected_top = obj + size; diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/gc_implementation/shared/mutableSpace.hpp --- a/src/share/vm/gc_implementation/shared/mutableSpace.hpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/gc_implementation/shared/mutableSpace.hpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLESPACE_HPP #define SHARE_VM_GC_IMPLEMENTATION_SHARED_MUTABLESPACE_HPP @@ -136,10 +130,6 @@ // Allocation (return NULL if full) virtual HeapWord* allocate(size_t word_size); virtual HeapWord* cas_allocate(size_t word_size); - - // Allocation for Old NUMA (return NULL if full) - virtual HeapWord* cas_allocate_oldnuma(size_t word_size, int node); - // Optional deallocation. Used in NUMA-allocator. bool cas_deallocate(HeapWord *obj, size_t size); diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/runtime/arguments.cpp --- a/src/share/vm/runtime/arguments.cpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/runtime/arguments.cpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #include "precompiled.hpp" #include "classfile/javaAssertions.hpp" #include "classfile/symbolTable.hpp" @@ -1660,32 +1654,6 @@ } void Arguments::set_heap_size() { -#ifdef MIPS64 - /* 2013/10/24 Jin: Force -Xmx2.5G */ - if(InitialHeapSize < MaxHeapSize) { - InitialHeapSize = MaxHeapSize; - set_min_heap_size(MaxHeapSize); - return; - } - /* 2014/3/14 Liao: The default InitialHeapSize and MaxHeapSize is set 3g in loongsonJDK, - * if we only set -Xmx<3G(e.g. -Xmx1g), or -Xms>3g(e.g. -Xms4g), the heapsize is conflicated, - * so we must handle this situation. Using set_min_heap_size aims to set the NewSize reasonable.*/ - if(!FLAG_IS_DEFAULT(InitialHeapSize) && InitialHeapSize > MaxHeapSize) { - MaxHeapSize = InitialHeapSize; - set_min_heap_size(MaxHeapSize); - return; - } - if(!FLAG_IS_DEFAULT(MaxHeapSize) && InitialHeapSize > MaxHeapSize) { - InitialHeapSize = MaxHeapSize; - set_min_heap_size(MaxHeapSize); - return; - } - if (FLAG_IS_DEFAULT(InitialHeapSize) && FLAG_IS_DEFAULT(MaxHeapSize)) { - set_min_heap_size(MaxHeapSize); - return; - } -#endif - if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) { // Deprecated flag FLAG_SET_CMDLINE(uintx, MaxRAMFraction, DefaultMaxRAMFraction); diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/runtime/globals.hpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #ifndef SHARE_VM_RUNTIME_GLOBALS_HPP #define SHARE_VM_RUNTIME_GLOBALS_HPP @@ -575,28 +569,9 @@ develop(bool, TracePageSizes, false, \ "Trace page size selection and usage") \ \ - /* 2013/12/18 Jin: disable UseNUMA until OS is fixed*/ \ - product(bool, UseNUMA, MIPS64_ONLY(false) NOT_MIPS64(false), \ + product(bool, UseNUMA, false, \ "Use NUMA if available") \ \ - product(bool, UseOldNUMA, MIPS64_ONLY(true) NOT_MIPS64(false), \ - "Use Old NUMA if available") \ - \ - product(bool, UseNUMAThreadRoots, MIPS64_ONLY(true) NOT_MIPS64(false), \ - "Use NUMAThreadRoots if available") \ - \ - product(bool, UseNUMASteal, MIPS64_ONLY(true) NOT_MIPS64(false), \ - "Use NUMASteal if available") \ - \ - product(bool, UseNUMAGC, MIPS64_ONLY(true) NOT_MIPS64(false), \ - "Use NUMAGC if available") \ - \ - product(bool, UseStasticScavenge, false, \ - "Use StasticScavenge if available") \ - \ - product(bool, UseStasticCopy, false, \ - "Use StasticCopy if available") \ - \ product(bool, UseNUMAInterleaving, false, \ "Interleave memory across NUMA nodes if available") \ \ @@ -2294,7 +2269,7 @@ diagnostic(uintx, CPUForCMSThread, 0, \ "When BindCMSThreadToCPU is true, the CPU to bind CMS thread to") \ \ - product(bool, BindGCTaskThreadsToCPUs, MIPS64_ONLY(true) NOT_MIPS64(false), \ + product(bool, BindGCTaskThreadsToCPUs, false, \ "Bind GCTaskThreads to CPUs if possible") \ \ product(bool, UseGCTaskAffinity, false, \ @@ -3140,10 +3115,10 @@ "Number of times to spin wait before inflation") \ \ /* gc parameters */ \ - product(uintx, InitialHeapSize, ScaleForWordSize(MIPS64_ONLY(2500) NOT_MIPS64(0) *M), \ + product(uintx, InitialHeapSize, 0, \ "Initial heap size (in bytes); zero means use ergonomics") \ \ - product(uintx, MaxHeapSize, ScaleForWordSize(MIPS64_ONLY(2500) NOT_MIPS64(96) *M), \ + product(uintx, MaxHeapSize, ScaleForWordSize(96*M), \ "Maximum heap size (in bytes)") \ \ product(uintx, OldSize, ScaleForWordSize(4*M), \ diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/runtime/os.hpp --- a/src/share/vm/runtime/os.hpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/runtime/os.hpp Fri Jun 24 17:12:13 2016 +0800 @@ -342,7 +342,6 @@ static size_t numa_get_leaf_groups(int *ids, size_t size); static bool numa_topology_changed(); static int numa_get_group_id(); - static int numa_get_cpu_id(); // Page manipulation struct page_info { diff -r d2be62fdfa50 -r 873fd82b133d src/share/vm/utilities/taskqueue.hpp --- a/src/share/vm/utilities/taskqueue.hpp Wed Jun 22 14:26:49 2016 +0800 +++ b/src/share/vm/utilities/taskqueue.hpp Fri Jun 24 17:12:13 2016 +0800 @@ -22,12 +22,6 @@ * */ -/* - * This file has been modified by Loongson Technology in 2015. These - * modifications are Copyright (c) 2015 Loongson Technology, and are made - * available on the same license terms set forth above. - */ - #ifndef SHARE_VM_UTILITIES_TASKQUEUE_HPP #define SHARE_VM_UTILITIES_TASKQUEUE_HPP @@ -594,34 +588,15 @@ template bool GenericTaskQueueSet::steal_best_of_2(uint queue_num, int* seed, E& t) { if (_n > 2) { - if(UseNUMASteal) { - uint i = 10; - uint k = queue_num; - while ((k == queue_num || (k - queue_num) > 3 || (queue_num - k) > 3) && i > 0) { - i--; - k = TaskQueueSetSuper::randomParkAndMiller(seed) % _n; - } - if(i > 0) { - return _queues[k]->pop_global(t); - } - else { - while (k == queue_num) { - k = TaskQueueSetSuper::randomParkAndMiller(seed) % _n; - } - return _queues[k]->pop_global(t); - } - } - else{ - uint k1 = queue_num; - while (k1 == queue_num) k1 = TaskQueueSetSuper::randomParkAndMiller(seed) % _n; - uint k2 = queue_num; - while (k2 == queue_num || k2 == k1) k2 = TaskQueueSetSuper::randomParkAndMiller(seed) % _n; - // Sample both and try the larger. - uint sz1 = _queues[k1]->size(); - uint sz2 = _queues[k2]->size(); - if (sz2 > sz1) return _queues[k2]->pop_global(t); - else return _queues[k1]->pop_global(t); - } + uint k1 = queue_num; + while (k1 == queue_num) k1 = TaskQueueSetSuper::randomParkAndMiller(seed) % _n; + uint k2 = queue_num; + while (k2 == queue_num || k2 == k1) k2 = TaskQueueSetSuper::randomParkAndMiller(seed) % _n; + // Sample both and try the larger. + uint sz1 = _queues[k1]->size(); + uint sz2 = _queues[k2]->size(); + if (sz2 > sz1) return _queues[k2]->pop_global(t); + else return _queues[k1]->pop_global(t); } else if (_n == 2) { // Just try the other one. uint k = (queue_num + 1) % 2;