Commit 429d43bc authored by Ingo Molnar's avatar Ingo Molnar

sched: cleanup: simplify cfs_rq_curr() methods

cleanup: simplify cfs_rq_curr() methods - now that the cfs_rq->curr
pointer is unconditionally present, remove the wrappers.

  kernel/sched.o:
      text    data     bss     dec     hex filename
     11784     224    2012   14020    36c4 sched.o.before
     11784     224    2012   14020    36c4 sched.o.after
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarMike Galbraith <efault@gmx.de>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 62160e3f
...@@ -111,18 +111,6 @@ extern struct sched_class fair_sched_class; ...@@ -111,18 +111,6 @@ extern struct sched_class fair_sched_class;
* CFS operations on generic schedulable entities: * CFS operations on generic schedulable entities:
*/ */
/* currently running entity (if any) on this cfs_rq */
static inline struct sched_entity *cfs_rq_curr(struct cfs_rq *cfs_rq)
{
return cfs_rq->curr;
}
static inline void
set_cfs_rq_curr(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
cfs_rq->curr = se;
}
#ifdef CONFIG_FAIR_GROUP_SCHED #ifdef CONFIG_FAIR_GROUP_SCHED
/* cpu runqueue to which this cfs_rq is attached */ /* cpu runqueue to which this cfs_rq is attached */
...@@ -382,7 +370,7 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity *curr, ...@@ -382,7 +370,7 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity *curr,
static void update_curr(struct cfs_rq *cfs_rq) static void update_curr(struct cfs_rq *cfs_rq)
{ {
struct sched_entity *curr = cfs_rq_curr(cfs_rq); struct sched_entity *curr = cfs_rq->curr;
u64 now = rq_of(cfs_rq)->clock; u64 now = rq_of(cfs_rq)->clock;
unsigned long delta_exec; unsigned long delta_exec;
...@@ -440,7 +428,7 @@ static void update_stats_enqueue(struct cfs_rq *cfs_rq, struct sched_entity *se) ...@@ -440,7 +428,7 @@ static void update_stats_enqueue(struct cfs_rq *cfs_rq, struct sched_entity *se)
* Are we enqueueing a waiting task? (for current tasks * Are we enqueueing a waiting task? (for current tasks
* a dequeue/enqueue event is a NOP) * a dequeue/enqueue event is a NOP)
*/ */
if (se != cfs_rq_curr(cfs_rq)) if (se != cfs_rq->curr)
update_stats_wait_start(cfs_rq, se); update_stats_wait_start(cfs_rq, se);
/* /*
* Update the key: * Update the key:
...@@ -511,7 +499,7 @@ update_stats_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se) ...@@ -511,7 +499,7 @@ update_stats_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se)
* Mark the end of the wait period if dequeueing a * Mark the end of the wait period if dequeueing a
* waiting task: * waiting task:
*/ */
if (se != cfs_rq_curr(cfs_rq)) if (se != cfs_rq->curr)
update_stats_wait_end(cfs_rq, se); update_stats_wait_end(cfs_rq, se);
} }
...@@ -717,7 +705,7 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se) ...@@ -717,7 +705,7 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
*/ */
update_stats_wait_end(cfs_rq, se); update_stats_wait_end(cfs_rq, se);
update_stats_curr_start(cfs_rq, se); update_stats_curr_start(cfs_rq, se);
set_cfs_rq_curr(cfs_rq, se); cfs_rq->curr = se;
#ifdef CONFIG_SCHEDSTATS #ifdef CONFIG_SCHEDSTATS
/* /*
* Track our maximum slice length, if the CPU's load is at * Track our maximum slice length, if the CPU's load is at
...@@ -754,7 +742,7 @@ static void put_prev_entity(struct cfs_rq *cfs_rq, struct sched_entity *prev) ...@@ -754,7 +742,7 @@ static void put_prev_entity(struct cfs_rq *cfs_rq, struct sched_entity *prev)
if (prev->on_rq) if (prev->on_rq)
update_stats_wait_start(cfs_rq, prev); update_stats_wait_start(cfs_rq, prev);
set_cfs_rq_curr(cfs_rq, NULL); cfs_rq->curr = NULL;
} }
static void entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) static void entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
...@@ -1153,7 +1141,7 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr) ...@@ -1153,7 +1141,7 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr)
static void task_new_fair(struct rq *rq, struct task_struct *p) static void task_new_fair(struct rq *rq, struct task_struct *p)
{ {
struct cfs_rq *cfs_rq = task_cfs_rq(p); struct cfs_rq *cfs_rq = task_cfs_rq(p);
struct sched_entity *se = &p->se, *curr = cfs_rq_curr(cfs_rq); struct sched_entity *se = &p->se, *curr = cfs_rq->curr;
sched_info_queued(p); sched_info_queued(p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment