Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
e17a9489
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e17a9489
编写于
3月 18, 2006
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] stop elv_unregister() from rogering other iosched's data, fix locking
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
25975f86
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
25 addition
and
15 deletion
+25
-15
block/as-iosched.c
block/as-iosched.c
+7
-0
block/cfq-iosched.c
block/cfq-iosched.c
+8
-0
block/elevator.c
block/elevator.c
+9
-15
include/linux/elevator.h
include/linux/elevator.h
+1
-0
未找到文件。
block/as-iosched.c
浏览文件 @
e17a9489
...
...
@@ -195,6 +195,12 @@ static void free_as_io_context(struct as_io_context *aic)
kfree
(
aic
);
}
static
void
as_trim
(
struct
io_context
*
ioc
)
{
kfree
(
ioc
->
aic
);
ioc
->
aic
=
NULL
;
}
/* Called when the task exits */
static
void
exit_as_io_context
(
struct
as_io_context
*
aic
)
{
...
...
@@ -1860,6 +1866,7 @@ static struct elevator_type iosched_as = {
.
elevator_may_queue_fn
=
as_may_queue
,
.
elevator_init_fn
=
as_init_queue
,
.
elevator_exit_fn
=
as_exit_queue
,
.
trim
=
as_trim
,
},
.
elevator_ktype
=
&
as_ktype
,
...
...
block/cfq-iosched.c
浏览文件 @
e17a9489
...
...
@@ -1211,6 +1211,13 @@ static void cfq_free_io_context(struct cfq_io_context *cic)
kmem_cache_free
(
cfq_ioc_pool
,
cic
);
}
static
void
cfq_trim
(
struct
io_context
*
ioc
)
{
ioc
->
set_ioprio
=
NULL
;
if
(
ioc
->
cic
)
cfq_free_io_context
(
ioc
->
cic
);
}
/*
* Called with interrupts disabled
*/
...
...
@@ -2472,6 +2479,7 @@ static struct elevator_type iosched_cfq = {
.
elevator_may_queue_fn
=
cfq_may_queue
,
.
elevator_init_fn
=
cfq_init_queue
,
.
elevator_exit_fn
=
cfq_exit_queue
,
.
trim
=
cfq_trim
,
},
.
elevator_ktype
=
&
cfq_ktype
,
.
elevator_name
=
"cfq"
,
...
...
block/elevator.c
浏览文件 @
e17a9489
...
...
@@ -675,21 +675,15 @@ void elv_unregister(struct elevator_type *e)
/*
* Iterate every thread in the process to remove the io contexts.
*/
read_lock
(
&
tasklist_lock
);
do_each_thread
(
g
,
p
)
{
struct
io_context
*
ioc
=
p
->
io_context
;
if
(
ioc
&&
ioc
->
cic
)
{
ioc
->
cic
->
exit
(
ioc
->
cic
);
ioc
->
cic
->
dtor
(
ioc
->
cic
);
ioc
->
cic
=
NULL
;
}
if
(
ioc
&&
ioc
->
aic
)
{
ioc
->
aic
->
exit
(
ioc
->
aic
);
ioc
->
aic
->
dtor
(
ioc
->
aic
);
ioc
->
aic
=
NULL
;
}
}
while_each_thread
(
g
,
p
);
read_unlock
(
&
tasklist_lock
);
if
(
e
->
ops
.
trim
)
{
read_lock
(
&
tasklist_lock
);
do_each_thread
(
g
,
p
)
{
task_lock
(
p
);
e
->
ops
.
trim
(
p
->
io_context
);
task_unlock
(
p
);
}
while_each_thread
(
g
,
p
);
read_unlock
(
&
tasklist_lock
);
}
spin_lock_irq
(
&
elv_list_lock
);
list_del_init
(
&
e
->
list
);
...
...
include/linux/elevator.h
浏览文件 @
e17a9489
...
...
@@ -48,6 +48,7 @@ struct elevator_ops
elevator_init_fn
*
elevator_init_fn
;
elevator_exit_fn
*
elevator_exit_fn
;
void
(
*
trim
)(
struct
io_context
*
);
};
#define ELV_NAME_MAX (16)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录