Changeset 1b20da0 in mainline for kernel/test/smpcall
- Timestamp:
- 2018-02-28T17:52:03Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3061bc1
- Parents:
- df6ded8
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:26:03)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:52:03)
- File:
-
- 1 edited
-
kernel/test/smpcall/smpcall1.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/smpcall/smpcall1.c
rdf6ded8 r1b20da0 39 39 #include <proc/thread.h> 40 40 41 /* 42 * Maximum total number of smp_calls in the system is: 43 * 162000 == 9^2 * 1000 * 2 41 /* 42 * Maximum total number of smp_calls in the system is: 43 * 162000 == 9^2 * 1000 * 2 44 44 * == MAX_CPUS^2 * ITERATIONS * EACH_CPU_INC_PER_ITER 45 45 */ … … 54 54 55 55 size_t *pcall_cnt = (size_t*)p; 56 /* 57 * No synchronization. Tests if smp_calls makes changes 58 * visible to the caller. 56 /* 57 * No synchronization. Tests if smp_calls makes changes 58 * visible to the caller. 59 59 */ 60 60 ++*pcall_cnt; … … 72 72 /* Synchronous version. */ 73 73 for (unsigned cpu_id = 0; cpu_id < cpu_count; ++cpu_id) { 74 /* 75 * smp_call should make changes by inc() visible on this cpu. 76 * As a result we can pass it our pcall_cnt and not worry 74 /* 75 * smp_call should make changes by inc() visible on this cpu. 76 * As a result we can pass it our pcall_cnt and not worry 77 77 * about other synchronization. 78 78 */ … … 80 80 } 81 81 82 /* 83 * Async calls run in parallel on different cpus, so passing the 82 /* 83 * Async calls run in parallel on different cpus, so passing the 84 84 * same counter would clobber it without additional synchronization. 85 85 */ … … 120 120 /* Create a wired thread on each cpu. */ 121 121 for (unsigned int id = 0; id < cpu_count; ++id) { 122 thread[id] = thread_create(test_thread, &call_cnt[id], TASK, 122 thread[id] = thread_create(test_thread, &call_cnt[id], TASK, 123 123 THREAD_FLAG_NONE, "smp-call-test"); 124 124 … … 134 134 size_t exp_calls_sum = exp_calls * cpu_count; 135 135 136 TPRINTF("Running %zu wired threads. Expecting %zu calls. Be patient.\n", 136 TPRINTF("Running %zu wired threads. Expecting %zu calls. Be patient.\n", 137 137 running_thread_cnt, exp_calls_sum); 138 138 … … 162 162 TPRINTF("Error: %zu instead of %zu cpu%zu's calls were" 163 163 " acknowledged.\n", call_cnt[i], exp_calls, i); 164 } 164 } 165 165 } 166 166
Note:
See TracChangeset
for help on using the changeset viewer.
