Re: Spinlocks, intr levels et al

From: Kanoj Sarcar (kanoj@google.engr.sgi.com)
Date: Wed Jan 05 2000 - 17:27:10 EST


>
> Kanoj Sarcar wrote:
> > >
> > > This is only reliable if there is only _one_ such spinlock. As soon as
> > > you have 2 users, you have a lock-up.
> > >
> >
> > I can not follow your scenario, please give an example, involving
> > cpu1, cpu2 etc, L1, L2 etc. Here is what the proposed
> > spin_lock_irqsave_intercpu() function looks like in theory:
> >
>
> cpu1: cpu2:
> spin_lock_irqsave_intercpu(&L1);
> spin_lock_irqsave_intercpu(&L2);
>
> ; now both cpu's have disabled their interrupt flags.
>
> send_ipi_to_other_cpu_and_wait_until_it_has_arrived();
> send_ipi_to_other_cpu_and \
> _wait_until_it_has_arrived();
>
> ; will sleep forever.
>
> eg. flush_tlb_all() uses this send_ipi_to_other_cpu_and_wait().
>
> --
> Manfred
>

Okay. Btw, thinking about this more, spin_lock_irqsave_intercpu()
might be problematic even for a single lock L1. Assume cpu1 has
the lock L1, then cpu2 gets an intr, also tries doing
spin_lock_irqsave_intercpu(&L1). cpu1 now tries to do an inter
cpu function, but cpu2 will not be able to reply. Unless the
inter cpu function uses a suitably higher irq level to interrupt
other cpus.

Right?

Kanoj

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jan 07 2000 - 21:00:04 EST