Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
6119c0ea
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6119c0ea
编写于
9月 15, 2014
作者:
E
ehelin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8049536: os::commit_memory on Solaris uses aligment_hint as page size
Reviewed-by: stefank, tschatzl
上级
09547fd7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
99 addition
and
20 deletion
+99
-20
src/os/solaris/vm/os_solaris.cpp
src/os/solaris/vm/os_solaris.cpp
+36
-20
src/os/solaris/vm/os_solaris.hpp
src/os/solaris/vm/os_solaris.hpp
+2
-0
test/runtime/memory/LargePages/TestLargePageSizeInBytes.java
test/runtime/memory/LargePages/TestLargePageSizeInBytes.java
+61
-0
未找到文件。
src/os/solaris/vm/os_solaris.cpp
浏览文件 @
6119c0ea
...
...
@@ -2696,29 +2696,30 @@ void os::pd_commit_memory_or_exit(char* addr, size_t bytes, bool exec,
}
}
size_t
os
::
Solaris
::
page_size_for_alignment
(
size_t
alignment
)
{
assert
(
is_size_aligned
(
alignment
,
(
size_t
)
vm_page_size
()),
err_msg
(
SIZE_FORMAT
" is not aligned to "
SIZE_FORMAT
,
alignment
,
(
size_t
)
vm_page_size
()));
for
(
int
i
=
0
;
_page_sizes
[
i
]
!=
0
;
i
++
)
{
if
(
is_size_aligned
(
alignment
,
_page_sizes
[
i
]))
{
return
_page_sizes
[
i
];
}
}
return
(
size_t
)
vm_page_size
();
}
int
os
::
Solaris
::
commit_memory_impl
(
char
*
addr
,
size_t
bytes
,
size_t
alignment_hint
,
bool
exec
)
{
int
err
=
Solaris
::
commit_memory_impl
(
addr
,
bytes
,
exec
);
if
(
err
==
0
)
{
if
(
UseLargePages
&&
(
alignment_hint
>
(
size_t
)
vm_page_size
()))
{
// If the large page size has been set and the VM
// is using large pages, use the large page size
// if it is smaller than the alignment hint. This is
// a case where the VM wants to use a larger alignment size
// for its own reasons but still want to use large pages
// (which is what matters to setting the mpss range.
size_t
page_size
=
0
;
if
(
large_page_size
()
<
alignment_hint
)
{
assert
(
UseLargePages
,
"Expected to be here for large page use only"
);
page_size
=
large_page_size
();
}
else
{
// If the alignment hint is less than the large page
// size, the VM wants a particular alignment (thus the hint)
// for internal reasons. Try to set the mpss range using
// the alignment_hint.
page_size
=
alignment_hint
;
}
// Since this is a hint, ignore any failures.
if
(
err
==
0
&&
UseLargePages
&&
alignment_hint
>
0
)
{
assert
(
is_size_aligned
(
bytes
,
alignment_hint
),
err_msg
(
SIZE_FORMAT
" is not aligned to "
SIZE_FORMAT
,
bytes
,
alignment_hint
));
// The syscall memcntl requires an exact page size (see man memcntl for details).
size_t
page_size
=
page_size_for_alignment
(
alignment_hint
);
if
(
page_size
>
(
size_t
)
vm_page_size
())
{
(
void
)
Solaris
::
setup_large_pages
(
addr
,
bytes
,
page_size
);
}
}
...
...
@@ -3251,7 +3252,22 @@ void os::large_page_init() {
}
}
bool
os
::
Solaris
::
is_valid_page_size
(
size_t
bytes
)
{
for
(
int
i
=
0
;
_page_sizes
[
i
]
!=
0
;
i
++
)
{
if
(
_page_sizes
[
i
]
==
bytes
)
{
return
true
;
}
}
return
false
;
}
bool
os
::
Solaris
::
setup_large_pages
(
caddr_t
start
,
size_t
bytes
,
size_t
align
)
{
assert
(
is_valid_page_size
(
align
),
err_msg
(
SIZE_FORMAT
" is not a valid page size"
,
align
));
assert
(
is_ptr_aligned
((
void
*
)
start
,
align
),
err_msg
(
PTR_FORMAT
" is not aligned to "
SIZE_FORMAT
,
p2i
((
void
*
)
start
),
align
));
assert
(
is_size_aligned
(
bytes
,
align
),
err_msg
(
SIZE_FORMAT
" is not aligned to "
SIZE_FORMAT
,
bytes
,
align
));
// Signal to OS that we want large pages for addresses
// from addr, addr + bytes
struct
memcntl_mha
mpss_struct
;
...
...
src/os/solaris/vm/os_solaris.hpp
浏览文件 @
6119c0ea
...
...
@@ -110,6 +110,8 @@ class Solaris {
static
meminfo_func_t
_meminfo
;
// Large Page Support
static
bool
is_valid_page_size
(
size_t
bytes
);
static
size_t
page_size_for_alignment
(
size_t
alignment
);
static
bool
setup_large_pages
(
caddr_t
start
,
size_t
bytes
,
size_t
align
);
static
void
init_thread_fpu_state
(
void
);
...
...
test/runtime/memory/LargePages/TestLargePageSizeInBytes.java
0 → 100644
浏览文件 @
6119c0ea
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test TestLargePageSizeInBytes
* @summary Tests that the flag -XX:LargePageSizeInBytes does not cause warnings on Solaris
* @bug 8049536
* @library /testlibrary
* @run driver TestLargePageSizeInBytes
*/
import
com.oracle.java.testlibrary.OutputAnalyzer
;
import
com.oracle.java.testlibrary.Platform
;
import
com.oracle.java.testlibrary.ProcessTools
;
public
class
TestLargePageSizeInBytes
{
private
static
long
M
=
1024L
*
1024L
;
private
static
long
G
=
1024L
*
M
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
if
(!
Platform
.
isSolaris
())
{
// We only use the syscall mencntl on Solaris
return
;
}
testLargePageSizeInBytes
(
4
*
M
);
testLargePageSizeInBytes
(
256
*
M
);
testLargePageSizeInBytes
(
512
*
M
);
testLargePageSizeInBytes
(
2
*
G
);
}
private
static
void
testLargePageSizeInBytes
(
long
size
)
throws
Exception
{
ProcessBuilder
pb
=
ProcessTools
.
createJavaProcessBuilder
(
"-XX:+UseLargePages"
,
"-XX:LargePageSizeInBytes="
+
size
,
"-version"
);
OutputAnalyzer
out
=
new
OutputAnalyzer
(
pb
.
start
());
out
.
shouldNotContain
(
"Attempt to use MPSS failed."
);
out
.
shouldHaveExitValue
(
0
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录