<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/23 Ren Zhen <span dir="ltr">&lt;<a href="mailto:darwin.xupt@gmail.com" target="_blank">darwin.xupt@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir="ltr"><font color="#500050" face="arial, sans-serif">Hi all:</font><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">    Can anybody help me to understand the usage of &#39;shared_cpu_map&#39; in</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">


<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">/sys/devices/system/cpu/cpuX/</span><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">cache/indexX/.</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">


<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">    </span><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">when I execute the cmd--&#39;#cat shared_cpu_map&#39;, it retures &#39;05&#39;.</span><div>


<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">     And my computer use Ubuntu12.04,Intel core i3 CPU.</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">     I have read one email in LKML,it says:</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">


<br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">&quot;The patch also adds a bunch of interfaces under</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">


<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">/sys/devices/system/cpu/cpuX/</span><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">cache, showing various information about the</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">


<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">caches.  Most useful field being shared_cpu_map, which says what caches are</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">


<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">shared among which logical cpus. &quot;</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">


<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">     But I still cannot catch the meaning of  &#39;which says what caches</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">


<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">are shared among which logical cpus&#39;.</span></div></div></blockquote><div style> You should learn CPU TOPOLOGY firstly.</div><div style> and the number means which processors in system shared caches.</div>

<div style><br></div><div style> index 0: level 1 data cache</div><div style> index 1: level 1 instruction cache</div><div style> index 2: level 2 cache</div><div style> index 3: level 3 cache</div><div style><br></div><div style>

 usually, processors in a core( if <span style="color:rgb(102,102,102);font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:22px">Hyper-threading is turned on</span>) share level 1 and level2 caches.</div><div style>

 processors in a socket share level3 cache</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">

<div><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">     Thanks. </span> <span class=""><font color="#888888"><br>
-- <br><div dir="ltr">Sincerely,<div>Ren Zhen</div></div>
</font></span></div></div>
<br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><i><b>烹饪新手 Linux新手</b></i></div><div><b><i><a href="http://www.edsionte.com" target="_blank">www.edsionte.com</a></i></b></div>
</div></div>