<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rt-thread.git/src/utest/smp/smp_bind_affinity_tc.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/rt-thread.git/atom/src/utest/smp/smp_bind_affinity_tc.c?h=master</id>
<link rel='self' href='http://cgit.235523.xyz/rt-thread.git/atom/src/utest/smp/smp_bind_affinity_tc.c?h=master'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/'/>
<updated>2026-06-17T01:51:13Z</updated>
<entry>
<title>fix: stabilize smp_bind_affinity_tc on SMP CI</title>
<updated>2026-06-17T01:51:13Z</updated>
<author>
<name>GuEe-GUI</name>
<email>2991707448@qq.com</email>
</author>
<published>2026-06-16T06:20:20Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=6fc3e18912e60505fa6e2a6a4d444ab84e326e9b'/>
<id>urn:sha1:6fc3e18912e60505fa6e2a6a4d444ab84e326e9b</id>
<content type='text'>
This change fixes intermittent failures of the `core.smp_bind_affinity`
utest across SMP CI targets. The original failure was a flaky assertion on
unbound threads (`thread_inc[x] != thread_tic[x]` in thread_entry), not
incorrect bind_cpu behavior. CI logs already showed T0 binding worked
(thread_inc[0] == thread_tic[0] == 100) while the not_equal check failed.
The root issue is that unbound-thread CPU placement is platform-dependent
and outside the bind_cpu contract. On dual-core RISC-V/ARMv7 CI, an
unbound thread may legitimately run all iterations on core 0 while T0
delays on the same core, so any assertion requiring cross-core migration
(thread_inc != thread_tic, or core_mask with multiple bits) remains flaky.
This patch narrows the test to what bind_affinity actually verifies: T0
bound to core 0 must always execute on core 0. Unbound threads only add
scheduling pressure; their core_mask is printed for observation but not
asserted.
Changes:
- Sample `rt_hw_cpu_id()` and update counters under `rt_sched_lock` to
  avoid migration skew between counting and CPU sampling.
- Track `thread_core_mask` for diagnostics; assert only T0 binding via
  `thread_inc[0] == thread_tic[0]` and `thread_core_mask[0] == 1`.
- Remove flaky unbound-thread assertions (`thread_inc != thread_tic` and
  multi-core core_mask checks).
- Move T0 assertions to the main test thread after all workers finish.
- Use atomic `finsh_flag`; reset counters and `threads[]` in `utest_tc_init`.
- Spin in worker loops after `run_num` until cleanup deletes them (do not
  return from thread_entry or use `RT_WAITING_FOREVER` with `rt_thread_delay`).
- Guard `rt_thread_delete` in cleanup with non-NULL checks.

Signed-off-by: GuEe-GUI &lt;2991707448@qq.com&gt;
</content>
</entry>
<entry>
<title>[docs][utest]:Add comments for smp_bind_affinity</title>
<updated>2025-11-26T14:51:25Z</updated>
<author>
<name>Tm-C-mT</name>
<email>490534897@qq.com</email>
</author>
<published>2025-11-20T03:42:18Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=9c2279acdc526a25cd6abdccee18640c4d4ebc5e'/>
<id>urn:sha1:9c2279acdc526a25cd6abdccee18640c4d4ebc5e</id>
<content type='text'>
Add comments for smp_bind_affinity, And fixed some comment issues in smp_affinity_pri2_tc.

Signed-off-by: Mengchen Teng &lt;teng_mengchen@163.com&gt;
</content>
</entry>
<entry>
<title>utest: core: unify case names</title>
<updated>2025-09-26T01:59:05Z</updated>
<author>
<name>Chen Wang</name>
<email>unicorn_wang@outlook.com</email>
</author>
<published>2025-09-22T07:32:07Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=adc3e2ccc573638fca85973dd00ac5096f4af201'/>
<id>urn:sha1:adc3e2ccc573638fca85973dd00ac5096f4af201</id>
<content type='text'>
Signed-off-by: Chen Wang &lt;unicorn_wang@outlook.com&gt;
</content>
</entry>
<entry>
<title>utest: move core tesetcases under to directiry "src"</title>
<updated>2025-09-26T01:59:05Z</updated>
<author>
<name>Chen Wang</name>
<email>unicorn_wang@outlook.com</email>
</author>
<published>2025-09-22T06:45:35Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=6e51a8405ff220424fe7d435958a787dba621a35'/>
<id>urn:sha1:6e51a8405ff220424fe7d435958a787dba621a35</id>
<content type='text'>
Signed-off-by: Chen Wang &lt;unicorn_wang@outlook.com&gt;
</content>
</entry>
</feed>
