Would numa=off meet your needs? https://www.kernel.org/doc/Documentation/x86/x86_64/boot-options.txt
On Thu, May 30, 2024 at 6:26 AM <chang-li...@mails.tsinghua.edu.cn> wrote: > Hi all, > > I'm doing a benchmark in Linux kernel. I want to make sure all the > benchmarked kernel code is stored in the same NUMA node as the CPU that > runs the code. I implement a system call to trigger the execution of the > benchmarked kernel code, so I can specify the CPU to run the benchmarked > code by binding CPU in userspace. However, I cannot guarantee the kernel > code is stored in the same NUMA node as the CPU that runs the benchmark. My > benchmark server has two NUMA nodes, and runs Ubuntu 22.04 with the default > GRUB boot loader. After rebooting the server several times, I found > sometimes the kernel code is loaded into NUMA node 0, and sometimes it is > loaded into NUMA node 1. > > I wonder is there any way that I can force Linux kernel code to be loaded > in a specific NUMA node during the booting process. I think GRUB is > responsible for loading the Linux kernel into memory, so posting my > question here might help. However, please correct me if I am wrong. I'd be > very grateful if anyone can help :) > > Chang Liu