<p><a href="https://gerrit.osmocom.org/c/libosmocore/+/25415">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/25415/2/src/vty/cpu_sched_vty.c">File src/vty/cpu_sched_vty.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/25415/2/src/vty/cpu_sched_vty.c@425">Patch Set #2, Line 425:</a> <code style="font-family:monospace,monospace">      if (applynow) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">So the problem imho is that your are interactively using a set of VTY commands in the "configure terminal" section which was aimed at be applied/parsed from config file during startup, when only 1 thread exists and other threads are created later.<br>I see 3 possible solutions for your use case I would agree with:</p><p style="white-space: pre-wrap; word-wrap: break-word;">1- Have a new VTY command in the "enable" node which is aimed at interactively (while the program is running) setting/changing the cu affinity of a given (or all) thread. This new command would basically reuse most of the existing code in this function (cfg_sched_cpu_affinity_cmd) with the exception that it wouldn't store config (see line 451), or it would store it temporarily but not written back to cfg file (have a ->temporary=true).</p><p style="white-space: pre-wrap; word-wrap: break-word;">2- You use this same VTY command, using "delay" (since that's what's expected for the thread you want to set), and then, after storing the config, you attempt applying it now too if VTY is in interactive mode:<br>"""<br>if (!applynow || vty->type != VTY_FILE) {<br>rc = my_sched_setaffinity(tid_type, pid, cpuset, cpuset_size);<br>if (rc == -1) vty_oput("%% [delay] Failed to apply the cmd immediately, configuration stored for later use\n")<br>}<br>"""</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/25415">change 25415</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/25415"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Id8405099e6b316c2e14fb0c9b3c5e80a68a91277 </div>
<div style="display:none"> Gerrit-Change-Number: 25415 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Hoernchen <ewild@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 10 Sep 2021 15:02:27 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>