[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: zhanghailiang
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH v6] numa: make 'info numa' take into account hotplugged memory
Date: Mon, 3 Nov 2014 19:54:00 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.1.1

On 2014/11/2 15:03, Michael Tokarev wrote:
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

Hmm, yes, it not exact, i should remove the confused context.

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[])

Good idea;), it is more clear.

(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).

I will look into this.

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.

Hmm, this a tangled thing.:(

reply via email to

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