Skip to content

Commit 9eacb5c

Browse files
committed
sched: Move struct task_cputime to types.h
For upcoming posix-timer changes to avoid include recursion hell. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20190821192920.909530418@linutronix.de
1 parent 2b69942 commit 9eacb5c

2 files changed

Lines changed: 24 additions & 16 deletions

File tree

‎include/linux/sched.h‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/resource.h>
2626
#include <linux/latencytop.h>
2727
#include <linux/sched/prio.h>
28+
#include <linux/sched/types.h>
2829
#include <linux/signal_types.h>
2930
#include <linux/mm_types_task.h>
3031
#include <linux/task_io_accounting.h>
@@ -245,22 +246,6 @@ struct prev_cputime {
245246
#endif
246247
};
247248

248-
/**
249-
* struct task_cputime - collected CPU time counts
250-
* @utime: time spent in user mode, in nanoseconds
251-
* @stime: time spent in kernel mode, in nanoseconds
252-
* @sum_exec_runtime: total time spent on the CPU, in nanoseconds
253-
*
254-
* This structure groups together three kinds of CPU time that are tracked for
255-
* threads and thread groups. Most things considering CPU time want to group
256-
* these counts together and treat all three of them in parallel.
257-
*/
258-
struct task_cputime {
259-
u64 utime;
260-
u64 stime;
261-
unsigned long long sum_exec_runtime;
262-
};
263-
264249
/* Alternate field names when used on cache expirations: */
265250
#define virt_exp utime
266251
#define prof_exp stime

‎include/linux/sched/types.h‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _LINUX_SCHED_TYPES_H
3+
#define _LINUX_SCHED_TYPES_H
4+
5+
#include <linux/types.h>
6+
7+
/**
8+
* struct task_cputime - collected CPU time counts
9+
* @utime: time spent in user mode, in nanoseconds
10+
* @stime: time spent in kernel mode, in nanoseconds
11+
* @sum_exec_runtime: total time spent on the CPU, in nanoseconds
12+
*
13+
* This structure groups together three kinds of CPU time that are tracked for
14+
* threads and thread groups. Most things considering CPU time want to group
15+
* these counts together and treat all three of them in parallel.
16+
*/
17+
struct task_cputime {
18+
u64 utime;
19+
u64 stime;
20+
unsigned long long sum_exec_runtime;
21+
};
22+
23+
#endif

0 commit comments

Comments
 (0)