Mercurial > hg > graal-jvmci-8
comparison src/os/linux/vm/os_linux.cpp @ 20804:7848fc12602b
Merge with jdk8u40-b25
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Tue, 07 Apr 2015 14:58:49 +0200 |
parents | 52b4284cb496 6e0cb14ce59b |
children | c3ad14a83248 |
comparison
equal
deleted
inserted
replaced
20184:84105dcdb05b | 20804:7848fc12602b |
---|---|
47 #include "runtime/init.hpp" | 47 #include "runtime/init.hpp" |
48 #include "runtime/java.hpp" | 48 #include "runtime/java.hpp" |
49 #include "runtime/javaCalls.hpp" | 49 #include "runtime/javaCalls.hpp" |
50 #include "runtime/mutexLocker.hpp" | 50 #include "runtime/mutexLocker.hpp" |
51 #include "runtime/objectMonitor.hpp" | 51 #include "runtime/objectMonitor.hpp" |
52 #include "runtime/orderAccess.inline.hpp" | |
52 #include "runtime/osThread.hpp" | 53 #include "runtime/osThread.hpp" |
53 #include "runtime/perfMemory.hpp" | 54 #include "runtime/perfMemory.hpp" |
54 #include "runtime/sharedRuntime.hpp" | 55 #include "runtime/sharedRuntime.hpp" |
55 #include "runtime/statSampler.hpp" | 56 #include "runtime/statSampler.hpp" |
56 #include "runtime/stubRoutines.hpp" | 57 #include "runtime/stubRoutines.hpp" |
2241 | 2242 |
2242 void os::print_siginfo(outputStream* st, void* siginfo) { | 2243 void os::print_siginfo(outputStream* st, void* siginfo) { |
2243 const siginfo_t* si = (const siginfo_t*)siginfo; | 2244 const siginfo_t* si = (const siginfo_t*)siginfo; |
2244 | 2245 |
2245 os::Posix::print_siginfo_brief(st, si); | 2246 os::Posix::print_siginfo_brief(st, si); |
2246 | 2247 #if INCLUDE_CDS |
2247 if (si && (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) && | 2248 if (si && (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) && |
2248 UseSharedSpaces) { | 2249 UseSharedSpaces) { |
2249 FileMapInfo* mapinfo = FileMapInfo::current_info(); | 2250 FileMapInfo* mapinfo = FileMapInfo::current_info(); |
2250 if (mapinfo->is_in_shared_space(si->si_addr)) { | 2251 if (mapinfo->is_in_shared_space(si->si_addr)) { |
2251 st->print("\n\nError accessing class data sharing archive." \ | 2252 st->print("\n\nError accessing class data sharing archive." \ |
2252 " Mapped file inaccessible during execution, " \ | 2253 " Mapped file inaccessible during execution, " \ |
2253 " possible disk/network problem."); | 2254 " possible disk/network problem."); |
2254 } | 2255 } |
2255 } | 2256 } |
2257 #endif | |
2256 st->cr(); | 2258 st->cr(); |
2257 } | 2259 } |
2258 | 2260 |
2259 | 2261 |
2260 static void print_signal_handler(outputStream* st, int sig, | 2262 static void print_signal_handler(outputStream* st, int sig, |
3498 return NULL; | 3500 return NULL; |
3499 } | 3501 } |
3500 | 3502 |
3501 assert(is_ptr_aligned(start, alignment), "Must be"); | 3503 assert(is_ptr_aligned(start, alignment), "Must be"); |
3502 | 3504 |
3503 // os::reserve_memory_special will record this memory area. | 3505 if (MemTracker::tracking_level() > NMT_minimal) { |
3504 // Need to release it here to prevent overlapping reservations. | 3506 // os::reserve_memory_special will record this memory area. |
3505 MemTracker::record_virtual_memory_release((address)start, bytes); | 3507 // Need to release it here to prevent overlapping reservations. |
3508 Tracker tkr = MemTracker::get_virtual_memory_release_tracker(); | |
3509 tkr.record((address)start, bytes); | |
3510 } | |
3506 | 3511 |
3507 char* end = start + bytes; | 3512 char* end = start + bytes; |
3508 | 3513 |
3509 // Find the regions of the allocated chunk that can be promoted to large pages. | 3514 // Find the regions of the allocated chunk that can be promoted to large pages. |
3510 char* lp_start = (char*)align_ptr_up(start, large_page_size); | 3515 char* lp_start = (char*)align_ptr_up(start, large_page_size); |
3595 if (UseNUMAInterleaving) { | 3600 if (UseNUMAInterleaving) { |
3596 numa_make_global(addr, bytes); | 3601 numa_make_global(addr, bytes); |
3597 } | 3602 } |
3598 | 3603 |
3599 // The memory is committed | 3604 // The memory is committed |
3600 MemTracker::record_virtual_memory_reserve_and_commit((address)addr, bytes, mtNone, CALLER_PC); | 3605 MemTracker::record_virtual_memory_reserve_and_commit((address)addr, bytes, CALLER_PC); |
3601 } | 3606 } |
3602 | 3607 |
3603 return addr; | 3608 return addr; |
3604 } | 3609 } |
3605 | 3610 |
3611 bool os::Linux::release_memory_special_huge_tlbfs(char* base, size_t bytes) { | 3616 bool os::Linux::release_memory_special_huge_tlbfs(char* base, size_t bytes) { |
3612 return pd_release_memory(base, bytes); | 3617 return pd_release_memory(base, bytes); |
3613 } | 3618 } |
3614 | 3619 |
3615 bool os::release_memory_special(char* base, size_t bytes) { | 3620 bool os::release_memory_special(char* base, size_t bytes) { |
3621 bool res; | |
3622 if (MemTracker::tracking_level() > NMT_minimal) { | |
3623 Tracker tkr = MemTracker::get_virtual_memory_release_tracker(); | |
3624 res = os::Linux::release_memory_special_impl(base, bytes); | |
3625 if (res) { | |
3626 tkr.record((address)base, bytes); | |
3627 } | |
3628 | |
3629 } else { | |
3630 res = os::Linux::release_memory_special_impl(base, bytes); | |
3631 } | |
3632 return res; | |
3633 } | |
3634 | |
3635 bool os::Linux::release_memory_special_impl(char* base, size_t bytes) { | |
3616 assert(UseLargePages, "only for large pages"); | 3636 assert(UseLargePages, "only for large pages"); |
3617 | |
3618 MemTracker::Tracker tkr = MemTracker::get_virtual_memory_release_tracker(); | |
3619 | |
3620 bool res; | 3637 bool res; |
3638 | |
3621 if (UseSHM) { | 3639 if (UseSHM) { |
3622 res = os::Linux::release_memory_special_shm(base, bytes); | 3640 res = os::Linux::release_memory_special_shm(base, bytes); |
3623 } else { | 3641 } else { |
3624 assert(UseHugeTLBFS, "must be"); | 3642 assert(UseHugeTLBFS, "must be"); |
3625 res = os::Linux::release_memory_special_huge_tlbfs(base, bytes); | 3643 res = os::Linux::release_memory_special_huge_tlbfs(base, bytes); |
3626 } | 3644 } |
3627 | |
3628 if (res) { | |
3629 tkr.record((address)base, bytes); | |
3630 } else { | |
3631 tkr.discard(); | |
3632 } | |
3633 | |
3634 return res; | 3645 return res; |
3635 } | 3646 } |
3636 | 3647 |
3637 size_t os::large_page_size() { | 3648 size_t os::large_page_size() { |
3638 return _large_page_size; | 3649 return _large_page_size; |