* [Qemu-devel] [PATCH v1 4/7] numa: Classify the numa nodes as memory initiators and memory targets
@ 2018-05-09 8:36 Liu Jingqi
2018-05-11 14:33 ` Eduardo Habkost
0 siblings, 1 reply; 3+ messages in thread
From: Liu Jingqi @ 2018-05-09 8:36 UTC (permalink / raw)
To: pbonzini, rth, ehabkost
Cc: mst, imammedo, marcel.apfelbaum, qemu-devel, Liu Jingqi
An initiator proximity domain (memory initiator) is any device
such as a CPU or a separate memory I/O device that can initiate
a memory request. A target proximity domain (memory target)
is a CPU-accessible physical address range.
Signed-off-by: Liu Jingqi <jingqi.liu@intel.com>
---
numa.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/numa.c b/numa.c
index 70b150e..fe0009c 100644
--- a/numa.c
+++ b/numa.c
@@ -40,6 +40,7 @@
#include "qemu/option.h"
#include "qemu/config-file.h"
#include "qemu/cutils.h"
+#include "hw/acpi/hmat.h"
QemuOptsList qemu_numa_opts = {
.name = "numa",
@@ -100,6 +101,10 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
machine_set_cpu_numa_node(ms, &props, &error_fatal);
}
+ if (node->cpus) {
+ initiator_pxm[num_initiator++] = nodenr;
+ }
+
if (node->has_mem && node->has_memdev) {
error_setg(errp, "cannot specify both mem= and memdev=");
return;
@@ -116,6 +121,7 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
if (node->has_mem) {
numa_info[nodenr].node_mem = node->mem;
+ target_pxm[num_target++] = nodenr;
}
if (node->has_memdev) {
Object *o;
@@ -128,6 +134,7 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
object_ref(o);
numa_info[nodenr].node_mem = object_property_get_uint(o, "size", NULL);
numa_info[nodenr].node_memdev = MEMORY_BACKEND(o);
+ target_pxm[num_target++] = nodenr;
}
numa_info[nodenr].present = true;
max_numa_nodeid = MAX(max_numa_nodeid, nodenr + 1);
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v1 4/7] numa: Classify the numa nodes as memory initiators and memory targets
2018-05-09 8:36 [Qemu-devel] [PATCH v1 4/7] numa: Classify the numa nodes as memory initiators and memory targets Liu Jingqi
@ 2018-05-11 14:33 ` Eduardo Habkost
2018-05-14 5:22 ` Liu, Jingqi
0 siblings, 1 reply; 3+ messages in thread
From: Eduardo Habkost @ 2018-05-11 14:33 UTC (permalink / raw)
To: Liu Jingqi; +Cc: pbonzini, rth, mst, imammedo, marcel.apfelbaum, qemu-devel
On Wed, May 09, 2018 at 04:36:29PM +0800, Liu Jingqi wrote:
> An initiator proximity domain (memory initiator) is any device
> such as a CPU or a separate memory I/O device that can initiate
> a memory request. A target proximity domain (memory target)
> is a CPU-accessible physical address range.
>
[...]
> + if (node->cpus) {
> + initiator_pxm[num_initiator++] = nodenr;
> + }
[...]
> + target_pxm[num_target++] = nodenr;
I suggest NumaNode::is_initiator and NumaNode::is_target boolean
fields instead of a separate global table.
Or numa.c could simply provide
bool numa_node_is_initiator(int node) and
bool numa_node_is_target(int node)
helpers.
--
Eduardo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v1 4/7] numa: Classify the numa nodes as memory initiators and memory targets
2018-05-11 14:33 ` Eduardo Habkost
@ 2018-05-14 5:22 ` Liu, Jingqi
0 siblings, 0 replies; 3+ messages in thread
From: Liu, Jingqi @ 2018-05-14 5:22 UTC (permalink / raw)
To: Eduardo Habkost
Cc: pbonzini, rth, mst, imammedo, marcel.apfelbaum, qemu-devel
> -----Original Message-----
> From: Eduardo Habkost [mailto:ehabkost@redhat.com]
> Sent: Friday, May 11, 2018 10:33 PM
> To: Liu, Jingqi <jingqi.liu@intel.com>
> Cc: pbonzini@redhat.com; rth@twiddle.net; mst@redhat.com;
> imammedo@redhat.com; marcel.apfelbaum@gmail.com; qemu-
> devel@nongnu.org
> Subject: Re: [PATCH v1 4/7] numa: Classify the numa nodes as memory initiators
> and memory targets
>
> On Wed, May 09, 2018 at 04:36:29PM +0800, Liu Jingqi wrote:
> > An initiator proximity domain (memory initiator) is any device such as
> > a CPU or a separate memory I/O device that can initiate a memory
> > request. A target proximity domain (memory target) is a CPU-accessible
> > physical address range.
> >
> [...]
> > + if (node->cpus) {
> > + initiator_pxm[num_initiator++] = nodenr;
> > + }
> [...]
> > + target_pxm[num_target++] = nodenr;
>
> I suggest NumaNode::is_initiator and NumaNode::is_target boolean fields
> instead of a separate global table.
>
> Or numa.c could simply provide
> bool numa_node_is_initiator(int node) and
> bool numa_node_is_target(int node)
> helpers.
>
> --
> Eduardo
Hi Eduardo,
Thanks for your reviewing. It's a good suggestion. I will improve in the next version.
Jingqi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-05-14 5:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-09 8:36 [Qemu-devel] [PATCH v1 4/7] numa: Classify the numa nodes as memory initiators and memory targets Liu Jingqi
2018-05-11 14:33 ` Eduardo Habkost
2018-05-14 5:22 ` Liu, Jingqi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.