4 Commits

Author SHA1 Message Date
Max 156016c4ef [fix](kt-kernel): size per-NUMA thread counters by physical NUMA id (#2228)
* fix(kt-kernel): size per-NUMA thread counters by physical NUMA id

WorkerPool::init() and NumaJobDistributor::init() indexed the per-NUMA
worker counter by the *physical* NUMA ID while sizing it by the number
of subpools. A subpool mapped to a NUMA node whose ID is >= the subpool
count (e.g. --kt-threadpool-count 1 --kt-numa-nodes 1) therefore read
and wrote out of bounds, shifting the per-node core offset and logging
"Core ... not found" (or corrupting the heap and aborting).

Size the counter vector to cover every NUMA ID present in the subpool
map. Add a CPU regression test that builds two subpools on a
high-numbered NUMA node and verifies the worker thread offsets.

* test(kt-kernel): add single-subpool regression case for #2221

The existing fixture always builds two subpools, so on a dual-socket host
(NUMA IDs [0, 1]) the two-element counter stays in bounds and the old code
passes there. Add a single subpool mapped to a nonzero NUMA node: the size-1
counter is then indexed at an ID >= 1, reproducing #2221 on any multi-NUMA
host. Verified that this case fails/aborts on the unpatched code and passes
with the fix.

Suggested by @f-wunderlich in review.
2026-10-12 12:56:12 +08:00
Doctor Shotgun bdf4bb76c5 Fix worker pool idle CPU usage (#1902)
* Replace sleep polling with condition variable blocking
2026-03-30 20:29:17 +08:00
Oql bf4c8a690b Add Native Precision Tutorial, update worker strategy and README.md (#1807) 2026-01-23 18:00:13 +08:00
Atream 4c5fcf9774 add kt-kernel 2025-10-12 05:13:00 +00:00