xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Lan Tianyu <tianyu.lan@intel.com>
To: xen-devel@lists.xen.org
Cc: Lan Tianyu <tianyu.lan@intel.com>,
	kevin.tian@intel.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, julien.grall@arm.com, jbeulich@suse.com,
	roger.pau@citrix.com, chao.gao@intel.com
Subject: [RFC PATCH V3 1/3] Xen: Increase hap/shadow page pool size to support more vcpus support
Date: Wed, 13 Sep 2017 00:52:47 -0400	[thread overview]
Message-ID: <1505278369-21605-2-git-send-email-tianyu.lan@intel.com> (raw)
In-Reply-To: <1505278369-21605-1-git-send-email-tianyu.lan@intel.com>

This patch is to increase page pool size when max vcpu number is larger
than 128.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
---
 xen/arch/arm/domain.c    |  5 +++++
 xen/arch/x86/domain.c    | 25 +++++++++++++++++++++++++
 xen/common/domctl.c      |  3 +++
 xen/include/xen/domain.h |  2 ++
 4 files changed, 35 insertions(+)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 6512f01..94cf70b 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -824,6 +824,11 @@ int arch_vcpu_reset(struct vcpu *v)
     return 0;
 }
 
+int arch_domain_set_max_vcpus(struct domain *d)
+{
+    return 0;
+}
+
 static int relinquish_memory(struct domain *d, struct page_list_head *list)
 {
     struct page_info *page, *tmp;
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index dbddc53..0e230f9 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1161,6 +1161,31 @@ int arch_vcpu_reset(struct vcpu *v)
     return 0;
 }
 
+int arch_domain_set_max_vcpus(struct domain *d)
+{
+    int ret;
+
+    /* Increase page pool in order to support more vcpus. */
+    if ( d->max_vcpus > 128 )
+    {
+        unsigned long nr_pages;
+
+        if (hap_enabled(d))
+            nr_pages = 1024;
+        else
+            nr_pages = 4096;
+
+        ret = paging_set_allocation(d, nr_pages, NULL);
+        if ( ret != 0 )
+        {
+            paging_set_allocation(d, 0, NULL);
+            return ret;
+        }
+    }
+
+    return 0;
+}
+
 long
 arch_do_vcpu_op(
     int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 42658e5..64357a3 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -631,6 +631,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             d->max_vcpus = max;
         }
 
+        if ( arch_domain_set_max_vcpus(d) < 0)
+            goto maxvcpu_out;
+
         for ( i = 0; i < max; i++ )
         {
             if ( d->vcpu[i] != NULL )
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 347f264..e1ece3a 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -81,6 +81,8 @@ void arch_dump_domain_info(struct domain *d);
 
 int arch_vcpu_reset(struct vcpu *);
 
+int arch_domain_set_max_vcpus(struct domain *d);
+
 extern spinlock_t vcpu_alloc_lock;
 bool_t domctl_lock_acquire(void);
 void domctl_lock_release(void);
-- 
1.8.3.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-09-13  4:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-13  4:52 [RFC PATCH V3 0/3] Extend resources to support more vcpus in single VM Lan Tianyu
2017-09-13  4:52 ` Lan Tianyu [this message]
2017-09-18 13:06   ` [RFC PATCH V3 1/3] Xen: Increase hap/shadow page pool size to support more vcpus support Wei Liu
2017-09-19  3:06     ` Lan Tianyu
2017-09-20 15:13       ` Wei Liu
2017-09-21  8:50         ` Lan Tianyu
2017-09-21 11:27           ` Jan Beulich
2017-11-28  8:13         ` Chao Gao
2017-09-13  4:52 ` [RFC PATCH V3 2/3] Tool/ACPI: DSDT extension to support more vcpus Lan Tianyu
2017-09-19 13:29   ` Roger Pau Monné
2017-09-19 13:44     ` Jan Beulich
2017-09-19 13:48       ` Roger Pau Monné
2017-09-19 13:55         ` Jan Beulich
2017-09-19 14:13           ` Roger Pau Monné
2017-09-19 15:02             ` Jan Beulich
2017-09-19 15:35               ` Roger Pau Monné
2017-09-13  4:52 ` [RFC PATCH V3 3/3] hvmload: Add x2apic entry support in the MADT build Lan Tianyu
2017-09-19 13:41   ` Roger Pau Monné
2017-09-19 13:50     ` Roger Pau Monné

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=1505278369-21605-2-git-send-email-tianyu.lan@intel.com \
    --to=tianyu.lan@intel.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=chao.gao@intel.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=kevin.tian@intel.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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).