Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
bb2ebf08
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,发现更多精彩内容 >>
提交
bb2ebf08
编写于
5月 08, 2015
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'sched/urgent' into sched/core, before applying new patches
Signed-off-by:
N
Ingo Molnar
<
mingo@kernel.org
>
上级
6a82b60d
533445c6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
36 deletion
+37
-36
include/linux/sched/rt.h
include/linux/sched/rt.h
+4
-3
kernel/locking/rtmutex.c
kernel/locking/rtmutex.c
+7
-5
kernel/sched/core.c
kernel/sched/core.c
+26
-28
未找到文件。
include/linux/sched/rt.h
浏览文件 @
bb2ebf08
...
...
@@ -18,7 +18,7 @@ static inline int rt_task(struct task_struct *p)
#ifdef CONFIG_RT_MUTEXES
extern
int
rt_mutex_getprio
(
struct
task_struct
*
p
);
extern
void
rt_mutex_setprio
(
struct
task_struct
*
p
,
int
prio
);
extern
int
rt_mutex_
check
_prio
(
struct
task_struct
*
task
,
int
newprio
);
extern
int
rt_mutex_
get_effective
_prio
(
struct
task_struct
*
task
,
int
newprio
);
extern
struct
task_struct
*
rt_mutex_get_top_task
(
struct
task_struct
*
task
);
extern
void
rt_mutex_adjust_pi
(
struct
task_struct
*
p
);
static
inline
bool
tsk_is_pi_blocked
(
struct
task_struct
*
tsk
)
...
...
@@ -31,9 +31,10 @@ static inline int rt_mutex_getprio(struct task_struct *p)
return
p
->
normal_prio
;
}
static
inline
int
rt_mutex_check_prio
(
struct
task_struct
*
task
,
int
newprio
)
static
inline
int
rt_mutex_get_effective_prio
(
struct
task_struct
*
task
,
int
newprio
)
{
return
0
;
return
newprio
;
}
static
inline
struct
task_struct
*
rt_mutex_get_top_task
(
struct
task_struct
*
task
)
...
...
kernel/locking/rtmutex.c
浏览文件 @
bb2ebf08
...
...
@@ -265,15 +265,17 @@ struct task_struct *rt_mutex_get_top_task(struct task_struct *task)
}
/*
* Called by sched_setscheduler() to
check whether the priority chang
e
*
is overruled by a possible priority boosting
.
* Called by sched_setscheduler() to
get the priority which will b
e
*
effective after the change
.
*/
int
rt_mutex_
check
_prio
(
struct
task_struct
*
task
,
int
newprio
)
int
rt_mutex_
get_effective
_prio
(
struct
task_struct
*
task
,
int
newprio
)
{
if
(
!
task_has_pi_waiters
(
task
))
return
0
;
return
newprio
;
return
task_top_pi_waiter
(
task
)
->
task
->
prio
<=
newprio
;
if
(
task_top_pi_waiter
(
task
)
->
task
->
prio
<=
newprio
)
return
task_top_pi_waiter
(
task
)
->
task
->
prio
;
return
newprio
;
}
/*
...
...
kernel/sched/core.c
浏览文件 @
bb2ebf08
...
...
@@ -3300,15 +3300,18 @@ static void __setscheduler_params(struct task_struct *p,
/* Actually do priority change: must hold pi & rq lock. */
static
void
__setscheduler
(
struct
rq
*
rq
,
struct
task_struct
*
p
,
const
struct
sched_attr
*
attr
)
const
struct
sched_attr
*
attr
,
bool
keep_boost
)
{
__setscheduler_params
(
p
,
attr
);
/*
*
If we get here, there was no pi waiters boosting the
*
task. It is safe to use the normal prio
.
*
Keep a potential priority boosting if called from
*
sched_setscheduler()
.
*/
p
->
prio
=
normal_prio
(
p
);
if
(
keep_boost
)
p
->
prio
=
rt_mutex_get_effective_prio
(
p
,
normal_prio
(
p
));
else
p
->
prio
=
normal_prio
(
p
);
if
(
dl_prio
(
p
->
prio
))
p
->
sched_class
=
&
dl_sched_class
;
...
...
@@ -3408,7 +3411,7 @@ static int __sched_setscheduler(struct task_struct *p,
int
newprio
=
dl_policy
(
attr
->
sched_policy
)
?
MAX_DL_PRIO
-
1
:
MAX_RT_PRIO
-
1
-
attr
->
sched_priority
;
int
retval
,
oldprio
,
oldpolicy
=
-
1
,
queued
,
running
;
int
policy
=
attr
->
sched_policy
;
int
new_effective_prio
,
policy
=
attr
->
sched_policy
;
unsigned
long
flags
;
const
struct
sched_class
*
prev_class
;
struct
rq
*
rq
;
...
...
@@ -3590,15 +3593,14 @@ static int __sched_setscheduler(struct task_struct *p,
oldprio
=
p
->
prio
;
/*
* Special case for priority boosted tasks.
*
* If the new priority is lower or equal (user space view)
* than the current (boosted) priority, we just store the new
* Take priority boosted tasks into account. If the new
* effective priority is unchanged, we just store the new
* normal parameters and do not touch the scheduler class and
* the runqueue. This will be done when the task deboost
* itself.
*/
if
(
rt_mutex_check_prio
(
p
,
newprio
))
{
new_effective_prio
=
rt_mutex_get_effective_prio
(
p
,
newprio
);
if
(
new_effective_prio
==
oldprio
)
{
__setscheduler_params
(
p
,
attr
);
task_rq_unlock
(
rq
,
p
,
&
flags
);
return
0
;
...
...
@@ -3612,7 +3614,7 @@ static int __sched_setscheduler(struct task_struct *p,
put_prev_task
(
rq
,
p
);
prev_class
=
p
->
sched_class
;
__setscheduler
(
rq
,
p
,
attr
);
__setscheduler
(
rq
,
p
,
attr
,
true
);
if
(
running
)
p
->
sched_class
->
set_curr_task
(
rq
);
...
...
@@ -6997,27 +6999,23 @@ static int cpuset_cpu_inactive(struct notifier_block *nfb, unsigned long action,
unsigned
long
flags
;
long
cpu
=
(
long
)
hcpu
;
struct
dl_bw
*
dl_b
;
bool
overflow
;
int
cpus
;
switch
(
action
&
~
CPU_TASKS_FROZEN
)
{
switch
(
action
)
{
case
CPU_DOWN_PREPARE
:
/* explicitly allow suspend */
if
(
!
(
action
&
CPU_TASKS_FROZEN
))
{
bool
overflow
;
int
cpus
;
rcu_read_lock_sched
();
dl_b
=
dl_bw_of
(
cpu
);
rcu_read_lock_sched
();
dl_b
=
dl_bw_of
(
cpu
);
raw_spin_lock_irqsave
(
&
dl_b
->
lock
,
flags
);
cpus
=
dl_bw_cpus
(
cpu
);
overflow
=
__dl_overflow
(
dl_b
,
cpus
,
0
,
0
);
raw_spin_unlock_irqrestore
(
&
dl_b
->
lock
,
flags
);
raw_spin_lock_irqsave
(
&
dl_b
->
lock
,
flags
);
cpus
=
dl_bw_cpus
(
cpu
);
overflow
=
__dl_overflow
(
dl_b
,
cpus
,
0
,
0
);
raw_spin_unlock_irqrestore
(
&
dl_b
->
lock
,
flags
);
rcu_read_unlock_sched
();
rcu_read_unlock_sched
();
if
(
overflow
)
return
notifier_from_errno
(
-
EBUSY
);
}
if
(
overflow
)
return
notifier_from_errno
(
-
EBUSY
);
cpuset_update_active_cpus
(
false
);
break
;
case
CPU_DOWN_PREPARE_FROZEN
:
...
...
@@ -7346,7 +7344,7 @@ static void normalize_task(struct rq *rq, struct task_struct *p)
queued
=
task_on_rq_queued
(
p
);
if
(
queued
)
dequeue_task
(
rq
,
p
,
0
);
__setscheduler
(
rq
,
p
,
&
attr
);
__setscheduler
(
rq
,
p
,
&
attr
,
false
);
if
(
queued
)
{
enqueue_task
(
rq
,
p
,
0
);
resched_curr
(
rq
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录