aboutsummaryrefslogtreecommitdiff
path: root/kernel/sched
diff options
context:
space:
mode:
authorfranciscofranco <franciscofranco.1990@gmail.com>2015-12-05 04:01:17 +0000
committerMister Oyster <oysterized@gmail.com>2017-12-25 16:11:14 +0100
commit2d6a958ab8f0aaa9c20738a0ac22ba94ae000362 (patch)
tree1c2fafd423477f54ef91480567b8937d9a5215dc /kernel/sched
parente5a41b03c4e0a299623929f41a3a1e17fa82076a (diff)
arm64: use the new *_relaxed macros for lower power usage
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com> Signed-off-by: Joe Maples <joe@frap129.org> Signed-off-by: Mister Oyster <oysterized@gmail.com>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index c6d3219b1..265f8359e 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1271,9 +1271,10 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state)
* is actually now running somewhere else!
*/
while (task_running(rq, p)) {
- if (match_state && unlikely(p->state != match_state))
+ if (match_state && unlikely(cpu_relaxed_read_long
+ (&(p->state)) != match_state))
return 0;
- cpu_relax();
+ cpu_read_relax();
}
/*
@@ -1603,7 +1604,7 @@ enum ipi_msg_type {
};
void scheduler_ipi(void)
{
- if (llist_empty(&this_rq()->wake_list)
+ if (llist_empty_relaxed(&this_rq()->wake_list)
&& !tick_nohz_full_cpu(smp_processor_id())
&& !got_nohz_idle_kick()){
mt_trace_ISR_start(IPI_RESCHEDULE);
@@ -1753,8 +1754,8 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
* If the owning (remote) cpu is still in the middle of schedule() with
* this task as prev, wait until its done referencing the task.
*/
- while (p->on_cpu)
- cpu_relax();
+ while (cpu_relaxed_read(&(p->on_cpu)))
+ cpu_read_relax();
/*
* Pairs with the smp_wmb() in finish_lock_switch().
*/
@@ -4261,7 +4262,7 @@ int idle_cpu(int cpu)
return 0;
#ifdef CONFIG_SMP
- if (!llist_empty(&rq->wake_list))
+ if (!llist_empty_relaxed(&rq->wake_list))
return 0;
#endif