<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello</p>
<p>Recent Linux kernels (4.19 iirc) have a switch to toggle SMT in
/sys/devices/system/cpu/smt/control (write "on" or "off" in this
file). Current state can be read from
/sys/devices/system/cpu/smt/active</p>
<p>Brice</p>
<p><br>
</p>
<div class="moz-cite-prefix">Le 22/10/2020 à 17:24, Alexander Kruppa
via cfarm-users a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CADCD=BAzwrbK8HqtiORPFj9xPe_8NWcsbBORaVTDUnjzVmQ0nA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hello,</div>
<div><br>
</div>
<div>would it be possible to allow users to disable SMT (a.k.a.
hyperthreading) temporarily on one cpu core? This would be
useful for doing timing runs that are not affected by other
processes running on another logical cpu on the same physical
core.</div>
<div><br>
</div>
<div>This can be accomplished by taking all but one logical cpu
on a physical core offline via <br>
</div>
<div>/sys/devices/system/cpu/cpu*/online</div>
<div>For example, on gcc121,<br>
</div>
<div>$ head
/sys/devices/system/cpu/cpu??/topology/thread_siblings_list |
tail -n 2</div>
<div>==>
/sys/devices/system/cpu/cpu31/topology/thread_siblings_list
<==<br>
15,31</div>
<div>shows that logical cpus 15 and 31 are on the same physical
core. With</div>
<div># echo 0 > /sys/devices/system/cpu/cpu31/online</div>
<div>as root, logical cpu 31 can be taken offline, so that
processes on logical core 15 run effectively without SMT
interference until logical core 31 is put online again.</div>
<div><br>
</div>
<div>Is there any interest in allowing such a mechanism?</div>
<div><br>
</div>
<div>All the best,</div>
<div>Alex</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
cfarm-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfarm-users@lists.tetaneutral.net">cfarm-users@lists.tetaneutral.net</a>
<a class="moz-txt-link-freetext" href="https://lists.tetaneutral.net/listinfo/cfarm-users">https://lists.tetaneutral.net/listinfo/cfarm-users</a>
</pre>
</blockquote>
</body>
</html>