Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10066
b: refs/heads/master
c: 9092b20
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Oct 23, 2005
1 parent 65640fc commit 489ae28
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 49636bb12892786e4a7b207b37ca7b0c5ca1cae0
refs/heads/master: 9092b20803e4b3b3a480592794a73030f17370b3
20 changes: 14 additions & 6 deletions trunk/kernel/posix-cpu-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,14 +961,16 @@ void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec *itp)
static void check_thread_timers(struct task_struct *tsk,
struct list_head *firing)
{
int maxfire;
struct list_head *timers = tsk->cpu_timers;

maxfire = 20;
tsk->it_prof_expires = cputime_zero;
while (!list_empty(timers)) {
struct cpu_timer_list *t = list_entry(timers->next,
struct cpu_timer_list,
entry);
if (cputime_lt(prof_ticks(tsk), t->expires.cpu)) {
if (!--maxfire || cputime_lt(prof_ticks(tsk), t->expires.cpu)) {
tsk->it_prof_expires = t->expires.cpu;
break;
}
Expand All @@ -977,12 +979,13 @@ static void check_thread_timers(struct task_struct *tsk,
}

++timers;
maxfire = 20;
tsk->it_virt_expires = cputime_zero;
while (!list_empty(timers)) {
struct cpu_timer_list *t = list_entry(timers->next,
struct cpu_timer_list,
entry);
if (cputime_lt(virt_ticks(tsk), t->expires.cpu)) {
if (!--maxfire || cputime_lt(virt_ticks(tsk), t->expires.cpu)) {
tsk->it_virt_expires = t->expires.cpu;
break;
}
Expand All @@ -991,12 +994,13 @@ static void check_thread_timers(struct task_struct *tsk,
}

++timers;
maxfire = 20;
tsk->it_sched_expires = 0;
while (!list_empty(timers)) {
struct cpu_timer_list *t = list_entry(timers->next,
struct cpu_timer_list,
entry);
if (tsk->sched_time < t->expires.sched) {
if (!--maxfire || tsk->sched_time < t->expires.sched) {
tsk->it_sched_expires = t->expires.sched;
break;
}
Expand All @@ -1013,6 +1017,7 @@ static void check_thread_timers(struct task_struct *tsk,
static void check_process_timers(struct task_struct *tsk,
struct list_head *firing)
{
int maxfire;
struct signal_struct *const sig = tsk->signal;
cputime_t utime, stime, ptime, virt_expires, prof_expires;
unsigned long long sched_time, sched_expires;
Expand Down Expand Up @@ -1045,12 +1050,13 @@ static void check_process_timers(struct task_struct *tsk,
} while (t != tsk);
ptime = cputime_add(utime, stime);

maxfire = 20;
prof_expires = cputime_zero;
while (!list_empty(timers)) {
struct cpu_timer_list *t = list_entry(timers->next,
struct cpu_timer_list,
entry);
if (cputime_lt(ptime, t->expires.cpu)) {
if (!--maxfire || cputime_lt(ptime, t->expires.cpu)) {
prof_expires = t->expires.cpu;
break;
}
Expand All @@ -1059,12 +1065,13 @@ static void check_process_timers(struct task_struct *tsk,
}

++timers;
maxfire = 20;
virt_expires = cputime_zero;
while (!list_empty(timers)) {
struct cpu_timer_list *t = list_entry(timers->next,
struct cpu_timer_list,
entry);
if (cputime_lt(utime, t->expires.cpu)) {
if (!--maxfire || cputime_lt(utime, t->expires.cpu)) {
virt_expires = t->expires.cpu;
break;
}
Expand All @@ -1073,12 +1080,13 @@ static void check_process_timers(struct task_struct *tsk,
}

++timers;
maxfire = 20;
sched_expires = 0;
while (!list_empty(timers)) {
struct cpu_timer_list *t = list_entry(timers->next,
struct cpu_timer_list,
entry);
if (sched_time < t->expires.sched) {
if (!--maxfire || sched_time < t->expires.sched) {
sched_expires = t->expires.sched;
break;
}
Expand Down

0 comments on commit 489ae28

Please sign in to comment.