--- //depot/projects/smpng/sys/alpha/alpha/interrupt.c 2004/07/16 20:38:04 +++ //depot/user/jhb/preemption/alpha/alpha/interrupt.c 2004/07/16 20:47:24 @@ -427,6 +427,13 @@ atomic_add_long(i->cntp, 1); /* + * It seems that we need to return from an interrupt back to PAL + * on the same CPU that received the interrupt, so pin the interrupted + * thread to the current CPU until we return from the interrupt. + */ + sched_pin(); + + /* * Handle a fast interrupt if there is no actual thread for this * interrupt by calling the handler directly without Giant. Note * that this means that any fast interrupt handler must be MP safe. @@ -435,24 +442,20 @@ if ((ih->ih_flags & IH_FAST) != 0) { critical_enter(); ih->ih_handler(ih->ih_argument); + /* XXX */ + td->td_pflags &= ~TDP_OWEPREEMPT; critical_exit(); - return; - } + } else { + if (ithd->it_disable) { + CTR1(KTR_INTR, + "alpha_dispatch_intr: disabling vector 0x%x", + i->vector); + ithd->it_disable(ithd->it_vector); + } - if (ithd->it_disable) { - CTR1(KTR_INTR, - "alpha_dispatch_intr: disabling vector 0x%x", i->vector); - ithd->it_disable(ithd->it_vector); + error = ithread_schedule(ithd); + KASSERT(error == 0, ("got an impossible stray interrupt")); } - - /* - * It seems that we need to return from an interrupt back to PAL - * on the same CPU that received the interrupt, so pin the interrupted - * thread to the current CPU until we return from the interrupt. - */ - sched_pin(); - error = ithread_schedule(ithd); - KASSERT(error == 0, ("got an impossible stray interrupt")); sched_unpin(); } --- //depot/projects/smpng/sys/amd64/amd64/intr_machdep.c 2004/07/02 20:28:06 +++ //depot/user/jhb/preemption/amd64/amd64/intr_machdep.c 2004/07/16 20:14:26 @@ -204,6 +204,8 @@ } isrc->is_pic->pic_eoi_source(isrc); error = 0; + /* XXX */ + td->td_pflags &= ~ TDP_OWEPREEMPT; critical_exit(); } else { /* --- //depot/projects/smpng/sys/i386/i386/intr_machdep.c 2004/07/02 20:28:06 +++ //depot/user/jhb/preemption/i386/i386/intr_machdep.c 2004/07/16 20:14:26 @@ -204,6 +204,8 @@ } isrc->is_pic->pic_eoi_source(isrc); error = 0; + /* XXX */ + td->td_pflags &= ~TDP_OWEPREEMPT; critical_exit(); } else { /*