mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
sched/headers: Move cputime functionality from <linux/sched.h> and <linux/cputime.h> into <linux/sched/cputime.h>
Move cputime related functionality out of <linux/sched.h>, as most code that includes <linux/sched.h> does not use that functionality. Move data types that are not included in task_struct directly to the signal definitions, into <linux/sched/signal.h>. Also merge the (small) existing <linux/cputime.h> header into <linux/sched/cputime.h>. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
56cd697366
commit
1050b27c52
5 changed files with 214 additions and 214 deletions
|
@ -35,6 +35,39 @@ struct cpu_itimer {
|
|||
u64 incr;
|
||||
};
|
||||
|
||||
/*
|
||||
* This is the atomic variant of task_cputime, which can be used for
|
||||
* storing and updating task_cputime statistics without locking.
|
||||
*/
|
||||
struct task_cputime_atomic {
|
||||
atomic64_t utime;
|
||||
atomic64_t stime;
|
||||
atomic64_t sum_exec_runtime;
|
||||
};
|
||||
|
||||
#define INIT_CPUTIME_ATOMIC \
|
||||
(struct task_cputime_atomic) { \
|
||||
.utime = ATOMIC64_INIT(0), \
|
||||
.stime = ATOMIC64_INIT(0), \
|
||||
.sum_exec_runtime = ATOMIC64_INIT(0), \
|
||||
}
|
||||
/**
|
||||
* struct thread_group_cputimer - thread group interval timer counts
|
||||
* @cputime_atomic: atomic thread group interval timers.
|
||||
* @running: true when there are timers running and
|
||||
* @cputime_atomic receives updates.
|
||||
* @checking_timer: true when a thread in the group is in the
|
||||
* process of checking for thread group timers.
|
||||
*
|
||||
* This structure contains the version of task_cputime, above, that is
|
||||
* used for thread group CPU timer calculations.
|
||||
*/
|
||||
struct thread_group_cputimer {
|
||||
struct task_cputime_atomic cputime_atomic;
|
||||
bool running;
|
||||
bool checking_timer;
|
||||
};
|
||||
|
||||
/*
|
||||
* NOTE! "signal_struct" does not have its own
|
||||
* locking, because a shared signal_struct always
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue