From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
sstabellini@kernel.org, wei.liu2@citrix.com,
George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com,
ian.jackson@eu.citrix.com, tim@xen.org, jbeulich@suse.com
Subject: [PATCH 2/2] xen: fill topology info for online cpus only
Date: Wed, 29 Aug 2018 20:23:02 +0200 [thread overview]
Message-ID: <20180829182302.9977-3-jgross@suse.com> (raw)
In-Reply-To: <20180829182302.9977-1-jgross@suse.com>
The topology information obtainable via XEN_SYSCTL_cputopoinfo is
filled rather weird: the size of the array is derived from the highest
online cpu number, while the data is set to "invalid" for not present
cpus only.
With smt=0 the information for parked threads is all zero, so it should
be best to return "invalid" information for offline cpus.
On a dual core system without this patch xl info -n will print:
cpu_topology :
cpu: core socket node
0: 0 0 0
1: 0 0 0
2: 1 0 0
while with this patch the output is:
cpu_topology :
cpu: core socket node
0: 0 0 0
2: 1 0 0
Signed-off-by: Juergen Gross <jgross@suse.com>
---
xen/common/sysctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 8e83c33a16..6cef6d310b 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -358,7 +358,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
num_cpus = ti->num_cpus;
for ( i = 0; i < num_cpus; ++i )
{
- if ( cpu_present(i) )
+ if ( cpu_online(i) )
{
cputopo.core = cpu_to_core(i);
cputopo.socket = cpu_to_socket(i);
--
2.16.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-08-29 18:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-29 18:23 [PATCH 0/2] fix smt=0 fallout Juergen Gross
2018-08-29 18:23 ` [PATCH 1/2] tools/libxl: correct vcpu affinity output with sparse physical cpu map Juergen Gross
2018-08-30 7:47 ` Wei Liu
2018-08-30 8:07 ` Jan Beulich
[not found] ` <5B87A5B402000078001E361E@suse.com>
2018-08-30 8:11 ` Juergen Gross
2018-08-30 8:42 ` Jan Beulich
2018-08-29 18:23 ` Juergen Gross [this message]
2018-08-30 7:48 ` [PATCH 2/2] xen: fill topology info for online cpus only Wei Liu
2018-08-30 7:51 ` Wei Liu
2018-08-30 8:16 ` Jan Beulich
[not found] ` <5B87A7E502000078001E364A@suse.com>
2018-08-30 8:31 ` Juergen Gross
2018-08-30 8:37 ` Wei Liu
2018-08-30 8:44 ` Jan Beulich
[not found] ` <5B87AE7402000078001E36DE@suse.com>
2018-08-30 8:46 ` Juergen Gross
2018-08-30 8:43 ` Jan Beulich
[not found] <20180829182302.9977=ef=bf=bd1=ef=bf=bdjgross@suse.com?= =?UTF-8?Q?>
[not found] ` <20180829182302.9977=ef=bf=bd3=ef=bf=bdjgross@suse.com>
[not found] ` <5B87A7?= =?UTF-8?Q?E502000078001E364A@suse.com>
[not found] ` <0d12f446-a6ba-add0-bded-6b90ee64fb5?= =?UTF-8?Q?a@suse.com>
[not found] ` <5B87AE1E02000078001E36DB@suse.com>
2018-08-30 8:46 ` Juergen Gross
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=20180829182302.9977-3-jgross@suse.com \
--to=jgross@suse.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).