Re: Spinlocks: the saga

Jan-Simon Pendry (jsp@ms.com)
Wed, 30 Jun 1999 20:55:13 +0100


Linux Lists wrote:
>
> Hello,
>
> I'm thinking about the issues of the use of spinlocks in the Cyclades
> async driver. However, I have a very minimal idea on how spinlocks work.
> Before you ask: yes, I've read the Documentation/spinlocks.txt and the
> include/asm/spinlock.h files.
>
> The biggest issue is that we're talking about multiport serial cards,
> which means several devices under one card, one IRQ, and sometimes one
> chip (the CD1400 controls 4 ports simultaneously). Thus, the access
> control should be done in three levels:
>
> - one spinlock for regions that are accessed inside the interrupt handler;
> - one for regions that are specific to each port;
> - one for regions that are specific to each chip;
>
> Plus, these regions overlap, so how to decide which spinlock to use at
> that specific case?? Plus, how to synchronize the spinlock calls?? Plus,
> how to control the spinlock (if needed) from inside interrupt handlers??
>
> Well, I have tons of questions. As I know you're all busy, I'd like (if
> possible) some pointers about spinlocks (if possible, about spinlocks _in
> Linux_ ...). Books, URL's, src code, etc. ... anything is welcome. If you
> are willing to help with the code as well, you're welcome too ... ;)
>
> Can you guys help me ?!?!?
>
> Thanks in advance for your time.
>
> Regards,
> Ivan

the basic rule for spin locks is to guard data, not code. a good
paper on this subject is at:

http://www.rdrop.com/users/paulmck/mutexdesignpat.ps.Z

that paper details the various design tradeoffs for a variety of
locking strategies and is good reading.

jan-simon.

-
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/