Re: How can I optimize a process on a NUMA architecture(x86-64 specifically)?

From: Jesse Barnes
Date: Thu May 20 2004 - 20:31:08 EST


On Thursday, May 20, 2004 8:51 pm, Brett E. wrote:
> Say you have a bunch of single-threaded processes on a NUMA machine.
> Does the kernel make sure to prefer allocations using a certain CPU's
> memory, preferring to run a given process on the CPU which contains its
> memory?

Well, it'll allocate memory from the node containing the CPU that the process
is running on, so if you've pinned your process (e.g. with schedutils) you'll
be ok unless you're short on memory. If it's not pinned, you'll run the risk
of having your process refer to memory on a remote node. Depending on what
type of system you're running on, this could be a very small performance
issue or a large one.

> Or should I use the NUMA API(libnuma) to spell this out to the
> kernel? Does the kernel do the right thing in this case?

The kernel, by default, will allocate memory on the node where the process is
running, and fall back to other nodes based on distance. That said, it's not
a bad idea to pin your process to a CPU and use libnuma to explicitly set
it's memory affinity.

Jesse
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/