Skip to content

Commit 573c548

Browse files
Tm-C-mTRbb666
authored andcommitted
[docs][utest]:Add explanatory comments for the utest of thread allocation for idle harts
Add explanatory comments for the utest of smp_assigned_idle_cores. Signed-off-by: Mengchen Teng <[email protected]>
1 parent 9308564 commit 573c548

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/utest/smp/smp_assigned_idle_cores_tc.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,33 @@
1717
* @note Create multiple threads untied core threads, run them for a while on each core to see
1818
* if the threads are automatically distributed evenly, run for a while to output the threads
1919
* running on each core.
20+
*
21+
* Test Case Name: [smp_assigned_idle_cores]
22+
*
23+
* Test Objectives:
24+
* - Test whether ready threads unbound to cores can be automatically allocated
25+
* - to idle cores under the SMP architecture.
26+
*
27+
* Test Scenarios:
28+
* - Under the SMP architecture, each core spends most of its time running the
29+
* - idle thread after the system starts. At this point, create RT_CPUS_NR-1 cyclic
30+
* - tasks and observe whether these tasks can be evenly distributed across all
31+
* - cores for execution. Since the thread running the utest occupies one core, it
32+
* - is only necessary to observe whether the remaining (RT_CPUS_NR - 1) cores can
33+
* - be allocated the newly created threads and execute them.
34+
*
35+
* Verification Metrics:
36+
* - After running this test case, it is necessary to observe the printed thread
37+
* - list, where all threads created with names from T0 to T(RT_CPUS_NR-2) must
38+
* - be in the running state. RT_CPUS_NR must be greater than or equal to 2.
39+
*
40+
* Dependencies:
41+
* - RT_USING_SMP needs to be enabled.
42+
*
43+
* Expected Results:
44+
* - Print the thread list on the terminal, and observe that T0 to T(RT_CPUS_NR-2)
45+
* - are all in the running state, with the output "[ PASSED ] [ result ] testcase
46+
* - (core.smp_assigned_idle_cores)".
2047
*/
2148

2249
#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE

0 commit comments

Comments
 (0)