[PATCH v3 2/2] sched/core: Get rid of 'cpu' local variable in __schedule()

From: Alexander Gordeev
Date: Wed Mar 02 2016 - 06:53:50 EST


This update is a continuation of commit 3223d05 ("sched/core:
Remove dead statement in __schedule()") and completes the
removal of a dead code with a removal of an unnecessary 'cpu'
local variable - as it is only used to acquire the current
runqueue.

Cc: Oleg Nesterov <oleg@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Signed-off-by: Alexander Gordeev <agordeev@xxxxxxxxxx>
---
kernel/sched/core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 735e87c..75e62ef 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3131,10 +3131,8 @@ static void __sched notrace __schedule(bool preempt)
struct task_struct *prev, *next;
unsigned long *switch_count;
struct rq *rq;
- int cpu;

- cpu = smp_processor_id();
- rq = cpu_rq(cpu);
+ rq = this_rq();
prev = rq->curr;

/*
--
1.8.3.1