mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 14:11:20 +00:00
[PATCH] Yet more posix-cpu-timer fixes
This just makes sure that a thread's expiry times can't get reset after
it clears them in do_exit.
This is what allowed us to re-introduce the stricter BUG_ON() check in
a362f463a6
.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
a362f463a6
commit
72ab373a56
1 changed files with 7 additions and 4 deletions
|
@ -497,7 +497,7 @@ static void process_timer_rebalance(struct task_struct *p,
|
||||||
left = cputime_div(cputime_sub(expires.cpu, val.cpu),
|
left = cputime_div(cputime_sub(expires.cpu, val.cpu),
|
||||||
nthreads);
|
nthreads);
|
||||||
do {
|
do {
|
||||||
if (!unlikely(t->exit_state)) {
|
if (!unlikely(t->flags & PF_EXITING)) {
|
||||||
ticks = cputime_add(prof_ticks(t), left);
|
ticks = cputime_add(prof_ticks(t), left);
|
||||||
if (cputime_eq(t->it_prof_expires,
|
if (cputime_eq(t->it_prof_expires,
|
||||||
cputime_zero) ||
|
cputime_zero) ||
|
||||||
|
@ -512,7 +512,7 @@ static void process_timer_rebalance(struct task_struct *p,
|
||||||
left = cputime_div(cputime_sub(expires.cpu, val.cpu),
|
left = cputime_div(cputime_sub(expires.cpu, val.cpu),
|
||||||
nthreads);
|
nthreads);
|
||||||
do {
|
do {
|
||||||
if (!unlikely(t->exit_state)) {
|
if (!unlikely(t->flags & PF_EXITING)) {
|
||||||
ticks = cputime_add(virt_ticks(t), left);
|
ticks = cputime_add(virt_ticks(t), left);
|
||||||
if (cputime_eq(t->it_virt_expires,
|
if (cputime_eq(t->it_virt_expires,
|
||||||
cputime_zero) ||
|
cputime_zero) ||
|
||||||
|
@ -527,7 +527,7 @@ static void process_timer_rebalance(struct task_struct *p,
|
||||||
nsleft = expires.sched - val.sched;
|
nsleft = expires.sched - val.sched;
|
||||||
do_div(nsleft, nthreads);
|
do_div(nsleft, nthreads);
|
||||||
do {
|
do {
|
||||||
if (!unlikely(t->exit_state)) {
|
if (!unlikely(t->flags & PF_EXITING)) {
|
||||||
ns = t->sched_time + nsleft;
|
ns = t->sched_time + nsleft;
|
||||||
if (t->it_sched_expires == 0 ||
|
if (t->it_sched_expires == 0 ||
|
||||||
t->it_sched_expires > ns) {
|
t->it_sched_expires > ns) {
|
||||||
|
@ -566,6 +566,9 @@ static void arm_timer(struct k_itimer *timer, union cpu_time_count now)
|
||||||
struct cpu_timer_list *next;
|
struct cpu_timer_list *next;
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
|
|
||||||
|
if (CPUCLOCK_PERTHREAD(timer->it_clock) && (p->flags & PF_EXITING))
|
||||||
|
return;
|
||||||
|
|
||||||
head = (CPUCLOCK_PERTHREAD(timer->it_clock) ?
|
head = (CPUCLOCK_PERTHREAD(timer->it_clock) ?
|
||||||
p->cpu_timers : p->signal->cpu_timers);
|
p->cpu_timers : p->signal->cpu_timers);
|
||||||
head += CPUCLOCK_WHICH(timer->it_clock);
|
head += CPUCLOCK_WHICH(timer->it_clock);
|
||||||
|
@ -1204,7 +1207,7 @@ static void check_process_timers(struct task_struct *tsk,
|
||||||
|
|
||||||
do {
|
do {
|
||||||
t = next_thread(t);
|
t = next_thread(t);
|
||||||
} while (unlikely(t->exit_state));
|
} while (unlikely(t->flags & PF_EXITING));
|
||||||
} while (t != tsk);
|
} while (t != tsk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue