Skip to content

Commit ea37d4c

Browse files
Tm-C-mTRbb666
authored andcommitted
[docs][utest]:Add comments for smp_affinity_pri1
Add comments for smp_affinity_pri1 Signed-off-by: Mengchen Teng <teng_mengchen@163.com>
1 parent 5706c5e commit ea37d4c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/utest/smp/smp_affinity_pri1_tc.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,30 @@
1818
* for the system's highest and the thread entry function does not let out the CPU control, run the specified
1919
* number of times in thread 0 to create a high-priority not bound to the core of the thread, the thread will
2020
* be preempted by the core 0 is running on the thread!
21+
*
22+
* Test Case Name: [smp_affinity_pri1]
23+
*
24+
* Test Objectives:
25+
* - Verify that threads with low-priority bound cores do not preempt high-priority threads.
26+
*
27+
* Test Scenarios:
28+
* - RT_CPUS_NR threads (T0~T(RT_CPUS_NR-1)) are created, with each thread bound to its respective core. Among them, the
29+
* - thread on core 0 has the lowest priority (LOW_PRIORITY), while the other threads have the highest priority (THREAD_PRIORITY).
30+
* - All threads share a common entry function "thread_entry". In thread_entry, only the threads running on non-core-0 cores
31+
* - execute an infinite loop (i.e., they do not release core ownership). After running for a certain period of time, the
32+
* - thread on core 0 executes list_thread() and creates a medium-priority (THIGH_PRIORITY) thread Tn, whose entry function
33+
* - is thread_temp_entry. Tn is automatically destroyed after executing list_thread().
34+
*
35+
* Verification Metrics:
36+
* - Output message: [I/utest] [ PASSED ] [ result ] testcase (core.smp_affinity_pri1)
37+
*
38+
* Dependencies:
39+
* - Enable RT_USING_SMP, set RT_THREAD_PRIORITY_MAX = 256.
40+
*
41+
* Expected Results:
42+
* - You will see the information printed by list_thread() twice on the terminal. For the first time, you will see that T0 is
43+
* - running on core 0, and T1~T(RT_CPUS_NR-1) are running on their respective cores. For the second time, you will see that Tn
44+
* - is running on core 0, while T0 is in the ready state. Subsequently, the PASS message will be printed.
2145
*/
2246

2347
/* Number of thread runs */

0 commit comments

Comments
 (0)