Port-alpha archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Some alpha problems in current

On Sun, Feb 03, 2008 at 03:03:53PM -0700, Michael L. Hitch wrote:

>   I'm now trying a kernel where I've added a SPINLOCK_SPIN_HOOK in 
> the places where sys/kern/mutex.c spins, and my MP kernel has been running 
> for over 2 hours.  I'm going to try a LOCKDEBUG kernel again after a while
> to see if that's changed by the addition of the SPINLOCK_SPIN_HOOKs.

Cool. So it seems the pmap locking works :-). Your change has the side
effect that IPIs will be processed from an interrupt firing above IPL_VM,
i.e from the clock interrupt. I think we need to prevent SPINLOCK_SPIN_HOOK
from running the IPIs if the clock interrupt is active on the local CPU. It
should probably also prevent recursion if already handling an IPI.

interrupt(unsigned long a0, unsigned long a1, unsigned long a2,
    struct trapframe *framep)
        struct cpu_info *ci = curcpu();

        switch (a0) {
        case ALPHA_INTR_CLOCK:  /* clock interrupt */

alpha_ipi_process(struct cpu_info *ci, struct trapframe *framep)

#define SPINLOCK_SPIN_HOOK                                              \
do {                                                                    \ 
        struct cpu_info *__ci = curcpu();                               \  
        int __s;                                                        \
        if (__ci->ci_ipis != 0 && __ci->ci_holdipi == 0) {              \
                /* printf("CPU %lu has IPIs pending\n",                 \
                    __ci->ci_cpuid); */                                 \
                __s = splipi();                                         \
                alpha_ipi_process(__ci, NULL);                          \
                splx(__s);                                              \   
        }                                                               \
} while (0)

What do you think?


Home | Main Index | Thread Index | Old Index