Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在运行 Linux 的多核系统上运行许多基准测试。我想为我的基准测试保留一个核心。我知道我可以sched_setaffinity用来将我的基准测试限制在该核心。我怎样才能让所有其他流程远离我的核心?换句话说,如何将所有进程的默认亲和性设置为不包括我的核心?
sched_setaffinity
即使您将所有其他进程从“保留用于基准测试”内核中移除,请记住,您无法阻止它们将有限内存带宽的可变且不可预测的比例消耗到多核芯片上,并且您可以不要阻止他们对共享的 L2 和 L3 缓存提出不同的要求。
恕我直言,可重复的、科学的基准测试需要一台机器本身。