| 142 | std::atomic<uint64_t> g_affinity_cores_mask{0}; |
| 143 | |
| 144 | void affinity_pinned_worker(void* /*arg*/) { |
| 145 | for (int round = 0; round < 100; ++round) { |
| 146 | for (int j = 0; j < 10; ++j) { |
| 147 | auto core_id = cpu_io::GetCurrentCoreId(); |
| 148 | g_affinity_cores_mask.fetch_or(1UL << core_id, std::memory_order_relaxed); |
| 149 | (void)sys_yield(); |
| 150 | } |
| 151 | (void)sys_sleep(1); |
| 152 | } |
| 153 | |
| 154 | g_affinity_done.fetch_add(1, std::memory_order_release); |
| 155 | sys_exit(0); |
| 156 | } |
| 157 | |
| 158 | void test_balance_respects_affinity(void* /*arg*/) { |
| 159 | klog::Info("=== Balance: Respects Affinity Test ==="); |
nothing calls this directly
no test coverage detected