于 2011年05月06日 04:30, Bill Gray 写道:
Hi Daniel,
How can we get NUMA-aligned memory and CPUs if we apply binding APIs
after the process has already started? Might not all the memory already
be allocated on the wrong nodes by then?
That's what I guess why libnuma only support to set NUMA policy when
the process start up.
For expert users, what are the problems with starting qemu with an
external numactl command (with --cpunodebind and --membind) to guarantee
optimal alignment?
Alternatives?
- Bill
On 05/05/2011 11:21 AM, Daniel P. Berrange wrote:
> On Thu, May 05, 2011 at 05:38:29PM +0800, Osier Yang wrote:
>> Just prepend numactl command line to qemu command line.
>> ---
>> src/qemu/qemu_command.c | 16 ++++++++++++++++
>> 1 files changed, 16 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
>> index 2205ed1..156fdfb 100644
>> --- a/src/qemu/qemu_command.c
>> +++ b/src/qemu/qemu_command.c
>> @@ -2762,7 +2762,23 @@ qemuBuildCommandLine(virConnectPtr conn,
>> break;
>> }
>>
>> +#ifdef HAVE_NUMACTL
>> + /* XXX: Logic here to build numactl commmand line need to be
>> changed if
>> + * more NUMA tuning related stuffs in future.
>> + */
>> + if (def->numatune.membind.nodeset) {
>> + cmd = virCommandNewArgList(NUMACTL,
>> + "-m",
>> + def->numatune.membind.nodeset,
>> + NULL);
>> +
>> + virCommandAddArgList(cmd, emulator, "-S", NULL);
>> + } else {
>> + cmd = virCommandNewArgList(emulator, "-S", NULL);
>> + }
>> +#else
>> cmd = virCommandNewArgList(emulator, "-S", NULL);
>> +#endif
>
> NACK to this approach. We should be using the libnuma APIs to set the
> memory binding for the process directly, and not running the numactl
> command.
>
> Regards,
> Daniel