projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
[firefly-linux-kernel-4.4.55.git]
/
kernel
/
posix-cpu-timers.c
diff --git
a/kernel/posix-cpu-timers.c
b/kernel/posix-cpu-timers.c
index 0b7c82ac467eb1db24e0614fe7cc1d2704d27a48..f1525ad06cb3ebbb83680b2bc0176854002217ca 100644
(file)
--- a/
kernel/posix-cpu-timers.c
+++ b/
kernel/posix-cpu-timers.c
@@
-4,8
+4,9
@@
#include <linux/sched.h>
#include <linux/posix-timers.h>
#include <linux/sched.h>
#include <linux/posix-timers.h>
-#include <asm/uaccess.h>
#include <linux/errno.h>
#include <linux/errno.h>
+#include <linux/math64.h>
+#include <asm/uaccess.h>
static int check_clock(const clockid_t which_clock)
{
static int check_clock(const clockid_t which_clock)
{
@@
-20,7
+21,7
@@
static int check_clock(const clockid_t which_clock)
return 0;
read_lock(&tasklist_lock);
return 0;
read_lock(&tasklist_lock);
- p = find_task_by_pid(pid);
+ p = find_task_by_
v
pid(pid);
if (!p || !(CPUCLOCK_PERTHREAD(which_clock) ?
same_thread_group(p, current) : thread_group_leader(p))) {
error = -EINVAL;
if (!p || !(CPUCLOCK_PERTHREAD(which_clock) ?
same_thread_group(p, current) : thread_group_leader(p))) {
error = -EINVAL;
@@
-47,12
+48,10
@@
static void sample_to_timespec(const clockid_t which_clock,
union cpu_time_count cpu,
struct timespec *tp)
{
union cpu_time_count cpu,
struct timespec *tp)
{
- if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED) {
- tp->tv_sec = div_long_long_rem(cpu.sched,
- NSEC_PER_SEC, &tp->tv_nsec);
- } else {
+ if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED)
+ *tp = ns_to_timespec(cpu.sched);
+ else
cputime_to_timespec(cpu.cpu, tp);
cputime_to_timespec(cpu.cpu, tp);
- }
}
static inline int cpu_time_before(const clockid_t which_clock,
}
static inline int cpu_time_before(const clockid_t which_clock,
@@
-305,7
+304,7
@@
int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *tp)
*/
struct task_struct *p;
rcu_read_lock();
*/
struct task_struct *p;
rcu_read_lock();
- p = find_task_by_pid(pid);
+ p = find_task_by_
v
pid(pid);
if (p) {
if (CPUCLOCK_PERTHREAD(which_clock)) {
if (same_thread_group(p, current)) {
if (p) {
if (CPUCLOCK_PERTHREAD(which_clock)) {
if (same_thread_group(p, current)) {
@@
-354,7
+353,7
@@
int posix_cpu_timer_create(struct k_itimer *new_timer)
if (pid == 0) {
p = current;
} else {
if (pid == 0) {
p = current;
} else {
- p = find_task_by_pid(pid);
+ p = find_task_by_
v
pid(pid);
if (p && !same_thread_group(p, current))
p = NULL;
}
if (p && !same_thread_group(p, current))
p = NULL;
}
@@
-362,7
+361,7
@@
int posix_cpu_timer_create(struct k_itimer *new_timer)
if (pid == 0) {
p = current->group_leader;
} else {
if (pid == 0) {
p = current->group_leader;
} else {
- p = find_task_by_pid(pid);
+ p = find_task_by_
v
pid(pid);
if (p && !thread_group_leader(p))
p = NULL;
}
if (p && !thread_group_leader(p))
p = NULL;
}
@@
-1087,45
+1086,45
@@
static void check_process_timers(struct task_struct *tsk,
maxfire = 20;
prof_expires = cputime_zero;
while (!list_empty(timers)) {
maxfire = 20;
prof_expires = cputime_zero;
while (!list_empty(timers)) {
- struct cpu_timer_list *t = list_first_entry(timers,
+ struct cpu_timer_list *t
l
= list_first_entry(timers,
struct cpu_timer_list,
entry);
struct cpu_timer_list,
entry);
- if (!--maxfire || cputime_lt(ptime, t->expires.cpu)) {
- prof_expires = t->expires.cpu;
+ if (!--maxfire || cputime_lt(ptime, t
l
->expires.cpu)) {
+ prof_expires = t
l
->expires.cpu;
break;
}
break;
}
- t->firing = 1;
- list_move_tail(&t->entry, firing);
+ t
l
->firing = 1;
+ list_move_tail(&t
l
->entry, firing);
}
++timers;
maxfire = 20;
virt_expires = cputime_zero;
while (!list_empty(timers)) {
}
++timers;
maxfire = 20;
virt_expires = cputime_zero;
while (!list_empty(timers)) {
- struct cpu_timer_list *t = list_first_entry(timers,
+ struct cpu_timer_list *t
l
= list_first_entry(timers,
struct cpu_timer_list,
entry);
struct cpu_timer_list,
entry);
- if (!--maxfire || cputime_lt(utime, t->expires.cpu)) {
- virt_expires = t->expires.cpu;
+ if (!--maxfire || cputime_lt(utime, t
l
->expires.cpu)) {
+ virt_expires = t
l
->expires.cpu;
break;
}
break;
}
- t->firing = 1;
- list_move_tail(&t->entry, firing);
+ t
l
->firing = 1;
+ list_move_tail(&t
l
->entry, firing);
}
++timers;
maxfire = 20;
sched_expires = 0;
while (!list_empty(timers)) {
}
++timers;
maxfire = 20;
sched_expires = 0;
while (!list_empty(timers)) {
- struct cpu_timer_list *t = list_first_entry(timers,
+ struct cpu_timer_list *t
l
= list_first_entry(timers,
struct cpu_timer_list,
entry);
struct cpu_timer_list,
entry);
- if (!--maxfire || sum_sched_runtime < t->expires.sched) {
- sched_expires = t->expires.sched;
+ if (!--maxfire || sum_sched_runtime < t
l
->expires.sched) {
+ sched_expires = t
l
->expires.sched;
break;
}
break;
}
- t->firing = 1;
- list_move_tail(&t->entry, firing);
+ t
l
->firing = 1;
+ list_move_tail(&t
l
->entry, firing);
}
/*
}
/*