<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic MFENCE and CLFLUSH in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MFENCE-and-CLFLUSH/m-p/889064#M3684</link>
    <description>&lt;P&gt;I have a question regarding CLFLUSH.&lt;/P&gt;
&lt;P&gt;Presumably if I code in assembler (or equivilent intrinsics)&lt;/P&gt;
&lt;P&gt;MFENCE&lt;BR /&gt;CLFLUSH [location]&lt;BR /&gt;SomeReadInstruction [location]&lt;/P&gt;
&lt;P&gt;The processor will "drill" through the cache to obtain the contents of [location] (or locations in samecache line as location).&lt;/P&gt;
&lt;P&gt;The problem I see though is what happens if an interruptand possiblythread context switch occures during the CLFLUSH? i.e. between CFLUSH and SomeReadInstruction.&lt;/P&gt;
&lt;P&gt;It is potentialy possible that the interrupt, the O/S or read-ahead logic may have populated the cache line and then returning much later resume at SomeReadInstruction and then re-read the now stale cache line.&lt;/P&gt;
&lt;P&gt;Alternately if I were only interested in read&lt;/P&gt;
&lt;P&gt;XOR RAX,RAX&lt;BR /&gt;MFENCE&lt;BR /&gt;LOCK CMPXCHG [location], RAX&lt;/P&gt;
&lt;P&gt;Is there any sequencing rules such as if MFENCE is followed by CFLUSH, is followed by memory reference instruction that the chain of instructions occure without interruption? If so, then would anyone have these rules? Or the Intel document name?&lt;/P&gt;
&lt;P&gt;(the rule would have to nip abusive use of the rule such as the CIF problem in the old PDP-8 system)&lt;/P&gt;
&lt;P&gt;TIA&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jan 2007 06:44:21 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2007-01-16T06:44:21Z</dc:date>
    <item>
      <title>MFENCE and CLFLUSH</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MFENCE-and-CLFLUSH/m-p/889064#M3684</link>
      <description>&lt;P&gt;I have a question regarding CLFLUSH.&lt;/P&gt;
&lt;P&gt;Presumably if I code in assembler (or equivilent intrinsics)&lt;/P&gt;
&lt;P&gt;MFENCE&lt;BR /&gt;CLFLUSH [location]&lt;BR /&gt;SomeReadInstruction [location]&lt;/P&gt;
&lt;P&gt;The processor will "drill" through the cache to obtain the contents of [location] (or locations in samecache line as location).&lt;/P&gt;
&lt;P&gt;The problem I see though is what happens if an interruptand possiblythread context switch occures during the CLFLUSH? i.e. between CFLUSH and SomeReadInstruction.&lt;/P&gt;
&lt;P&gt;It is potentialy possible that the interrupt, the O/S or read-ahead logic may have populated the cache line and then returning much later resume at SomeReadInstruction and then re-read the now stale cache line.&lt;/P&gt;
&lt;P&gt;Alternately if I were only interested in read&lt;/P&gt;
&lt;P&gt;XOR RAX,RAX&lt;BR /&gt;MFENCE&lt;BR /&gt;LOCK CMPXCHG [location], RAX&lt;/P&gt;
&lt;P&gt;Is there any sequencing rules such as if MFENCE is followed by CFLUSH, is followed by memory reference instruction that the chain of instructions occure without interruption? If so, then would anyone have these rules? Or the Intel document name?&lt;/P&gt;
&lt;P&gt;(the rule would have to nip abusive use of the rule such as the CIF problem in the old PDP-8 system)&lt;/P&gt;
&lt;P&gt;TIA&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2007 06:44:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MFENCE-and-CLFLUSH/m-p/889064#M3684</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2007-01-16T06:44:21Z</dc:date>
    </item>
  </channel>
</rss>

