Messages in this thread Patch in this message | | | Date | Tue, 25 Aug 2009 15:18:27 +0530 | From | Bharata B Rao <> | Subject | [RFC v1 PATCH 1/7] 1/7 sched: Rename sched_rt_period_mask() and use it in CFS also |
| |
sched: Rename sched_rt_period_mask() and use it in CFS also.
From: Bharata B Rao <bharata@linux.vnet.ibm.com>
sched_rt_period_mask() is needed in CFS also. Rename it to a generic name and move it to kernel/sched.c. No functionality change in this patch.
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> --- kernel/sched.c | 23 +++++++++++++++++++++++ kernel/sched_rt.c | 19 +------------------ 2 files changed, 24 insertions(+), 18 deletions(-)
--- a/kernel/sched.c +++ b/kernel/sched.c @@ -1732,6 +1732,29 @@ static void cfs_rq_set_shares(struct cfs static void calc_load_account_active(struct rq *this_rq); + +#if defined(CONFIG_RT_GROUP_SCHED) || defined(CONFIG_FAIR_GROUP_SCHED) + +#ifdef CONFIG_SMP +static inline const struct cpumask *sched_bw_period_mask(void) +{ + return cpu_rq(smp_processor_id())->rd->span; +} +#else /* !CONFIG_SMP */ +static inline const struct cpumask *sched_bw_period_mask(void) +{ + return cpu_online_mask; +} +#endif /* CONFIG_SMP */ + +#else +static inline const struct cpumask *sched_bw_period_mask(void) +{ + return cpu_online_mask; +} + +#endif + #include "sched_stats.h" #include "sched_idletask.c" #include "sched_fair.c" --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c @@ -222,18 +222,6 @@ static int rt_se_boosted(struct sched_rt return p->prio != p->normal_prio; } -#ifdef CONFIG_SMP -static inline const struct cpumask *sched_rt_period_mask(void) -{ - return cpu_rq(smp_processor_id())->rd->span; -} -#else -static inline const struct cpumask *sched_rt_period_mask(void) -{ - return cpu_online_mask; -} -#endif - static inline struct rt_rq *sched_rt_period_rt_rq(struct rt_bandwidth *rt_b, int cpu) { @@ -283,11 +271,6 @@ static inline int rt_rq_throttled(struct return rt_rq->rt_throttled; } -static inline const struct cpumask *sched_rt_period_mask(void) -{ - return cpu_online_mask; -} - static inline struct rt_rq *sched_rt_period_rt_rq(struct rt_bandwidth *rt_b, int cpu) { @@ -505,7 +488,7 @@ static int do_sched_rt_period_timer(stru if (!rt_bandwidth_enabled() || rt_b->rt_runtime == RUNTIME_INF) return 1; - span = sched_rt_period_mask(); + span = sched_bw_period_mask(); for_each_cpu(i, span) { int enqueue = 0; struct rt_rq *rt_rq = sched_rt_period_rt_rq(rt_b, i);
| |