diff options
| author | Robert Love <rml@tech9.net> | 2002-06-13 20:51:48 -0700 |
|---|---|---|
| committer | Dave Kleikamp <shaggy@kleikamp.austin.ibm.com> | 2002-06-13 20:51:48 -0700 |
| commit | 4d0b85ea4610b51beeb97cd0cc43edb1be42d063 (patch) | |
| tree | 94ee171a0673171fd474555a2d1b9a4529b72a41 /include/linux/timer.h | |
| parent | d257b778c1c21ebb99c400e0ffa9f3af215da18a (diff) | |
[PATCH] kernel preemption bits (2/2)
In both preempt_schedule in sched.c and resume_kernel in entry.S, it is
possible to return with need_resched set and thus a pending preemption
but not service that preemption for some time.
Consider:
- return from schedule() to preempt_schedule
- interrupt occurs, sets need_resched
- we cannot preempt since preempt_count = PREEMPT_ACTIVE
- back in preempt_schedule, set preempt_count = 0
Now we again can preempt, but we will not. Instead we return and
continue executing. On the next interrupt, we will redo the whole
fiasco which is a waste since we could of reentered schedule while we
were there. Worse, if we acquire a lock before the next interrupt we
can potentially delay the pending reschedule a very long time. This is
not acceptable.
The solution is to check for and loop on need_resched on resume_kernel
and preempt_schedule like schedule itself does.
Diffstat (limited to 'include/linux/timer.h')
0 files changed, 0 insertions, 0 deletions
