cputime: Bring cputime -> nsecs conversion
We already have nsecs_to_cputime(). Now we need to be able to convert the other way around in order to fix a bug on steal time accounting. Cc: Ingo Molnar <mingo@kernel.org> Cc: Marcelo Tosatti <mtosatti@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Acked-by: Rik van Riel <riel@redhat.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
This commit is contained in:
@@ -44,6 +44,8 @@ typedef u64 __nocast cputime64_t;
|
||||
/*
|
||||
* Convert cputime <-> nanoseconds
|
||||
*/
|
||||
#define cputime_to_nsecs(__ct) \
|
||||
(__force u64)(__ct)
|
||||
#define nsecs_to_cputime(__nsecs) \
|
||||
(__force cputime_t)(__nsecs)
|
||||
|
||||
|
Reference in New Issue
Block a user