Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339063
b: refs/heads/master
c: 18bf280
h: refs/heads/master
i:
  339061: 5aa22f0
  339059: 09c7f91
  339055: 99663b6
v: v3
  • Loading branch information
Ben Segall authored and Ingo Molnar committed Oct 24, 2012
1 parent a4a92b7 commit 29ec94f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d85f21c94f7f7a84d0ba686c58aa6d9da58fdbb
refs/heads/master: 18bf2805d9b30cb823d4919b42cd230f59c7ce1f
10 changes: 8 additions & 2 deletions trunk/kernel/sched/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,20 @@ static unsigned long nsec_low(unsigned long long nsec)
static void print_cfs_group_stats(struct seq_file *m, int cpu, struct task_group *tg)
{
struct sched_entity *se = tg->se[cpu];
if (!se)
return;

#define P(F) \
SEQ_printf(m, " .%-30s: %lld\n", #F, (long long)F)
#define PN(F) \
SEQ_printf(m, " .%-30s: %lld.%06ld\n", #F, SPLIT_NS((long long)F))

if (!se) {
struct sched_avg *avg = &cpu_rq(cpu)->avg;
P(avg->runnable_avg_sum);
P(avg->runnable_avg_period);
return;
}


PN(se->exec_start);
PN(se->vruntime);
PN(se->sum_exec_runtime);
Expand Down
18 changes: 16 additions & 2 deletions trunk/kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -1087,8 +1087,14 @@ static inline void update_entity_load_avg(struct sched_entity *se)
__update_entity_runnable_avg(rq_of(cfs_rq_of(se))->clock_task, &se->avg,
se->on_rq);
}

static inline void update_rq_runnable_avg(struct rq *rq, int runnable)
{
__update_entity_runnable_avg(rq->clock_task, &rq->avg, runnable);
}
#else
static inline void update_entity_load_avg(struct sched_entity *se) {}
static inline void update_rq_runnable_avg(struct rq *rq, int runnable) {}
#endif

static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se)
Expand Down Expand Up @@ -2340,8 +2346,10 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
update_cfs_shares(cfs_rq);
}

if (!se)
if (!se) {
update_rq_runnable_avg(rq, rq->nr_running);
inc_nr_running(rq);
}
hrtick_update(rq);
}

Expand Down Expand Up @@ -2399,8 +2407,10 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
update_cfs_shares(cfs_rq);
}

if (!se)
if (!se) {
dec_nr_running(rq);
update_rq_runnable_avg(rq, 1);
}
hrtick_update(rq);
}

Expand Down Expand Up @@ -4586,6 +4596,8 @@ void idle_balance(int this_cpu, struct rq *this_rq)
if (this_rq->avg_idle < sysctl_sched_migration_cost)
return;

update_rq_runnable_avg(this_rq, 1);

/*
* Drop the rq->lock, but keep IRQ/preempt disabled.
*/
Expand Down Expand Up @@ -5083,6 +5095,8 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)
cfs_rq = cfs_rq_of(se);
entity_tick(cfs_rq, se, queued);
}

update_rq_runnable_avg(rq, 1);
}

/*
Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/sched/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,8 @@ struct rq {
#ifdef CONFIG_SMP
struct llist_head wake_list;
#endif

struct sched_avg avg;
};

static inline int cpu_of(struct rq *rq)
Expand Down

0 comments on commit 29ec94f

Please sign in to comment.