Properly attribute interrupt time on alpha. Previously, interrupt time
was likely to be counted as idle time. Note that we are counting time spent in software interrupt handlers as interrupt time, so this invalidates the i386 meaning of intr_nesting_level. Reviewed by: dfr, bde Tested by: anderson@cs.duke.edu
This commit is contained in:
parent
7ce247ec07
commit
3544d646b5
@ -75,6 +75,7 @@ interrupt(a0, a1, a2, framep)
|
||||
struct trapframe *framep;
|
||||
{
|
||||
|
||||
atomic_add_int(&intr_nesting_level, 1);
|
||||
{
|
||||
struct proc* p = curproc;
|
||||
if (!p) p = &proc0;
|
||||
@ -134,6 +135,7 @@ interrupt(a0, a1, a2, framep)
|
||||
a0, a1, a2);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
atomic_subtract_int(&intr_nesting_level, 1);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -127,6 +127,7 @@ do_sir()
|
||||
u_int32_t pend;
|
||||
int i;
|
||||
|
||||
atomic_add_int(&intr_nesting_level, 1);
|
||||
splsoft();
|
||||
while ((pend = atomic_readandclear(&ipending)) != 0) {
|
||||
for (i = 0; pend && i < 32; i++) {
|
||||
@ -139,6 +140,7 @@ do_sir()
|
||||
}
|
||||
}
|
||||
}
|
||||
atomic_subtract_int(&intr_nesting_level, 1);
|
||||
}
|
||||
|
||||
#define GENSET(name, ptr, bit) \
|
||||
|
@ -65,11 +65,7 @@ struct clockframe {
|
||||
#define CLKF_BASEPRI(framep) \
|
||||
(((framep)->cf_tf.tf_regs[FRAME_PS] & ALPHA_PSL_IPL_MASK) == 0)
|
||||
#define CLKF_PC(framep) ((framep)->cf_tf.tf_regs[FRAME_PC])
|
||||
/*
|
||||
* XXX No way to accurately tell if we were in interrupt mode before taking
|
||||
* clock interrupt.
|
||||
*/
|
||||
#define CLKF_INTR(framep) (0)
|
||||
#define CLKF_INTR(framep) (intr_nesting_level >= 2)
|
||||
|
||||
/*
|
||||
* Preempt the current process if in interrupt from user mode,
|
||||
@ -96,6 +92,7 @@ struct clockframe {
|
||||
|
||||
#ifdef KERNEL
|
||||
u_int32_t astpending; /* need to trap before returning to user mode */
|
||||
u_int32_t intr_nesting_level; /* bookeeping only; counts software intr */
|
||||
u_int32_t want_resched; /* resched() was called */
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user