Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
0986fe9e
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0986fe9e
编写于
8月 15, 2008
作者:
C
Chris Mason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: Count async bios separately from async checksum work items
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
b720d209
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
6 deletion
+26
-6
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+1
-0
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+22
-3
fs/btrfs/volumes.c
fs/btrfs/volumes.c
+3
-3
未找到文件。
fs/btrfs/ctree.h
浏览文件 @
0986fe9e
...
...
@@ -544,6 +544,7 @@ struct btrfs_fs_info {
struct
list_head
hashers
;
struct
list_head
dead_roots
;
atomic_t
nr_async_submits
;
atomic_t
nr_async_bios
;
/*
* this is used by the balancing code to wait for all the pending
...
...
fs/btrfs/disk-io.c
浏览文件 @
0986fe9e
...
...
@@ -429,6 +429,21 @@ int btrfs_bio_wq_end_io(struct btrfs_fs_info *info, struct bio *bio,
return
0
;
}
static
int
congested_async
(
struct
btrfs_fs_info
*
info
,
int
iodone
)
{
int
limit
=
256
*
info
->
fs_devices
->
open_devices
;
if
(
iodone
)
limit
=
(
limit
*
3
)
/
2
;
if
(
atomic_read
(
&
info
->
nr_async_submits
)
>
limit
)
return
1
;
limit
=
8192
*
info
->
fs_devices
->
open_devices
;
if
(
iodone
)
limit
=
(
limit
*
3
)
/
2
;
return
atomic_read
(
&
info
->
nr_async_bios
)
>
limit
;
}
static
void
run_one_async_submit
(
struct
btrfs_work
*
work
)
{
struct
btrfs_fs_info
*
fs_info
;
...
...
@@ -437,6 +452,11 @@ static void run_one_async_submit(struct btrfs_work *work)
async
=
container_of
(
work
,
struct
async_submit_bio
,
work
);
fs_info
=
BTRFS_I
(
async
->
inode
)
->
root
->
fs_info
;
atomic_dec
(
&
fs_info
->
nr_async_submits
);
if
((
async
->
bio
->
bi_rw
&
(
1
<<
BIO_RW
))
&&
!
congested_async
(
fs_info
,
1
))
{
clear_bdi_congested
(
&
fs_info
->
bdi
,
WRITE
);
}
async
->
submit_bio_hook
(
async
->
inode
,
async
->
rw
,
async
->
bio
,
async
->
mirror_num
);
kfree
(
async
);
...
...
@@ -938,15 +958,13 @@ static int btrfs_congested_fn(void *congested_data, int bdi_bits)
{
struct
btrfs_fs_info
*
info
=
(
struct
btrfs_fs_info
*
)
congested_data
;
int
ret
=
0
;
int
limit
=
256
*
info
->
fs_devices
->
open_devices
;
struct
list_head
*
cur
;
struct
btrfs_device
*
device
;
struct
backing_dev_info
*
bdi
;
if
((
bdi_bits
&
(
1
<<
BDI_write_congested
))
&&
atomic_read
(
&
info
->
nr_async_submits
)
>
limit
)
{
congested_async
(
info
,
0
))
return
1
;
}
list_for_each
(
cur
,
&
info
->
fs_devices
->
devices
)
{
device
=
list_entry
(
cur
,
struct
btrfs_device
,
dev_list
);
...
...
@@ -1250,6 +1268,7 @@ struct btrfs_root *open_ctree(struct super_block *sb,
INIT_LIST_HEAD
(
&
fs_info
->
space_info
);
btrfs_mapping_init
(
&
fs_info
->
mapping_tree
);
atomic_set
(
&
fs_info
->
nr_async_submits
,
0
);
atomic_set
(
&
fs_info
->
nr_async_bios
,
0
);
atomic_set
(
&
fs_info
->
throttles
,
0
);
atomic_set
(
&
fs_info
->
throttle_gen
,
0
);
fs_info
->
sb
=
sb
;
...
...
fs/btrfs/volumes.c
浏览文件 @
0986fe9e
...
...
@@ -179,7 +179,7 @@ int run_scheduled_bios(struct btrfs_device *device)
cur
=
pending
;
pending
=
pending
->
bi_next
;
cur
->
bi_next
=
NULL
;
atomic_dec
(
&
device
->
dev_root
->
fs_info
->
nr_async_
submit
s
);
atomic_dec
(
&
device
->
dev_root
->
fs_info
->
nr_async_
bio
s
);
BUG_ON
(
atomic_read
(
&
cur
->
bi_cnt
)
==
0
);
bio_get
(
cur
);
...
...
@@ -2145,12 +2145,12 @@ int schedule_bio(struct btrfs_root *root, struct btrfs_device *device,
}
/*
* nr_async_
sumbit
s allows us to reliably return congestion to the
* nr_async_
bio
s allows us to reliably return congestion to the
* higher layers. Otherwise, the async bio makes it appear we have
* made progress against dirty pages when we've really just put it
* on a queue for later
*/
atomic_inc
(
&
root
->
fs_info
->
nr_async_
submit
s
);
atomic_inc
(
&
root
->
fs_info
->
nr_async_
bio
s
);
WARN_ON
(
bio
->
bi_next
);
bio
->
bi_next
=
NULL
;
bio
->
bi_rw
|=
rw
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录