diff options
author | Nathan Zimmer <nzimmer@sgi.com> | 2013-05-09 11:24:03 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-05-10 10:35:56 +0200 |
commit | 424c93fe4cbe719e7fd7169248d2b648c493b68d (patch) | |
tree | 297a3fdcc3e35b8941e2854e95feaef1c739de6d /kernel/sched/fair.c | |
parent | 534c97b0950b1967bca1c753aeaed32f5db40264 (diff) | |
download | lwn-424c93fe4cbe719e7fd7169248d2b648c493b68d.tar.gz lwn-424c93fe4cbe719e7fd7169248d2b648c493b68d.zip |
sched: Use this_rq() helper
It is a few instructions more efficent to and slightly more
readable to use this_rq()-> instead of cpu_rq(smp_processor_id())-> .
Size comparison of kernel/sched/fair.o:
text data bss dec hex filename
27972 122 26 28120 6dd8 fair.o.before
27956 122 26 28104 6dc8 fair.o.after
Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1368116643-87971-1-git-send-email-nzimmer@sgi.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/fair.c')
-rw-r--r-- | kernel/sched/fair.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c61a614465c8..f2c9c0c3406c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5418,10 +5418,9 @@ static inline void nohz_balance_exit_idle(int cpu) static inline void set_cpu_sd_state_busy(void) { struct sched_domain *sd; - int cpu = smp_processor_id(); rcu_read_lock(); - sd = rcu_dereference_check_sched_domain(cpu_rq(cpu)->sd); + sd = rcu_dereference_check_sched_domain(this_rq()->sd); if (!sd || !sd->nohz_idle) goto unlock; @@ -5436,10 +5435,9 @@ unlock: void set_cpu_sd_state_idle(void) { struct sched_domain *sd; - int cpu = smp_processor_id(); rcu_read_lock(); - sd = rcu_dereference_check_sched_domain(cpu_rq(cpu)->sd); + sd = rcu_dereference_check_sched_domain(this_rq()->sd); if (!sd || sd->nohz_idle) goto unlock; |