30 /* pthread_getattr_np comes with LinuxThreads-0.9-7 on RedHat 7.1 */ |
30 /* pthread_getattr_np comes with LinuxThreads-0.9-7 on RedHat 7.1 */ |
31 typedef int (*pthread_getattr_func_type) (pthread_t, pthread_attr_t *); |
31 typedef int (*pthread_getattr_func_type) (pthread_t, pthread_attr_t *); |
32 |
32 |
33 class Linux { |
33 class Linux { |
34 friend class os; |
34 friend class os; |
|
35 friend class TestReserveMemorySpecial; |
35 |
36 |
36 // For signal-chaining |
37 // For signal-chaining |
37 #define MAXSIGNUM 32 |
38 #define MAXSIGNUM 32 |
38 static struct sigaction sigact[MAXSIGNUM]; // saved preinstalled sigactions |
39 static struct sigaction sigact[MAXSIGNUM]; // saved preinstalled sigactions |
39 static unsigned int sigs; // mask of signals that have |
40 static unsigned int sigs; // mask of signals that have |
90 static void set_is_floating_stack() { _is_floating_stack = true; } |
91 static void set_is_floating_stack() { _is_floating_stack = true; } |
91 |
92 |
92 static void rebuild_cpu_to_node_map(); |
93 static void rebuild_cpu_to_node_map(); |
93 static GrowableArray<int>* cpu_to_node() { return _cpu_to_node; } |
94 static GrowableArray<int>* cpu_to_node() { return _cpu_to_node; } |
94 |
95 |
|
96 static size_t find_large_page_size(); |
|
97 static size_t setup_large_page_size(); |
|
98 |
|
99 static bool setup_large_page_type(size_t page_size); |
|
100 static bool transparent_huge_pages_sanity_check(bool warn, size_t pages_size); |
95 static bool hugetlbfs_sanity_check(bool warn, size_t page_size); |
101 static bool hugetlbfs_sanity_check(bool warn, size_t page_size); |
|
102 |
|
103 static char* reserve_memory_special_shm(size_t bytes, size_t alignment, char* req_addr, bool exec); |
|
104 static char* reserve_memory_special_huge_tlbfs(size_t bytes, size_t alignment, char* req_addr, bool exec); |
|
105 static char* reserve_memory_special_huge_tlbfs_only(size_t bytes, char* req_addr, bool exec); |
|
106 static char* reserve_memory_special_huge_tlbfs_mixed(size_t bytes, size_t alignment, char* req_addr, bool exec); |
|
107 |
|
108 static bool release_memory_special_shm(char* base, size_t bytes); |
|
109 static bool release_memory_special_huge_tlbfs(char* base, size_t bytes); |
96 |
110 |
97 static void print_full_memory_info(outputStream* st); |
111 static void print_full_memory_info(outputStream* st); |
98 static void print_distro_info(outputStream* st); |
112 static void print_distro_info(outputStream* st); |
99 static void print_libversion_info(outputStream* st); |
113 static void print_libversion_info(outputStream* st); |
100 |
114 |