Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
bb2ebf08
Commit
bb2ebf08
authored
May 08, 2015
by
Ingo Molnar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sched/urgent' into sched/core, before applying new patches
Signed-off-by:
Ingo Molnar
<
mingo@kernel.org
>
parents
6a82b60d
533445c6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
36 deletions
+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
No files found.
include/linux/sched/rt.h
View file @
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
View file @
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
View file @
bb2ebf08
...
...
@@ -3300,14 +3300,17 @@ 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()
.
*/
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
))
...
...
@@ -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,14 +6999,11 @@ static int cpuset_cpu_inactive(struct notifier_block *nfb, unsigned long action,
unsigned
long
flags
;
long
cpu
=
(
long
)
hcpu
;
struct
dl_bw
*
dl_b
;
switch
(
action
&
~
CPU_TASKS_FROZEN
)
{
case
CPU_DOWN_PREPARE
:
/* explicitly allow suspend */
if
(
!
(
action
&
CPU_TASKS_FROZEN
))
{
bool
overflow
;
int
cpus
;
switch
(
action
)
{
case
CPU_DOWN_PREPARE
:
rcu_read_lock_sched
();
dl_b
=
dl_bw_of
(
cpu
);
...
...
@@ -7017,7 +7016,6 @@ static int cpuset_cpu_inactive(struct notifier_block *nfb, unsigned long action,
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment