提交 55ccb616 编写于 作者: F Frederic Weisbecker

posix_cpu_timer: consolidate expiry time type

The posix cpu timer expiry time is stored in a union of two types: a 64
bits field if we rely on scheduler precise accounting, or a cputime_t if
we rely on jiffies.

This results in quite some duplicate code and special cases to handle the
two types.

Just unify this into a single 64 bits field.  cputime_t can always fit
into it.
Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Cc: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
上级 8bb495e3
...@@ -7,14 +7,20 @@ ...@@ -7,14 +7,20 @@
#include <linux/timex.h> #include <linux/timex.h>
#include <linux/alarmtimer.h> #include <linux/alarmtimer.h>
union cpu_time_count {
cputime_t cpu; static inline unsigned long long cputime_to_expires(cputime_t expires)
unsigned long long sched; {
}; return (__force unsigned long long)expires;
}
static inline cputime_t expires_to_cputime(unsigned long long expires)
{
return (__force cputime_t)expires;
}
struct cpu_timer_list { struct cpu_timer_list {
struct list_head entry; struct list_head entry;
union cpu_time_count expires, incr; unsigned long long expires, incr;
struct task_struct *task; struct task_struct *task;
int firing; int firing;
}; };
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册