[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH v6] numa: make 'info numa' take i

From: Michael Tokarev
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH v6] numa: make 'info numa' take into account hotplugged memory
Date: Sun, 02 Nov 2014 10:03:17 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0

30.10.2014 11:22, zhanghailiang wrote:
> Hi Michael,
> Can you help applying this patch to -trivial branch?
> It has been reviewed, and it mainly fix bug for hmp command of 'info numa'.
> Which i don't know if it should go qemu-stable, for this is not a blocker.
> Maybe go trivial branch is a better choice.

And the original patch description is:

>>>>>> When do memory hotplug, if there is numa node, we should add
>>>>>> the memory size to the corresponding node memory size.
>>>>>> For now, it mainly affects the result of hmp command "info numa".

What does the "for now" means in this context?  Is the patch
incpmplete somehow and we should expect more code in this

In the patch we have:

+void query_numa_node_mem(uint64_t *node_mem)
+    int i;
+    if (nb_numa_nodes <= 0) {
+        return;
+    }
+    numa_stat_memory_devices(node_mem);
+    for (i = 0; i < nb_numa_nodes; i++) {
+        node_mem[i] += numa_info[i].node_mem;
+    }

Please note that while the node_mem is a pointer, it is used as
an array.  In C, pointers and arrays in this context is the same
thing, but I think it is better to make the fact that it is an
array explicit in the function prototype, to be like this:

+void query_numa_node_mem(uint64_t node_mem[])

(But I don't know how various tools like coverity et al will react
to this.  Gcc and any other C compiler should be fine).

The same stands for other function prototype.

I'm not sure this qualifies as -trivial really.  Yes the change
does not affect anything but the `info' command, and is rather
simple, but... I'm not sure.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]