summaryrefslogtreecommitdiff
path: root/src/utest
diff options
context:
space:
mode:
authorTm-C-mT <[email protected]>2025-11-19 16:02:53 +0800
committerR b b666 <[email protected]>2025-11-19 16:15:47 +0800
commit573c5489fa61f2466ed41e66d47792d803703443 (patch)
treec56fb374ae66e8fd42a7209ea9db7c31a14e8b5e /src/utest
parent9308564a920c99f31edd747d118c406192537578 (diff)
[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]>
Diffstat (limited to 'src/utest')
-rw-r--r--src/utest/smp/smp_assigned_idle_cores_tc.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/utest/smp/smp_assigned_idle_cores_tc.c b/src/utest/smp/smp_assigned_idle_cores_tc.c
index 26a8efed5c..74e31760f3 100644
--- a/src/utest/smp/smp_assigned_idle_cores_tc.c
+++ b/src/utest/smp/smp_assigned_idle_cores_tc.c
@@ -17,6 +17,33 @@
* @note Create multiple threads untied core threads, run them for a while on each core to see
* if the threads are automatically distributed evenly, run for a while to output the threads
* running on each core.
+ *
+ * Test Case Name: [smp_assigned_idle_cores]
+ *
+ * Test Objectives:
+ * - Test whether ready threads unbound to cores can be automatically allocated
+ * - to idle cores under the SMP architecture.
+ *
+ * Test Scenarios:
+ * - Under the SMP architecture, each core spends most of its time running the
+ * - idle thread after the system starts. At this point, create RT_CPUS_NR-1 cyclic
+ * - tasks and observe whether these tasks can be evenly distributed across all
+ * - cores for execution. Since the thread running the utest occupies one core, it
+ * - is only necessary to observe whether the remaining (RT_CPUS_NR - 1) cores can
+ * - be allocated the newly created threads and execute them.
+ *
+ * Verification Metrics:
+ * - After running this test case, it is necessary to observe the printed thread
+ * - list, where all threads created with names from T0 to T(RT_CPUS_NR-2) must
+ * - be in the running state. RT_CPUS_NR must be greater than or equal to 2.
+ *
+ * Dependencies:
+ * - RT_USING_SMP needs to be enabled.
+ *
+ * Expected Results:
+ * - Print the thread list on the terminal, and observe that T0 to T(RT_CPUS_NR-2)
+ * - are all in the running state, with the output "[ PASSED ] [ result ] testcase
+ * - (core.smp_assigned_idle_cores)".
*/
#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE