From: Marek Marczykowski <marmarek@invisiblethingslab.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] tools/misc/xenpm: fix getting info when some CPUs are offline
Date: Wed, 31 Oct 2018 11:53:16 +0100 [thread overview]
Message-ID: <20181031105316.GC32486@mail-itl> (raw)
In-Reply-To: <5BD9770602000078001F6A4F@prv1-mh.provo.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 1488 bytes --]
On Wed, Oct 31, 2018 at 03:33:58AM -0600, Jan Beulich wrote:
> >>> On 30.10.18 at 23:16, <marmarek@invisiblethingslab.com> 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++ )
Oh, you're right. This doesn't affect smt=off case, because the last cpu
is offline anyway...
> 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 )
> break;
>
> which I suspect would terminate processing early when hitting a true
> gap (i.e. not one resulting from a parked CPU).
How that would happen? Hotplug?
Also I've tried to look at error codes to distinguish offline cpu and
avoid printing that error, but looks EINVAL is used for a lot of cases.
> But I guess it wouldn't
> be appropriate to ask you to deal with this at the same time.
>
> Jan
>
>
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 157 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-10-31 10:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 22:16 [PATCH] tools/misc/xenpm: fix getting info when some CPUs are offline Marek Marczykowski-Górecki
2018-10-30 22:29 ` Andrew Cooper
2018-10-31 9:33 ` Jan Beulich
2018-10-31 10:53 ` Marek Marczykowski [this message]
2018-10-31 11:11 ` Jan Beulich
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=20181031105316.GC32486@mail-itl \
--to=marmarek@invisiblethingslab.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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 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.