设置linux内核的cpu亲和力,而不是进程

发布于 2024-12-05 15:46:48 字数 1459 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

永言不败 2024-12-12 15:46:48

代表进程的内核工作始终发生在发出请求的 CPU 上。不过,您可以控制中断。查看 /proc/interrupts 以识别要移动的中断(例如与 eth0 匹配的所有内容),并通过将十六进制掩码回显到 /proc/ 来设置关联性irq/XXX/smp_affinity

Kernel work on behalf of processes will always happen on the CPU that makes the request. You can steer interrupts, though. Look at /proc/interrupts to identify the interrupts you want to move (say everything matching eth0) and set the affinity by echoing a hexadecimal mask to /proc/irq/XXX/smp_affinity.

手心的海 2024-12-12 15:46:48

您应该能够通过内核命令行选项禁用其他内核。

不在某个核心上运行内核意味着该核心上也无法运行其他任何东西。没有内核调度程序,也没有 TLB 设置 ->没有代码执行。

You should be able to disable the other cores via a kernel command-line option.

Not having the kernel run on a core implies that nothing else can run on that core either. No kernel scheduler and no TLB setup -> no code executing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文