Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
2a5cc4d7
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看板
提交
2a5cc4d7
编写于
8月 29, 2013
作者:
J
jmasa
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
82db6282
28aaccf7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
0 deletion
+23
-0
src/os/linux/vm/os_linux.cpp
src/os/linux/vm/os_linux.cpp
+15
-0
src/os/linux/vm/os_linux.hpp
src/os/linux/vm/os_linux.hpp
+8
-0
未找到文件。
src/os/linux/vm/os_linux.cpp
浏览文件 @
2a5cc4d7
...
...
@@ -2767,7 +2767,19 @@ void os::numa_make_global(char *addr, size_t bytes) {
Linux
::
numa_interleave_memory
(
addr
,
bytes
);
}
// Define for numa_set_bind_policy(int). Setting the argument to 0 will set the
// bind policy to MPOL_PREFERRED for the current thread.
#define USE_MPOL_PREFERRED 0
void
os
::
numa_make_local
(
char
*
addr
,
size_t
bytes
,
int
lgrp_hint
)
{
// To make NUMA and large pages more robust when both enabled, we need to ease
// the requirements on where the memory should be allocated. MPOL_BIND is the
// default policy and it will force memory to be allocated on the specified
// node. Changing this to MPOL_PREFERRED will prefer to allocate the memory on
// the specified node, but will not force it. Using this policy will prevent
// getting SIGBUS when trying to allocate large pages on NUMA nodes with no
// free large pages.
Linux
::
numa_set_bind_policy
(
USE_MPOL_PREFERRED
);
Linux
::
numa_tonode_memory
(
addr
,
bytes
,
lgrp_hint
);
}
...
...
@@ -2869,6 +2881,8 @@ bool os::Linux::libnuma_init() {
libnuma_dlsym
(
handle
,
"numa_tonode_memory"
)));
set_numa_interleave_memory
(
CAST_TO_FN_PTR
(
numa_interleave_memory_func_t
,
libnuma_dlsym
(
handle
,
"numa_interleave_memory"
)));
set_numa_set_bind_policy
(
CAST_TO_FN_PTR
(
numa_set_bind_policy_func_t
,
libnuma_dlsym
(
handle
,
"numa_set_bind_policy"
)));
if
(
numa_available
()
!=
-
1
)
{
...
...
@@ -2935,6 +2949,7 @@ os::Linux::numa_max_node_func_t os::Linux::_numa_max_node;
os
::
Linux
::
numa_available_func_t
os
::
Linux
::
_numa_available
;
os
::
Linux
::
numa_tonode_memory_func_t
os
::
Linux
::
_numa_tonode_memory
;
os
::
Linux
::
numa_interleave_memory_func_t
os
::
Linux
::
_numa_interleave_memory
;
os
::
Linux
::
numa_set_bind_policy_func_t
os
::
Linux
::
_numa_set_bind_policy
;
unsigned
long
*
os
::
Linux
::
_numa_all_nodes
;
bool
os
::
pd_uncommit_memory
(
char
*
addr
,
size_t
size
)
{
...
...
src/os/linux/vm/os_linux.hpp
浏览文件 @
2a5cc4d7
...
...
@@ -235,6 +235,7 @@ private:
typedef
int
(
*
numa_available_func_t
)(
void
);
typedef
int
(
*
numa_tonode_memory_func_t
)(
void
*
start
,
size_t
size
,
int
node
);
typedef
void
(
*
numa_interleave_memory_func_t
)(
void
*
start
,
size_t
size
,
unsigned
long
*
nodemask
);
typedef
void
(
*
numa_set_bind_policy_func_t
)(
int
policy
);
static
sched_getcpu_func_t
_sched_getcpu
;
static
numa_node_to_cpus_func_t
_numa_node_to_cpus
;
...
...
@@ -242,6 +243,7 @@ private:
static
numa_available_func_t
_numa_available
;
static
numa_tonode_memory_func_t
_numa_tonode_memory
;
static
numa_interleave_memory_func_t
_numa_interleave_memory
;
static
numa_set_bind_policy_func_t
_numa_set_bind_policy
;
static
unsigned
long
*
_numa_all_nodes
;
static
void
set_sched_getcpu
(
sched_getcpu_func_t
func
)
{
_sched_getcpu
=
func
;
}
...
...
@@ -250,6 +252,7 @@ private:
static
void
set_numa_available
(
numa_available_func_t
func
)
{
_numa_available
=
func
;
}
static
void
set_numa_tonode_memory
(
numa_tonode_memory_func_t
func
)
{
_numa_tonode_memory
=
func
;
}
static
void
set_numa_interleave_memory
(
numa_interleave_memory_func_t
func
)
{
_numa_interleave_memory
=
func
;
}
static
void
set_numa_set_bind_policy
(
numa_set_bind_policy_func_t
func
)
{
_numa_set_bind_policy
=
func
;
}
static
void
set_numa_all_nodes
(
unsigned
long
*
ptr
)
{
_numa_all_nodes
=
ptr
;
}
static
int
sched_getcpu_syscall
(
void
);
public:
...
...
@@ -267,6 +270,11 @@ public:
_numa_interleave_memory
(
start
,
size
,
_numa_all_nodes
);
}
}
static
void
numa_set_bind_policy
(
int
policy
)
{
if
(
_numa_set_bind_policy
!=
NULL
)
{
_numa_set_bind_policy
(
policy
);
}
}
static
int
get_node_by_cpu
(
int
cpu_id
);
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录