Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269197
b: refs/heads/master
c: e8abccb
h: refs/heads/master
i:
  269195: 666bbd6
v: v3
  • Loading branch information
Peter Zijlstra authored and Thomas Gleixner committed Sep 8, 2011
1 parent 61a5af6 commit e3228d7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 28 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: 4f37a68cdaf6dea833cfdded2a3e0c47c0f006da
refs/heads/master: e8abccb719377af63cb0f1fed289db405e3def16
1 change: 0 additions & 1 deletion trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,6 @@ static inline void disable_sched_clock_irqtime(void) {}

extern unsigned long long
task_sched_runtime(struct task_struct *task);
extern unsigned long long thread_group_sched_runtime(struct task_struct *task);

/* sched_exec is called by processes performing an exec */
#ifdef CONFIG_SMP
Expand Down
5 changes: 3 additions & 2 deletions trunk/kernel/posix-cpu-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times)
do {
times->utime = cputime_add(times->utime, t->utime);
times->stime = cputime_add(times->stime, t->stime);
times->sum_exec_runtime += t->se.sum_exec_runtime;
times->sum_exec_runtime += task_sched_runtime(t);
} while_each_thread(tsk, t);
out:
rcu_read_unlock();
Expand Down Expand Up @@ -312,7 +312,8 @@ static int cpu_clock_sample_group(const clockid_t which_clock,
cpu->cpu = cputime.utime;
break;
case CPUCLOCK_SCHED:
cpu->sched = thread_group_sched_runtime(p);
thread_group_cputime(p, &cputime);
cpu->sched = cputime.sum_exec_runtime;
break;
}
return 0;
Expand Down
24 changes: 0 additions & 24 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3724,30 +3724,6 @@ unsigned long long task_sched_runtime(struct task_struct *p)
return ns;
}

/*
* Return sum_exec_runtime for the thread group.
* In case the task is currently running, return the sum plus current's
* pending runtime that have not been accounted yet.
*
* Note that the thread group might have other running tasks as well,
* so the return value not includes other pending runtime that other
* running tasks might have.
*/
unsigned long long thread_group_sched_runtime(struct task_struct *p)
{
struct task_cputime totals;
unsigned long flags;
struct rq *rq;
u64 ns;

rq = task_rq_lock(p, &flags);
thread_group_cputime(p, &totals);
ns = totals.sum_exec_runtime + do_task_delta_exec(p, rq);
task_rq_unlock(rq, p, &flags);

return ns;
}

/*
* Account user cpu time to a process.
* @p: the process that the cpu time gets accounted to
Expand Down

0 comments on commit e3228d7

Please sign in to comment.