From: David Vrabel <david.vrabel@citrix.com>
To: Elena Ufimtseva <ufimtseva@gmail.com>
Cc: <xen-devel@lists.xenproject.org>, <konrad.wilk@oracle.com>,
<boris.ostrovsky@oracle.com>, <tglx@linutronix.de>,
<mingo@redhat.com>, <hpa@zytor.com>, <x86@kernel.org>,
<akpm@linux-foundation.org>, <tangchen@cn.fujitsu.com>,
<wency@cn.fujitsu.com>, <ian.campbell@citrix.com>,
<stefano.stabellini@eu.citrix.com>, <mukesh.rathor@oracle.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] xen: vnuma support for PV guests running as domU.
Date: Thu, 14 Nov 2013 11:18:25 +0000 [thread overview]
Message-ID: <5284B181.4010704@citrix.com> (raw)
In-Reply-To: <1384400179-24404-2-git-send-email-ufimtseva@gmail.com>
On 14/11/13 03:36, Elena Ufimtseva wrote:
> Issues Xen hypercall subop XENMEM_get_vnumainfo and sets the
> NUMA topology, otherwise sets dummy NUMA node and prevents
> numa_init from calling other numa initializators as they may
> break other guests.
"break other guests" doesn't seem correct to me. "...which prevents
numa_init() from calling other hardware-specific initializers (which do
not work in PV guests)." reads better I think.
> --- /dev/null
> +++ b/arch/x86/include/asm/xen/vnuma.h
> @@ -0,0 +1,12 @@
> +#ifndef _ASM_X86_VNUMA_H
> +#define _ASM_X86_VNUMA_H
> +
> +#ifdef CONFIG_XEN
> +int xen_vnuma_supported(void);
> +int xen_numa_init(void);
> +#else
> +int xen_vnuma_supported(void) { return 0; };
Return bool.
> +int xen_numa_init(void) { return -1; };
I don't think you need this stub.
> +#endif
> +
> +#endif /* _ASM_X86_VNUMA_H */
> diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
> index 8bf93ba..c8a61dc 100644
> --- a/arch/x86/mm/numa.c
> +++ b/arch/x86/mm/numa.c
> @@ -19,6 +19,7 @@
> #include <asm/amd_nb.h>
#include <asm/xen/vnuma.h> here..
> #include "numa_internal.h"
> +#include "asm/xen/vnuma.h"
...not here.
> int __initdata numa_off;
> nodemask_t numa_nodes_parsed __initdata;
> @@ -621,6 +622,10 @@ static int __init dummy_numa_init(void)
> void __init x86_numa_init(void)
> {
> if (!numa_off) {
> +#ifdef CONFIG_XEN
> + if (xen_vnuma_supported() && !numa_init(xen_numa_init))
> + return;
> +#endif
I would put the xen_vnuma_supported() call into xen_numa_init().
> #ifdef CONFIG_X86_NUMAQ
> if (!numa_init(numaq_numa_init))
> return;
> diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
> index 96ab2c0..de9deab 100644
> --- a/arch/x86/xen/Makefile
> +++ b/arch/x86/xen/Makefile
> @@ -13,7 +13,7 @@ CFLAGS_mmu.o := $(nostackp)
> obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \
> time.o xen-asm.o xen-asm_$(BITS).o \
> grant-table.o suspend.o platform-pci-unplug.o \
> - p2m.o
> + p2m.o vnuma.o
obj-$(CONFIG_NUMA) += vnuma.o
Then you can remove the #ifdef CONFIG_NUMA from xen/vnuma.c
> --- a/include/xen/interface/memory.h
> +++ b/include/xen/interface/memory.h
> @@ -263,4 +263,32 @@ struct xen_remove_from_physmap {
> };
> DEFINE_GUEST_HANDLE_STRUCT(xen_remove_from_physmap);
>
> +/* vNUMA structures */
> +struct vmemrange {
> + uint64_t start, end;
> + struct vmemrange *next;
A pointer in a ABI structure looks wrong.
> +};
> +DEFINE_GUEST_HANDLE_STRUCT(vmemrange);
> +
> +struct vnuma_topology_info {
> + /* OUT */
> + domid_t domid;
> + uint32_t __pad;
> + /* IN */
> + GUEST_HANDLE(uint) nr_nodes; /* number of virtual numa nodes */
> + /* distance table */
> + GUEST_HANDLE(uint) vdistance;
> + /* cpu mapping to vnodes */
> + GUEST_HANDLE(uint) cpu_to_node;
> + /*
> + * array of numa memory areas constructed by Xen
> + * where start and end are pfn numbers of the area
> + * Xen takes into account domains e820 map
> + */
> + GUEST_HANDLE(vmemrange) vmemblks;
> +};
The structure has different size on 32-bit and 64-bit x86 guests. Is
this intentional? The __pad field suggests not.
David
next prev parent reply other threads:[~2013-11-14 11:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 3:36 [PATCH 0/2] xen: vnuma introduction for pv guest Elena Ufimtseva
2013-11-14 3:36 ` [PATCH 1/2] xen: vnuma support for PV guests running as domU Elena Ufimtseva
2013-11-14 7:26 ` [Xen-devel] " Dario Faggioli
2013-11-14 11:21 ` David Vrabel
2013-11-14 11:48 ` Dario Faggioli
2013-11-14 14:11 ` Elena Ufimtseva
2013-11-14 14:11 ` Elena Ufimtseva
2013-11-14 11:48 ` Dario Faggioli
2013-11-14 11:21 ` David Vrabel
2013-11-14 7:26 ` Dario Faggioli
2013-11-14 11:18 ` David Vrabel
2013-11-14 11:18 ` David Vrabel [this message]
2013-11-14 14:11 ` Stefano Stabellini
2013-11-14 14:11 ` [Xen-devel] " Stefano Stabellini
2013-11-14 3:36 ` Elena Ufimtseva
2013-11-14 3:36 ` [PATCH 2/2] xen: enable vnuma for PV guest Elena Ufimtseva
2013-11-14 3:36 ` Elena Ufimtseva
2013-11-14 6:53 ` [Xen-devel] [PATCH 0/2] xen: vnuma introduction for pv guest Dario Faggioli
2013-11-14 6:53 ` Dario Faggioli
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=5284B181.4010704@citrix.com \
--to=david.vrabel@citrix.com \
--cc=akpm@linux-foundation.org \
--cc=boris.ostrovsky@oracle.com \
--cc=hpa@zytor.com \
--cc=ian.campbell@citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mukesh.rathor@oracle.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tangchen@cn.fujitsu.com \
--cc=tglx@linutronix.de \
--cc=ufimtseva@gmail.com \
--cc=wency@cn.fujitsu.com \
--cc=x86@kernel.org \
--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.