Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
65d22e91
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
65d22e91
编写于
11年前
作者:
K
Kent Overstreet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bcache: Move spinlock into struct time_stats
Minor cleanup. Signed-off-by:
N
Kent Overstreet
<
kmo@daterainc.com
>
上级
8aee1220
无相关合并请求
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
17 addition
and
16 deletion
+17
-16
drivers/md/bcache/bcache.h
drivers/md/bcache/bcache.h
+0
-2
drivers/md/bcache/bset.c
drivers/md/bcache/bset.c
+1
-6
drivers/md/bcache/btree.c
drivers/md/bcache/btree.c
+0
-3
drivers/md/bcache/super.c
drivers/md/bcache/super.c
+6
-2
drivers/md/bcache/util.c
drivers/md/bcache/util.c
+9
-3
drivers/md/bcache/util.h
drivers/md/bcache/util.h
+1
-0
未找到文件。
drivers/md/bcache/bcache.h
浏览文件 @
65d22e91
...
...
@@ -666,11 +666,9 @@ struct cache_set {
unsigned
congested_read_threshold_us
;
unsigned
congested_write_threshold_us
;
spinlock_t
sort_time_lock
;
struct
time_stats
sort_time
;
struct
time_stats
btree_gc_time
;
struct
time_stats
btree_split_time
;
spinlock_t
btree_read_time_lock
;
struct
time_stats
btree_read_time
;
struct
time_stats
try_harder_time
;
...
...
This diff is collapsed.
Click to expand it.
drivers/md/bcache/bset.c
浏览文件 @
65d22e91
...
...
@@ -1077,11 +1077,8 @@ static void __btree_sort(struct btree *b, struct btree_iter *iter,
if
(
b
->
written
)
bset_build_written_tree
(
b
);
if
(
!
start
)
{
spin_lock
(
&
b
->
c
->
sort_time_lock
);
if
(
!
start
)
bch_time_stats_update
(
&
b
->
c
->
sort_time
,
start_time
);
spin_unlock
(
&
b
->
c
->
sort_time_lock
);
}
}
void
bch_btree_sort_partial
(
struct
btree
*
b
,
unsigned
start
)
...
...
@@ -1128,9 +1125,7 @@ void bch_btree_sort_into(struct btree *b, struct btree *new)
btree_mergesort
(
b
,
new
->
sets
->
data
,
&
iter
,
false
,
true
);
spin_lock
(
&
b
->
c
->
sort_time_lock
);
bch_time_stats_update
(
&
b
->
c
->
sort_time
,
start_time
);
spin_unlock
(
&
b
->
c
->
sort_time_lock
);
bkey_copy_key
(
&
new
->
key
,
&
b
->
key
);
new
->
sets
->
size
=
0
;
...
...
This diff is collapsed.
Click to expand it.
drivers/md/bcache/btree.c
浏览文件 @
65d22e91
...
...
@@ -317,10 +317,7 @@ void bch_btree_node_read(struct btree *b)
goto
err
;
bch_btree_node_read_done
(
b
);
spin_lock
(
&
b
->
c
->
btree_read_time_lock
);
bch_time_stats_update
(
&
b
->
c
->
btree_read_time
,
start_time
);
spin_unlock
(
&
b
->
c
->
btree_read_time_lock
);
return
;
err:
...
...
This diff is collapsed.
Click to expand it.
drivers/md/bcache/super.c
浏览文件 @
65d22e91
...
...
@@ -1435,9 +1435,13 @@ struct cache_set *bch_cache_set_alloc(struct cache_sb *sb)
init_waitqueue_head
(
&
c
->
try_wait
);
init_waitqueue_head
(
&
c
->
bucket_wait
);
closure_init_unlocked
(
&
c
->
uuid_write
);
spin_lock_init
(
&
c
->
sort_time_lock
);
mutex_init
(
&
c
->
sort_lock
);
spin_lock_init
(
&
c
->
btree_read_time_lock
);
spin_lock_init
(
&
c
->
sort_time
.
lock
);
spin_lock_init
(
&
c
->
btree_gc_time
.
lock
);
spin_lock_init
(
&
c
->
btree_split_time
.
lock
);
spin_lock_init
(
&
c
->
btree_read_time
.
lock
);
spin_lock_init
(
&
c
->
try_harder_time
.
lock
);
bch_moving_init_cache_set
(
c
);
...
...
This diff is collapsed.
Click to expand it.
drivers/md/bcache/util.c
浏览文件 @
65d22e91
...
...
@@ -168,10 +168,14 @@ int bch_parse_uuid(const char *s, char *uuid)
void
bch_time_stats_update
(
struct
time_stats
*
stats
,
uint64_t
start_time
)
{
uint64_t
now
=
local_clock
();
uint64_t
duration
=
time_after64
(
now
,
start_time
)
uint64_t
now
,
duration
,
last
;
spin_lock
(
&
stats
->
lock
);
now
=
local_clock
();
duration
=
time_after64
(
now
,
start_time
)
?
now
-
start_time
:
0
;
uint64_t
last
=
time_after64
(
now
,
stats
->
last
)
last
=
time_after64
(
now
,
stats
->
last
)
?
now
-
stats
->
last
:
0
;
stats
->
max_duration
=
max
(
stats
->
max_duration
,
duration
);
...
...
@@ -188,6 +192,8 @@ void bch_time_stats_update(struct time_stats *stats, uint64_t start_time)
}
stats
->
last
=
now
?:
1
;
spin_unlock
(
&
stats
->
lock
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
drivers/md/bcache/util.h
浏览文件 @
65d22e91
...
...
@@ -378,6 +378,7 @@ ssize_t bch_snprint_string_list(char *buf, size_t size, const char * const list[
ssize_t
bch_read_string_list
(
const
char
*
buf
,
const
char
*
const
list
[]);
struct
time_stats
{
spinlock_t
lock
;
/*
* all fields are in nanoseconds, averages are ewmas stored left shifted
* by 8
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部