Skip to content

Commit

Permalink
sched/cputime: Expose cputime_adjust()
Browse files Browse the repository at this point in the history
Will be used by basic cgroup resource stat reporting later.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
  • Loading branch information
Tejun Heo committed Sep 25, 2017
1 parent e19b205 commit cfb766d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion include/linux/sched/cputime.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ static inline void task_cputime_scaled(struct task_struct *t,

extern void task_cputime_adjusted(struct task_struct *p, u64 *ut, u64 *st);
extern void thread_group_cputime_adjusted(struct task_struct *p, u64 *ut, u64 *st);

extern void cputime_adjust(struct task_cputime *curr, struct prev_cputime *prev,
u64 *ut, u64 *st);

/*
* Thread group CPU time accounting.
Expand Down
5 changes: 2 additions & 3 deletions kernel/sched/cputime.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,8 @@ static u64 scale_stime(u64 stime, u64 rtime, u64 total)
*
* Assuming that rtime_i+1 >= rtime_i.
*/
static void cputime_adjust(struct task_cputime *curr,
struct prev_cputime *prev,
u64 *ut, u64 *st)
void cputime_adjust(struct task_cputime *curr, struct prev_cputime *prev,
u64 *ut, u64 *st)
{
u64 rtime, stime, utime;
unsigned long flags;
Expand Down

0 comments on commit cfb766d

Please sign in to comment.