提交 3d730e82 编写于 作者: J jmasa

Merge

...@@ -2835,7 +2835,7 @@ void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { ...@@ -2835,7 +2835,7 @@ void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
#endif #endif
} }
void os::free_memory(char *addr, size_t bytes) { void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) {
::madvise(addr, bytes, MADV_DONTNEED); ::madvise(addr, bytes, MADV_DONTNEED);
} }
......
...@@ -2546,8 +2546,8 @@ void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { ...@@ -2546,8 +2546,8 @@ void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
} }
} }
void os::free_memory(char *addr, size_t bytes) { void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) {
commit_memory(addr, bytes, false); commit_memory(addr, bytes, alignment_hint, false);
} }
void os::numa_make_global(char *addr, size_t bytes) { void os::numa_make_global(char *addr, size_t bytes) {
......
...@@ -2821,7 +2821,7 @@ bool os::commit_memory(char* addr, size_t bytes, size_t alignment_hint, ...@@ -2821,7 +2821,7 @@ bool os::commit_memory(char* addr, size_t bytes, size_t alignment_hint,
} }
// Uncommit the pages in a specified region. // Uncommit the pages in a specified region.
void os::free_memory(char* addr, size_t bytes) { void os::free_memory(char* addr, size_t bytes, size_t alignment_hint) {
if (madvise(addr, bytes, MADV_FREE) < 0) { if (madvise(addr, bytes, MADV_FREE) < 0) {
debug_only(warning("MADV_FREE failed.")); debug_only(warning("MADV_FREE failed."));
return; return;
......
...@@ -3130,7 +3130,7 @@ bool os::unguard_memory(char* addr, size_t bytes) { ...@@ -3130,7 +3130,7 @@ bool os::unguard_memory(char* addr, size_t bytes) {
} }
void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { } void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { }
void os::free_memory(char *addr, size_t bytes) { } void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) { }
void os::numa_make_global(char *addr, size_t bytes) { } void os::numa_make_global(char *addr, size_t bytes) { }
void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) { } void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) { }
bool os::numa_topology_changed() { return false; } bool os::numa_topology_changed() { return false; }
......
...@@ -726,12 +726,8 @@ void ConcurrentMark::set_non_marking_state() { ...@@ -726,12 +726,8 @@ void ConcurrentMark::set_non_marking_state() {
} }
ConcurrentMark::~ConcurrentMark() { ConcurrentMark::~ConcurrentMark() {
for (int i = 0; i < (int) _max_task_num; ++i) { // The ConcurrentMark instance is never freed.
delete _task_queues->queue(i); ShouldNotReachHere();
delete _tasks[i];
}
delete _task_queues;
FREE_C_HEAP_ARRAY(CMTask*, _max_task_num);
} }
// This closure is used to mark refs into the g1 generation // This closure is used to mark refs into the g1 generation
......
...@@ -282,7 +282,7 @@ void MutableNUMASpace::bias_region(MemRegion mr, int lgrp_id) { ...@@ -282,7 +282,7 @@ void MutableNUMASpace::bias_region(MemRegion mr, int lgrp_id) {
// large page can be broken down if we require small pages. // large page can be broken down if we require small pages.
os::realign_memory((char*)aligned_region.start(), aligned_region.byte_size(), page_size()); os::realign_memory((char*)aligned_region.start(), aligned_region.byte_size(), page_size());
// Then we uncommit the pages in the range. // Then we uncommit the pages in the range.
os::free_memory((char*)aligned_region.start(), aligned_region.byte_size()); os::free_memory((char*)aligned_region.start(), aligned_region.byte_size(), page_size());
// And make them local/first-touch biased. // And make them local/first-touch biased.
os::numa_make_local((char*)aligned_region.start(), aligned_region.byte_size(), lgrp_id); os::numa_make_local((char*)aligned_region.start(), aligned_region.byte_size(), lgrp_id);
} }
...@@ -297,7 +297,7 @@ void MutableNUMASpace::free_region(MemRegion mr) { ...@@ -297,7 +297,7 @@ void MutableNUMASpace::free_region(MemRegion mr) {
assert((intptr_t)aligned_region.start() % page_size() == 0 && assert((intptr_t)aligned_region.start() % page_size() == 0 &&
(intptr_t)aligned_region.byte_size() % page_size() == 0, "Bad alignment"); (intptr_t)aligned_region.byte_size() % page_size() == 0, "Bad alignment");
assert(region().contains(aligned_region), "Sanity"); assert(region().contains(aligned_region), "Sanity");
os::free_memory((char*)aligned_region.start(), aligned_region.byte_size()); os::free_memory((char*)aligned_region.start(), aligned_region.byte_size(), page_size());
} }
} }
...@@ -954,7 +954,7 @@ void MutableNUMASpace::LGRPSpace::scan_pages(size_t page_size, size_t page_count ...@@ -954,7 +954,7 @@ void MutableNUMASpace::LGRPSpace::scan_pages(size_t page_size, size_t page_count
if (e != scan_end) { if (e != scan_end) {
if ((page_expected.size != page_size || page_expected.lgrp_id != lgrp_id()) if ((page_expected.size != page_size || page_expected.lgrp_id != lgrp_id())
&& page_expected.size != 0) { && page_expected.size != 0) {
os::free_memory(s, pointer_delta(e, s, sizeof(char))); os::free_memory(s, pointer_delta(e, s, sizeof(char)), page_size);
} }
page_expected = page_found; page_expected = page_found;
} }
......
...@@ -51,7 +51,7 @@ void MutableSpace::numa_setup_pages(MemRegion mr, bool clear_space) { ...@@ -51,7 +51,7 @@ void MutableSpace::numa_setup_pages(MemRegion mr, bool clear_space) {
size_t size = pointer_delta(end, start, sizeof(char)); size_t size = pointer_delta(end, start, sizeof(char));
if (clear_space) { if (clear_space) {
// Prefer page reallocation to migration. // Prefer page reallocation to migration.
os::free_memory((char*)start, size); os::free_memory((char*)start, size, page_size);
} }
os::numa_make_global((char*)start, size); os::numa_make_global((char*)start, size);
} }
......
...@@ -256,7 +256,7 @@ class os: AllStatic { ...@@ -256,7 +256,7 @@ class os: AllStatic {
char *addr, size_t bytes, bool read_only, char *addr, size_t bytes, bool read_only,
bool allow_exec); bool allow_exec);
static bool unmap_memory(char *addr, size_t bytes); static bool unmap_memory(char *addr, size_t bytes);
static void free_memory(char *addr, size_t bytes); static void free_memory(char *addr, size_t bytes, size_t alignment_hint);
static void realign_memory(char *addr, size_t bytes, size_t alignment_hint); static void realign_memory(char *addr, size_t bytes, size_t alignment_hint);
// NUMA-specific interface // NUMA-specific interface
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册