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

Re: [Xen-devel] [PATCH] tools/misc/xenpm: fix getting info when some CPUs are offline

>>> On 30.10.18 at 23:16, <marmarek@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> --- a/tools/misc/xenpm.c
> +++ b/tools/misc/xenpm.c
> @@ -1231,7 +1231,7 @@ int main(int argc, char *argv[])
>          xc_interface_close(xc_handle);
>          return ret;
>      }
> -    max_cpu_nr = physinfo.nr_cpus;
> +    max_cpu_nr = physinfo.max_cpu_id;

Isn't this off by 1 then? max_cpu_nr is misnamed, all loops using it
are of the form

    for ( i = 0; i < max_cpu_nr; i++ )

I'm also afraid there are further quirks here, with various constructs
along the lines of (as bodies of aforementioned for())

        if ( show_cxstat_by_cpuid(xc_handle, i) == -ENODEV )

which I suspect would terminate processing early when hitting a true
gap (i.e. not one resulting from a parked CPU). But I guess it wouldn't
be appropriate to ask you to deal with this at the same time.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.