Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
96651ab3
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看板
提交
96651ab3
编写于
6月 22, 2005
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] RPC: Shrink struct rpc_task by switching to wait_on_bit()
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
a656db99
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
14 deletion
+18
-14
include/linux/sunrpc/sched.h
include/linux/sunrpc/sched.h
+0
-1
net/sunrpc/sched.c
net/sunrpc/sched.c
+18
-13
未找到文件。
include/linux/sunrpc/sched.h
浏览文件 @
96651ab3
...
...
@@ -31,7 +31,6 @@ struct rpc_wait_queue;
struct
rpc_wait
{
struct
list_head
list
;
/* wait queue links */
struct
list_head
links
;
/* Links to related tasks */
wait_queue_head_t
waitq
;
/* sync: sleep on this q */
struct
rpc_wait_queue
*
rpc_waitq
;
/* RPC wait queue we're on */
};
...
...
net/sunrpc/sched.c
浏览文件 @
96651ab3
...
...
@@ -290,7 +290,7 @@ static void rpc_make_runnable(struct rpc_task *task)
return
;
}
}
else
wake_up
(
&
task
->
u
.
tk_wait
.
waitq
);
wake_up
_bit
(
&
task
->
tk_runstate
,
RPC_TASK_QUEUED
);
}
/*
...
...
@@ -578,6 +578,14 @@ static inline int __rpc_do_exit(struct rpc_task *task)
return
1
;
}
static
int
rpc_wait_bit_interruptible
(
void
*
word
)
{
if
(
signal_pending
(
current
))
return
-
ERESTARTSYS
;
schedule
();
return
0
;
}
/*
* This is the RPC `scheduler' (or rather, the finite state machine).
*/
...
...
@@ -648,22 +656,21 @@ static int __rpc_execute(struct rpc_task *task)
/* sync task: sleep here */
dprintk
(
"RPC: %4d sync task going to sleep
\n
"
,
task
->
tk_pid
);
if
(
RPC_TASK_UNINTERRUPTIBLE
(
task
))
{
__wait_event
(
task
->
u
.
tk_wait
.
waitq
,
!
RPC_IS_QUEUED
(
task
));
}
else
{
__wait_event_interruptible
(
task
->
u
.
tk_wait
.
waitq
,
!
RPC_IS_QUEUED
(
task
),
status
);
/* Note: Caller should be using rpc_clnt_sigmask() */
status
=
out_of_line_wait_on_bit
(
&
task
->
tk_runstate
,
RPC_TASK_QUEUED
,
rpc_wait_bit_interruptible
,
TASK_INTERRUPTIBLE
);
if
(
status
==
-
ERESTARTSYS
)
{
/*
* When a sync task receives a signal, it exits with
* -ERESTARTSYS. In order to catch any callbacks that
* clean up after sleeping on some queue, we don't
* break the loop here, but go around once more.
*/
if
(
status
==
-
ERESTARTSYS
)
{
dprintk
(
"RPC: %4d got signal
\n
"
,
task
->
tk_pid
);
task
->
tk_flags
|=
RPC_TASK_KILLED
;
rpc_exit
(
task
,
-
ERESTARTSYS
);
rpc_wake_up_task
(
task
);
}
dprintk
(
"RPC: %4d got signal
\n
"
,
task
->
tk_pid
);
task
->
tk_flags
|=
RPC_TASK_KILLED
;
rpc_exit
(
task
,
-
ERESTARTSYS
);
rpc_wake_up_task
(
task
);
}
rpc_set_running
(
task
);
dprintk
(
"RPC: %4d sync task resuming
\n
"
,
task
->
tk_pid
);
...
...
@@ -766,8 +773,6 @@ void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, rpc_action call
/* Initialize workqueue for async tasks */
task
->
tk_workqueue
=
rpciod_workqueue
;
if
(
!
RPC_IS_ASYNC
(
task
))
init_waitqueue_head
(
&
task
->
u
.
tk_wait
.
waitq
);
if
(
clnt
)
{
atomic_inc
(
&
clnt
->
cl_users
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录