Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
野花太放肆
oceanbase
提交
a866c0c9
O
oceanbase
项目概览
野花太放肆
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a866c0c9
编写于
2月 14, 2023
作者:
O
obdev
提交者:
ob-robot
2月 14, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add system config (l1/l2/l3 cache size) to utility
上级
38f55496
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
60 addition
and
3 deletion
+60
-3
deps/oblib/src/lib/utility/utility.cpp
deps/oblib/src/lib/utility/utility.cpp
+49
-0
deps/oblib/src/lib/utility/utility.h
deps/oblib/src/lib/utility/utility.h
+8
-0
src/sql/engine/aggregate/ob_adaptive_bypass_ctrl.h
src/sql/engine/aggregate/ob_adaptive_bypass_ctrl.h
+2
-2
src/sql/engine/join/ob_hash_join_op.h
src/sql/engine/join/ob_hash_join_op.h
+1
-1
未找到文件。
deps/oblib/src/lib/utility/utility.cpp
浏览文件 @
a866c0c9
...
...
@@ -1940,5 +1940,54 @@ int is_dir_empty(const char *dirname, bool &is_empty)
return
ret
;
}
static
int64_t
get_cpu_cache_size
(
int
sysconf_name
,
const
char
*
sysfs_path
,
int64_t
default_value
)
{
int64_t
cache_size
=
sysconf
(
sysconf_name
);
if
(
OB_UNLIKELY
(
cache_size
<=
0
))
{
FILE
*
file
=
nullptr
;
file
=
fopen
(
sysfs_path
,
"r"
);
if
(
file
)
{
fscanf
(
file
,
"%ld"
,
&
cache_size
);
fclose
(
file
);
cache_size
*=
1024
;
}
if
(
OB_UNLIKELY
(
nullptr
==
file
||
cache_size
<=
0
))
{
int
ret
=
OB_ERR_UNEXPECTED
;
COMMON_LOG
(
ERROR
,
"failed to read cpu cache size in file"
,
KP
(
file
),
K
(
cache_size
));
cache_size
=
default_value
;
}
}
return
cache_size
;
}
int64_t
get_level1_dcache_size
()
{
const
char
*
path
=
"/sys/devices/system/cpu/cpu0/cache/index0/size"
;
static
int64_t
l1_dcache_size
=
get_cpu_cache_size
(
_SC_LEVEL1_DCACHE_SIZE
,
path
,
32768
/*default L1 dcache size : 32K*/
);
return
l1_dcache_size
;
}
int64_t
get_level1_icache_size
()
{
const
char
*
path
=
"/sys/devices/system/cpu/cpu0/cache/index1/size"
;
static
int64_t
l1_icache_size
=
get_cpu_cache_size
(
_SC_LEVEL1_ICACHE_SIZE
,
path
,
32768
/*default L1 icache size : 32K*/
);
return
l1_icache_size
;
}
int64_t
get_level2_cache_size
()
{
const
char
*
path
=
"/sys/devices/system/cpu/cpu0/cache/index2/size"
;
static
int64_t
l2_cache_size
=
get_cpu_cache_size
(
_SC_LEVEL2_CACHE_SIZE
,
path
,
524288
/*default L2 cache size : 512K*/
);
return
l2_cache_size
;
}
int64_t
get_level3_cache_size
()
{
const
char
*
path
=
"/sys/devices/system/cpu/cpu0/cache/index3/size"
;
static
int64_t
l3_cache_size
=
get_cpu_cache_size
(
_SC_LEVEL3_CACHE_SIZE
,
path
,
8388608
/*default L3 cache size : 8192K*/
);
return
l3_cache_size
;
}
}
// end namespace common
}
// end namespace oceanbase
deps/oblib/src/lib/utility/utility.h
浏览文件 @
a866c0c9
...
...
@@ -508,6 +508,14 @@ inline int64_t get_phy_mem_size()
return
page_size
*
phys_pages
;
}
int64_t
get_level1_dcache_size
();
int64_t
get_level1_icache_size
();
int64_t
get_level2_cache_size
();
int64_t
get_level3_cache_size
();
inline
bool
is_cpu_support_sse42
()
{
#if defined (__x86_64__)
...
...
src/sql/engine/aggregate/ob_adaptive_bypass_ctrl.h
浏览文件 @
a866c0c9
...
...
@@ -21,8 +21,8 @@ namespace oceanbase
namespace
sql
{
const
int64_t
INIT_L2_CACHE_SIZE
=
sysconf
(
_SC_LEVEL2_CACHE_SIZE
);
const
int64_t
INIT_L3_CACHE_SIZE
=
sysconf
(
_SC_LEVEL3_CACHE_SIZE
);
const
int64_t
INIT_L2_CACHE_SIZE
=
get_level2_cache_size
(
);
const
int64_t
INIT_L3_CACHE_SIZE
=
get_level3_cache_size
(
);
const
int64_t
MAX_L3_CACHE_SIZE
=
50
*
1024
*
1024
;
//50M
const
uint64_t
FORCE_GPD
=
0x100
;
const
int64_t
MAX_REBUILD_TIMES
=
5
;
...
...
src/sql/engine/join/ob_hash_join_op.h
浏览文件 @
a866c0c9
...
...
@@ -21,6 +21,7 @@
#include "lib/container/ob_2d_array.h"
#include "sql/engine/aggregate/ob_exec_hash_struct.h"
#include "lib/lock/ob_scond.h"
#include "sql/engine/aggregate/ob_adaptive_bypass_ctrl.h"
namespace
oceanbase
{
...
...
@@ -1108,7 +1109,6 @@ private:
static
const
int64_t
CACHE_AWARE_PART_CNT
=
128
;
static
const
int64_t
BATCH_RESULT_SIZE
=
512
;
static
const
int64_t
INIT_LTB_SIZE
=
64
;
static
const
int64_t
INIT_L2_CACHE_SIZE
=
1
*
1024
*
1024
;
// 1M
static
const
int64_t
MIN_PART_COUNT
=
8
;
static
const
int64_t
PAGE_SIZE
=
ObChunkDatumStore
::
BLOCK_SIZE
;
static
const
int64_t
MIN_MEM_SIZE
=
(
MIN_PART_COUNT
+
1
)
*
PAGE_SIZE
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录