<?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 Hello Le, in Software Tuning, Performance Optimization &amp; Platform Monitoring</title>
    <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979165#M3037</link>
    <description>&lt;P&gt;Hello Le,&lt;/P&gt;
&lt;P&gt;It seems like you are asking if you can have the same physical region of memory defined as WB and uncacheable. Sure you can do this. And you can probably read and modify some data from the WB defined region and then directly access the uncacheable version of the same memory. But your system will probably crash due to cache coherency problems.&lt;/P&gt;
&lt;P&gt;Maybe it would be more useful to&amp;nbsp;explain what&amp;nbsp;you&amp;nbsp;are trying to do.&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2013 17:05:00 GMT</pubDate>
    <dc:creator>Patrick_F_Intel1</dc:creator>
    <dc:date>2013-08-29T17:05:00Z</dc:date>
    <item>
      <title>Is it possible to access RAM directly while the memory is cached?</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979161#M3033</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; A memory location, say X, is cached and modified. Then I want to access the original value of X directly in RAM without interfering the data in the cache. Can I&amp;nbsp;achieve by changing the memory type of X into Uncachable (by setting MTRR)? If not, is it possible at all?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2013 12:51:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979161#M3033</guid>
      <dc:creator>le_g_1</dc:creator>
      <dc:date>2013-08-20T12:51:17Z</dc:date>
    </item>
    <item>
      <title>It is impossible in an</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979162#M3034</link>
      <description>It is impossible in an Operating System ( OS ) that uses Virtual Memory ( VM ) manager. However, in case of Windows OSs you could reserve some amount of memory outside of a regular VM manager controlled memory using a special driver and take a look at Windows DDK for an example.</description>
      <pubDate>Thu, 29 Aug 2013 05:09:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979162#M3034</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-08-29T05:09:00Z</dc:date>
    </item>
    <item>
      <title>Hi Sergey,</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979163#M3035</link>
      <description>&lt;P&gt;Hi Sergey,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;Thank you very much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;If I am able to get a memory region outside the control of VM manager, how can I set the attribute of this region? I want to load come RAM directly into resigsters while keeping the modified corresponding&amp;nbsp;caches untouched.&lt;/P&gt;
&lt;P&gt;Le Guan&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2013 06:01:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979163#M3035</guid>
      <dc:creator>le_g_1</dc:creator>
      <dc:date>2013-08-29T06:01:33Z</dc:date>
    </item>
    <item>
      <title>This operation would require</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979164#M3036</link>
      <description>&lt;P&gt;This operation would require changing the MTRRs without flushing the caches or having different MTRR values on different cores.&amp;nbsp; Neither are supported operations, so it might work and it might not work.&amp;nbsp;&amp;nbsp; There is also a decent chance of hanging the system while experimenting.&lt;/P&gt;
&lt;P&gt;If you have a programmable PCIe device, you might be able to perform a DMA load with the "snoop not required" bit set, but there is an excellent chance that the hardware will ignore you if the MTRR for the region is WB and do the snoop anyway.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2013 15:32:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979164#M3036</guid>
      <dc:creator>McCalpinJohn</dc:creator>
      <dc:date>2013-08-29T15:32:53Z</dc:date>
    </item>
    <item>
      <title>Hello Le,</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979165#M3037</link>
      <description>&lt;P&gt;Hello Le,&lt;/P&gt;
&lt;P&gt;It seems like you are asking if you can have the same physical region of memory defined as WB and uncacheable. Sure you can do this. And you can probably read and modify some data from the WB defined region and then directly access the uncacheable version of the same memory. But your system will probably crash due to cache coherency problems.&lt;/P&gt;
&lt;P&gt;Maybe it would be more useful to&amp;nbsp;explain what&amp;nbsp;you&amp;nbsp;are trying to do.&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2013 17:05:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979165#M3037</guid>
      <dc:creator>Patrick_F_Intel1</dc:creator>
      <dc:date>2013-08-29T17:05:00Z</dc:date>
    </item>
    <item>
      <title>Hi all,</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979166#M3038</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have programed different memory types on two cores using MTRRs, but memory&amp;nbsp;coherency is still maintained as Mr. McCalpin say. That is, on the core with UC type, I always get the modified data in cache of the core with WB type, not the copy in the RAM. I guess this is due to the&amp;nbsp;Self Snoop feature reported by cpuid. Below is from the intel development&amp;nbsp;manual.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Self Snoop. The processor supports the management of conflicting memory types by performing a snoop of its&amp;nbsp;own cache structure for transactions issued to the bus.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Does this implies that caches are always&amp;nbsp;consistent?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Pat, just out of&amp;nbsp;curiosity, I want to dig into the cache details of the Intel CPUs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Mr. McCalpin, It seems that it's CPU that enforces the&amp;nbsp;&amp;nbsp;cache coherency. Do you think PCIe agent and memory controller make any difference?&lt;/P&gt;
&lt;P&gt;Le Guan&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2013 01:29:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979166#M3038</guid>
      <dc:creator>le_g_1</dc:creator>
      <dc:date>2013-08-30T01:29:00Z</dc:date>
    </item>
    <item>
      <title>Hello Le,</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979167#M3039</link>
      <description>&lt;P&gt;Hello Le,&lt;/P&gt;
&lt;P&gt;It doesn't sound right to me doing an uncached read would return the in-cache value. Maybe the modified cached value has already been written back to memory? In any case, this is not an area of my expertise so I could be wrong... it has been almost 20 years since I messed with the same physical memory defined with uncached and writeback attributes... and it seems like it always, eventually, crashed the cpu.&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2013 02:51:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979167#M3039</guid>
      <dc:creator>Patrick_F_Intel1</dc:creator>
      <dc:date>2013-08-30T02:51:32Z</dc:date>
    </item>
    <item>
      <title>Hello Pat,</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979168#M3040</link>
      <description>&lt;P&gt;Hello Pat,&lt;/P&gt;
&lt;P&gt;Here is another experiment using only one core. Maybe this one is more conviencing that the modified&amp;nbsp;cached &amp;nbsp;value has not been written back.&lt;/P&gt;
&lt;P&gt;At first, a&amp;nbsp;variable, say X, is assigned 0. Then X is flushed using clflush. Following, X is&amp;nbsp;changed into 1. At this point, X should be in the L1 data cache with modified state of value 1. Immediately, I modified the current core's MTRR to set the physical memory location of X into UC. Finally, X is read and the result is still 1. This is to say, UC memory access does not bypass the cache subsystem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;I'm&amp;nbsp;quite confident about &amp;nbsp;the setting of MTRR because the correctness is verified by memory access timing.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2013 04:01:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979168#M3040</guid>
      <dc:creator>le_g_1</dc:creator>
      <dc:date>2013-08-30T04:01:00Z</dc:date>
    </item>
    <item>
      <title>We (way, way back) had the</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979169#M3041</link>
      <description>&lt;P&gt;We (way, way back) had the memory setup such that we had the same physical memory setup both as uncacheable and writeback at the same time. The default was to load x with writeback. Then, if we added some amount to the address (like 0x4000_0000 on a 32bit system) we'd get the uncacheable version of the memory. But I didn't setup the MTRR registers, some OS guys programmed the registers and I just tested it.&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2013 04:13:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979169#M3041</guid>
      <dc:creator>Patrick_F_Intel1</dc:creator>
      <dc:date>2013-08-30T04:13:35Z</dc:date>
    </item>
    <item>
      <title>Hello Pat,</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979170#M3042</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Pat,&lt;/P&gt;
&lt;P&gt;Thanks for your information! Sounds interesting! Can you remember the used CPU model? I can run my code on a similar CPU to see if I can get a similar result.&lt;/P&gt;
&lt;P&gt;According to what you said, It seems that you did not set MTRR. Whereas you mapped a physical memory into 2 virtual pages and distinguished&amp;nbsp;the 2 pages by setting page attributes (PAT).&lt;/P&gt;
&lt;P&gt;Le Guan&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2013 05:38:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979170#M3042</guid>
      <dc:creator>le_g_1</dc:creator>
      <dc:date>2013-08-30T05:38:00Z</dc:date>
    </item>
    <item>
      <title>Pentium Pro chip... I don't</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979171#M3043</link>
      <description>&lt;P&gt;Pentium Pro chip... I don't know how they programmed the memory.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2013 05:56:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979171#M3043</guid>
      <dc:creator>Patrick_F_Intel1</dc:creator>
      <dc:date>2013-08-30T05:56:54Z</dc:date>
    </item>
    <item>
      <title>I am not surprised that Intel</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979172#M3044</link>
      <description>&lt;P&gt;I am not surprised that Intel attempts to maintain coherence in the presence of conflicting memory types, but I am pretty sure that this is clearly labelled as an unsupported configuration.&lt;/P&gt;
&lt;P&gt;Given the "self snoop" feature described above, I would expect that PCIe transactions with the "snoop not required" bit set would still snoop if the corresponding MTRR was set to WB.&lt;/P&gt;
&lt;P&gt;If you really want to be sneaky, you might try the following on a 2-socket system:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Assume a PCIe device attached to socket 0&lt;/LI&gt;
&lt;LI&gt;Set up a memory buffer on socket 0&lt;/LI&gt;
&lt;LI&gt;On socket 0, set the MTRRs for that range to UC&lt;/LI&gt;
&lt;LI&gt;On socket 1, set the MTRRs for that range to WB&lt;/LI&gt;
&lt;LI&gt;On socket 1, write a value to a cache line in the memory buffer&lt;/LI&gt;
&lt;LI&gt;Then perform a DMA read from the PCIe device with the "snoop not required" bit set&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;This configuration might be sneaky enough to inhibit the snoop from being sent from socket 0 to socket 1, but the whole topic is in the "unsupported" area, so it will likely be difficult to get support from the engineers who know how the system actually works at the lowest levels.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2013 14:39:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979172#M3044</guid>
      <dc:creator>McCalpinJohn</dc:creator>
      <dc:date>2013-08-30T14:39:52Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;... If I am able to get a</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979173#M3045</link>
      <description>&amp;gt;&amp;gt;... If I am able to get a memory region outside the control of VM manager, how can I set the attribute of this region?..

I simply would like to understand what operating system do you use? Thanks in advance.

To all the rest who responded: Does it mean that all these register(s) manipulations could workaround Virtual Memory address Translation subsystem?</description>
      <pubDate>Sat, 31 Aug 2013 22:51:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979173#M3045</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-08-31T22:51:12Z</dc:date>
    </item>
    <item>
      <title>Hello Sergey,</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979174#M3046</link>
      <description>&lt;P&gt;Hello Sergey,&lt;/P&gt;
&lt;P&gt;I'm not sure what you mean by 'workaround VM address translation system'. The registers settings are valid, unsupported, settings.&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2013 23:00:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979174#M3046</guid>
      <dc:creator>Patrick_F_Intel1</dc:creator>
      <dc:date>2013-08-31T23:00:14Z</dc:date>
    </item>
    <item>
      <title>Hello Sergey,</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979175#M3047</link>
      <description>&lt;P&gt;Hello Sergey,&lt;/P&gt;
&lt;P&gt;I'm not sure what you mean by 'workaround VM address translation system'. The registers settings are valid, unsupported, settings.&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2013 23:00:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979175#M3047</guid>
      <dc:creator>Patrick_F_Intel1</dc:creator>
      <dc:date>2013-08-31T23:00:17Z</dc:date>
    </item>
    <item>
      <title>Hi Mr. Kostrov,</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979176#M3048</link>
      <description>&lt;P&gt;Hi Mr. Kostrov,&lt;/P&gt;
&lt;P&gt;All my experiments were done in a Linux machine.&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt; workaround Virtual Memory address Translation subsystem&lt;/P&gt;
&lt;P&gt;In fact, I do not understand this either. My understanding is that virtual memory is a global&amp;nbsp;configuration(CR0.PG = 0). What you mean by&amp;nbsp;&lt;STRONG&gt;"workaround&amp;nbsp;" &lt;/STRONG&gt;should be something like isolating a memory region from OSs and mapping the virtual memory addresses within this range directly as their physical ones.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Linux, I can manage&amp;nbsp;virtual memory subsystem with full power, so maybe I do not need to&amp;nbsp;&amp;nbsp;'workaround VM address translation system'.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2013 07:31:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979176#M3048</guid>
      <dc:creator>le_g_1</dc:creator>
      <dc:date>2013-09-02T07:31:23Z</dc:date>
    </item>
    <item>
      <title>Hi everybody,</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979177#M3049</link>
      <description>Hi everybody,

&amp;gt;&amp;gt;...What you mean by "workaround " should be something like isolating a memory region from OSs...

Yes.

&amp;gt;&amp;gt;...and mapping the virtual memory addresses within this range directly as their physical ones...

No.

&lt;STRONG&gt;MEMIO&lt;/STRONG&gt; example in the Windows DDK could give you some additional information and please take a look ( sorry for a Windows example ).

Also, some time ago I've created a thread:

Forum Topic: &lt;STRONG&gt;Measuring Memory Bandwidth of Non-NT ( Non-Virtual ) memory&lt;/STRONG&gt;
Web-link: &lt;A href="http://software.intel.com/en-us/forums/topic/279104" target="_blank"&gt;http://software.intel.com/en-us/forums/topic/279104&lt;/A&gt;

and please take a look.

I understand that these details do not help you too much but my point of view is the same: Even on a Linux platform a Virtual Memory translation needs to be bypassed in order to have the &lt;STRONG&gt;direct&lt;/STRONG&gt; access to RAM.</description>
      <pubDate>Mon, 02 Sep 2013 15:53:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979177#M3049</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-09-02T15:53:12Z</dc:date>
    </item>
    <item>
      <title>Hi Mr. Kostrov,</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979178#M3050</link>
      <description>&lt;P&gt;Hi Mr. Kostrov,&lt;/P&gt;
&lt;P&gt;I searched the origin of the&amp;nbsp;excerpted sentence in&amp;nbsp;&lt;A href="http://software.intel.com/en-us/forums/topic/279104"&gt;http://software.intel.com/en-us/forums/topic/279104&lt;/A&gt;. I still cannot be convinced by that configuration, as paging is enabled globally. Unless you disable Virtual Memory temporarily, the driver address must be translated. Do you have any idea about how it is implemented?&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt; a Virtual Memory translation needs to be bypassed in order to have the&amp;nbsp;direct&amp;nbsp;access to RAM.&lt;/P&gt;
&lt;P&gt;What is the&amp;nbsp;reason for that?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2013 09:12:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Is-it-possible-to-access-RAM-directly-while-the-memory-is-cached/m-p/979178#M3050</guid>
      <dc:creator>le_g_1</dc:creator>
      <dc:date>2013-09-03T09:12:06Z</dc:date>
    </item>
  </channel>
</rss>

