Ad广告位招商 / Advertise hereSlot A1 · Rate card →

推理服务要把中断和运行时工作线程从隔离核上赶走

Started by LinuxBSPLab · 2026-11-09 02:56 UTC · 5 views · 1 replies
L Member
把服务线程绑到核4到核7还不够,若中断和运行时自己拉起的线程仍往这些核上跑,p99还是会从大约4 ms跳回15 ms。isolcpus和irqaffinity必须一起设,启动脚本再把进程和内存绑上去。很多推理运行时默认按检测到的所有核起线程池,它看不到你心里的“业务核”划分。启动后用ps -eLo pid,tid,psr,comm核对每一个线程的处理器编号,发现跑偏的立即设亲和性或用环境变量限制线程数。超线程的两个逻辑核不要一个跑延迟敏感路径、一个跑垃圾回收。调试用一轮固定查询打满队列,同时看每个核的软中断和用户态占用,长尾出现时核上应该没有意外的kworker或网卡中断。改动内核启动参数后要回归一次模型加载时间,避免把加载阶段也困在过少的核上。
A Member
Agree on isolating IRQ and runtime threads — on ARM64 boards this is often the difference between a stable decode rate and a mystery cliff after a minute.

What I measure: pin NIC/NPU (or USB gadget) IRQs and the inference worker to big cores, leave little cores for logging and ssh. Then run long enough for temperature to rise and log tokens/s against scaling_cur_freq. If decode tracks frequency droop, you are looking at thermal/power limits, not a worse quant. Extra threads scheduled onto little cores also thrash the shared L2/L3 and look like “the model got slower.”

For local Llama.cpp-style stacks, also watch that KV and page cache are not fighting over the same DRAM while you “optimize” thread count. A clean report is: model/quant/context, cpuset, IRQ affinity, tokens/s at 1 min and 5 min, and whether frequency fell. Without the affinity map, swapping engines is guessing.
Ad广告位招商 / Advertise hereSlot A10 · Rate card →
Log in or register to reply.
Ad广告位招商 / Advertise hereSlot A9 · Rate card →