Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321835
b: refs/heads/master
c: 8f61896
h: refs/heads/master
i:
  321833: 7d709b1
  321831: 2fbcd29
v: v3
  • Loading branch information
Mike Galbraith authored and Thomas Gleixner committed Aug 13, 2012
1 parent 70f7b74 commit d5683ed
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 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: e221d028bb08b47e624c5f0a31732c642db9d19a
refs/heads/master: 8f6189684eb4e85e6c593cd710693f09c944450a
22 changes: 21 additions & 1 deletion trunk/kernel/sched/stop_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ static struct task_struct *pick_next_task_stop(struct rq *rq)
{
struct task_struct *stop = rq->stop;

if (stop && stop->on_rq)
if (stop && stop->on_rq) {
stop->se.exec_start = rq->clock_task;
return stop;
}

return NULL;
}
Expand All @@ -52,6 +54,21 @@ static void yield_task_stop(struct rq *rq)

static void put_prev_task_stop(struct rq *rq, struct task_struct *prev)
{
struct task_struct *curr = rq->curr;
u64 delta_exec;

delta_exec = rq->clock_task - curr->se.exec_start;
if (unlikely((s64)delta_exec < 0))
delta_exec = 0;

schedstat_set(curr->se.statistics.exec_max,
max(curr->se.statistics.exec_max, delta_exec));

curr->se.sum_exec_runtime += delta_exec;
account_group_exec_runtime(curr, delta_exec);

curr->se.exec_start = rq->clock_task;
cpuacct_charge(curr, delta_exec);
}

static void task_tick_stop(struct rq *rq, struct task_struct *curr, int queued)
Expand All @@ -60,6 +77,9 @@ static void task_tick_stop(struct rq *rq, struct task_struct *curr, int queued)

static void set_curr_task_stop(struct rq *rq)
{
struct task_struct *stop = rq->stop;

stop->se.exec_start = rq->clock_task;
}

static void switched_to_stop(struct rq *rq, struct task_struct *p)
Expand Down

0 comments on commit d5683ed

Please sign in to comment.