Sophie

Sophie

distrib > Mandriva > 9.0 > i586 > by-pkgid > 98e91bc877e03cf3582cd163550eb7e3 > files > 644

kernel-doc-html-2.4.19-16mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML
><HEAD
><TITLE
>Locking Between Softirqs</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Unreliable Guide To Locking"
HREF="book1.html"><LINK
REL="UP"
TITLE="Two Main Types of Kernel Locks: Spinlocks and Semaphores"
HREF="c88.html"><LINK
REL="PREVIOUS"
TITLE="Locking Between Tasklets"
HREF="x153.html"><LINK
REL="NEXT"
TITLE="Hard IRQ Context"
HREF="c181.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Unreliable Guide To Locking</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x153.html"
ACCESSKEY="P"
>&#60;&#60;&#60; Previous</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Two Main Types of Kernel Locks: Spinlocks and Semaphores</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="c181.html"
ACCESSKEY="N"
>Next &#62;&#62;&#62;</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="LOCK-SOFTIRQS"
></A
>Locking Between Softirqs</H1
><P
>      Often a <A
HREF="g388.html#GLOSS-SOFTIRQ"
><I
CLASS="FIRSTTERM"
>softirq</I
></A
> might 
      want to share data with itself, a tasklet, or a bottom half.
    </P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="LOCK-SOFTIRQS-SAME"
></A
>The Same Softirq</H2
><P
>       The same softirq can run on the other CPUs: you can use a
       per-CPU array (see <A
HREF="x250.html"
>the Section called <I
>Per-CPU Data</I
> in the chapter called <I
>Common Techniques</I
></A
>) for better
       performance.  If you're going so far as to use a softirq,
       you probably care about scalable performance enough
       to justify the extra complexity.
     </P
><P
>       You'll need to use <TT
CLASS="FUNCTION"
>spin_lock()</TT
> and 
       <TT
CLASS="FUNCTION"
>spin_unlock()</TT
> for shared data.
     </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="LOCK-SOFTIRQS-DIFFERENT"
></A
>Different Softirqs</H2
><P
>       You'll need to use <TT
CLASS="FUNCTION"
>spin_lock()</TT
> and 
       <TT
CLASS="FUNCTION"
>spin_unlock()</TT
> for shared data, whether it 
       be a timer (which can be running on a different CPU), bottom half, 
       tasklet or the same or another softirq.
     </P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x153.html"
ACCESSKEY="P"
>&#60;&#60;&#60; Previous</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="c181.html"
ACCESSKEY="N"
>Next &#62;&#62;&#62;</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Locking Between Tasklets</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c88.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Hard IRQ Context</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>