mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 14:30:53 +07:00
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>
This commit is contained in:
parent
534c97b095
commit
424c93fe4c
@ -5418,10 +5418,9 @@ static inline void nohz_balance_exit_idle(int cpu)
|
|||||||
static inline void set_cpu_sd_state_busy(void)
|
static inline void set_cpu_sd_state_busy(void)
|
||||||
{
|
{
|
||||||
struct sched_domain *sd;
|
struct sched_domain *sd;
|
||||||
int cpu = smp_processor_id();
|
|
||||||
|
|
||||||
rcu_read_lock();
|
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)
|
if (!sd || !sd->nohz_idle)
|
||||||
goto unlock;
|
goto unlock;
|
||||||
@ -5436,10 +5435,9 @@ static inline void set_cpu_sd_state_busy(void)
|
|||||||
void set_cpu_sd_state_idle(void)
|
void set_cpu_sd_state_idle(void)
|
||||||
{
|
{
|
||||||
struct sched_domain *sd;
|
struct sched_domain *sd;
|
||||||
int cpu = smp_processor_id();
|
|
||||||
|
|
||||||
rcu_read_lock();
|
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)
|
if (!sd || sd->nohz_idle)
|
||||||
goto unlock;
|
goto unlock;
|
||||||
|
@ -472,7 +472,7 @@ static int rt_se_boosted(struct sched_rt_entity *rt_se)
|
|||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
static inline const struct cpumask *sched_rt_period_mask(void)
|
static inline const struct cpumask *sched_rt_period_mask(void)
|
||||||
{
|
{
|
||||||
return cpu_rq(smp_processor_id())->rd->span;
|
return this_rq()->rd->span;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static inline const struct cpumask *sched_rt_period_mask(void)
|
static inline const struct cpumask *sched_rt_period_mask(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user