qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: "Alex Williamson" <alex.williamson@redhat.com>,
	"Cédric Le Goater" <clg@redhat.com>
Cc: ankita@nvidia.com, jgg@nvidia.com, shannon.zhaosl@gmail.com,
	peter.maydell@linaro.org, ani@anisinha.ca, aniketa@nvidia.com,
	cjia@nvidia.com, kwankhede@nvidia.com, targupta@nvidia.com,
	vsethi@nvidia.com, acurrid@nvidia.com, qemu-arm@nongnu.org,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v1 0/4] vfio: report NUMA nodes for device memory
Date: Fri, 15 Sep 2023 20:34:41 +0200	[thread overview]
Message-ID: <f129b30b-bd0c-4e30-6be9-384b2b79a26b@redhat.com> (raw)
In-Reply-To: <20230915084754.4b49d5c0.alex.williamson@redhat.com>

On 15.09.23 16:47, Alex Williamson wrote:
> On Fri, 15 Sep 2023 16:19:29 +0200
> Cédric Le Goater <clg@redhat.com> wrote:
> 
>> Hello Ankit,
>>
>> On 9/15/23 04:45, ankita@nvidia.com wrote:
>>> From: Ankit Agrawal <ankita@nvidia.com>
>>>
>>> For devices which allow CPU to cache coherently access their memory,
>>> it is sensible to expose such memory as NUMA nodes separate from
>>> the sysmem node. Qemu currently do not provide a mechanism for creation
>>> of NUMA nodes associated with a vfio-pci device.
>>>
>>> Implement a mechanism to create and associate a set of unique NUMA nodes
>>> with a vfio-pci device.>
>>> NUMA node is created by inserting a series of the unique proximity
>>> domains (PXM) in the VM SRAT ACPI table. The ACPI tables are read once
>>> at the time of bootup by the kernel to determine the NUMA configuration
>>> and is inflexible post that. Hence this feature is incompatible with
>>> device hotplug. The added node range associated with the device is
>>> communicated through ACPI DSD and can be fetched by the VM kernel or
>>> kernel modules. QEMU's VM SRAT and DSD builder code is modified
>>> accordingly.
>>>
>>> New command line params are introduced for admin to have a control on
>>> the NUMA node assignment.
>>
>> This approach seems to bypass the NUMA framework in place in QEMU and
>> will be a challenge for the upper layers. QEMU is generally used from
>> libvirt when dealing with KVM guests.
>>
>> Typically, a command line for a virt machine with NUMA nodes would look
>> like :
>>
>>     -object memory-backend-ram,id=ram-node0,size=1G \
>>     -numa node,nodeid=0,memdev=ram-node0 \
>>     -object memory-backend-ram,id=ram-node1,size=1G \
>>     -numa node,nodeid=1,cpus=0-3,memdev=ram-node1
>>
>> which defines 2 nodes, one with memory and all CPUs and a second with
>> only memory.
>>
>>     # numactl -H
>>     available: 2 nodes (0-1)
>>     node 0 cpus: 0 1 2 3
>>     node 0 size: 1003 MB
>>     node 0 free: 734 MB
>>     node 1 cpus:
>>     node 1 size: 975 MB
>>     node 1 free: 968 MB
>>     node distances:
>>     node   0   1
>>       0:  10  20
>>       1:  20  10
>>
>>     
>> Could it be a new type of host memory backend ?  Have you considered
>> this approach ?
> 
> Good idea.  Fundamentally the device should not be creating NUMA nodes,
> the VM should be configured with NUMA nodes and the device memory
> associated with those nodes.

+1. That would also make it fly with DIMMs and virtio-mem, where you 
would want NUMA-less nodes ass well (imagine passing CXL memory to a VM 
using virtio-mem).

-- 
Cheers,

David / dhildenb



  reply	other threads:[~2023-09-15 18:35 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-15  2:45 [PATCH v1 0/4] vfio: report NUMA nodes for device memory ankita
2023-09-15  2:45 ` [PATCH v1 1/4] vfio: new command line params for device memory NUMA nodes ankita
2023-09-15 14:25   ` Jonathan Cameron via
2023-09-15 14:48     ` Igor Mammedov
2023-09-22  5:44       ` Ankit Agrawal
2023-09-25 14:08       ` Jonathan Cameron via
2023-09-15  2:45 ` [PATCH v1 2/4] vfio: assign default values to node params ankita
2023-09-15  2:45 ` [PATCH v1 3/4] hw/arm/virt-acpi-build: patch guest SRAT for NUMA nodes ankita
2023-09-15 14:37   ` Jonathan Cameron via
2023-09-22  5:49     ` Ankit Agrawal
2023-09-25 13:54       ` Jonathan Cameron via
2023-09-25 14:03         ` Jason Gunthorpe
2023-09-25 14:53           ` Jonathan Cameron via
2023-09-25 16:00             ` Jason Gunthorpe
2023-09-25 17:00               ` Jonathan Cameron via
2023-09-26 14:54                 ` Ankit Agrawal
2023-09-27  7:06                   ` Ankit Agrawal
2023-09-27 11:01                   ` Jonathan Cameron via
2023-09-15 14:52   ` Igor Mammedov
2023-09-15 15:49     ` David Hildenbrand
2023-09-15  2:45 ` [PATCH v1 4/4] acpi/gpex: patch guest DSDT for dev mem information ankita
2023-09-15 15:13   ` Igor Mammedov
2023-09-27 11:42   ` Jonathan Cameron via
2023-09-15 14:19 ` [PATCH v1 0/4] vfio: report NUMA nodes for device memory Cédric Le Goater
2023-09-15 14:47   ` Alex Williamson
2023-09-15 18:34     ` David Hildenbrand [this message]
2023-09-22  8:11       ` Ankit Agrawal
2023-09-22  8:15         ` David Hildenbrand
2023-09-26 14:52           ` Ankit Agrawal
2023-09-26 16:54             ` David Hildenbrand
2023-09-26 19:14               ` Alex Williamson
2023-09-27  7:14                 ` Ankit Agrawal
2023-09-27 11:33                   ` Jonathan Cameron via
2023-09-27 13:53                     ` Jason Gunthorpe
2023-09-27 14:24                       ` Alex Williamson
2023-09-27 15:03                         ` Vikram Sethi
2023-09-27 15:42                           ` Jason Gunthorpe
2023-09-28 16:15                             ` Jonathan Cameron via
2023-09-27 16:37                           ` Alex Williamson
2023-09-28 16:29                             ` Jonathan Cameron via
2023-09-28 16:04                           ` Jonathan Cameron via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f129b30b-bd0c-4e30-6be9-384b2b79a26b@redhat.com \
    --to=david@redhat.com \
    --cc=acurrid@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=ani@anisinha.ca \
    --cc=aniketa@nvidia.com \
    --cc=ankita@nvidia.com \
    --cc=cjia@nvidia.com \
    --cc=clg@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=kwankhede@nvidia.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shannon.zhaosl@gmail.com \
    --cc=targupta@nvidia.com \
    --cc=vsethi@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).