Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clockevents: optimise tick_nohz_stop_sched_tick() a bit

Call
ts = &per_cpu(tick_cpu_sched, cpu);
and
cpu = smp_processor_id();
once instead of twice.

No functional change done, as changed code runs with local irq off.
Reduces source lines and text size (20bytes on x86_64).

[ akpm@linux-foundation.org: Build fix ]

Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by

Karsten Wiese and committed by
Thomas Gleixner
903b8a8d 3f3eafc9

+2 -4
+2 -4
kernel/time/tick-sched.c
··· 158 158 } 159 159 } 160 160 161 - static ktime_t tick_nohz_start_idle(int cpu) 161 + static ktime_t tick_nohz_start_idle(struct tick_sched *ts) 162 162 { 163 - struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); 164 163 ktime_t now, delta; 165 164 166 165 now = ktime_get(); ··· 200 201 local_irq_save(flags); 201 202 202 203 cpu = smp_processor_id(); 203 - now = tick_nohz_start_idle(cpu); 204 204 ts = &per_cpu(tick_cpu_sched, cpu); 205 + now = tick_nohz_start_idle(ts); 205 206 206 207 /* 207 208 * If this cpu is offline and it is the one which updates ··· 221 222 if (need_resched()) 222 223 goto end; 223 224 224 - cpu = smp_processor_id(); 225 225 if (unlikely(local_softirq_pending())) { 226 226 static int ratelimit; 227 227