title: Real-life use cases of barriers (DSB, DMB, ISB) in ARM
body: <p>I understand that DSB, DMB, and ISB are barriers for prevent reordering of instructions.
  I also can find lots of very good explanations for each of them, but it is pretty hard to imagine the case that I have to use them.</p>
  
  <p>Also, from the open source codes, I see those barriers from time to time, but it is quite hard to understand why they are used. Just for an example, in Linux kernel 3.7 tcp_rcv_synsent_state_process function, there is a line as follows:</p>
  
  <pre><code>    if (unlikely(po-&gt;origdev))
              sll-&gt;sll_ifindex = orig_dev-&gt;ifindex;
      else
              sll-&gt;sll_ifindex = dev-&gt;ifindex;
  
      smp_mb();
  
      if (po-&gt;tp_version &lt;= TPACKET_V2)
              __packet_set_status(po, h.raw, status);
  </code></pre>
  
  <p>where smp_mb() is basically DMB.
  Could you give me some of your real-life examples?
  It would help understand more about barriers.</p>