Re: [Xen-devel] [PATCH v6 04/23] libxc: duplicate snippet to allocate p2m_host array

2015-03-02 Thread Wei Liu
On Mon, Mar 02, 2015 at 03:26:58PM +, Ian Campbell wrote:
 On Thu, 2015-02-26 at 15:55 +, Wei Liu wrote:
  Currently all in tree code doesn't set the superpage flag, but Konrad
  wants it retained for the moment.
 
 ... because? I can't seem to see any relevant mails from Konrad in my
 vnuma patch folder.
 

That was quite some time ago (last year) I asked him about this and he
said oracle is still using it.

I would remove superpage support if I can, but since Konrad said they
are using it I will just leave it alone.

Wei.

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v6 04/23] libxc: duplicate snippet to allocate p2m_host array

2015-03-02 Thread Ian Campbell
On Mon, 2015-03-02 at 15:33 +, Wei Liu wrote:
 On Mon, Mar 02, 2015 at 03:26:58PM +, Ian Campbell wrote:
  On Thu, 2015-02-26 at 15:55 +, Wei Liu wrote:
   Currently all in tree code doesn't set the superpage flag, but Konrad
   wants it retained for the moment.
  
  ... because? I can't seem to see any relevant mails from Konrad in my
  vnuma patch folder.
  
 
 That was quite some time ago (last year) I asked him about this and he
 said oracle is still using it.

and will still be using it when they upgrade to 4.6?

 I would remove superpage support if I can, but since Konrad said they
 are using it I will just leave it alone.

Please can you explain this in the commit log then.



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v6 04/23] libxc: duplicate snippet to allocate p2m_host array

2015-03-02 Thread Ian Campbell
On Thu, 2015-02-26 at 15:55 +, Wei Liu wrote:
 Currently all in tree code doesn't set the superpage flag, but Konrad
 wants it retained for the moment.

... because? I can't seem to see any relevant mails from Konrad in my
vnuma patch folder.

In any case, the why is far more important than the who here.

 
 As I'm going to change the p2m_host array allocation, duplicate the code
 snippet to allocate p2m_host array in this patch, so that we retain the
 behaviour in superpage case.
 
 This patch introduces no functional change and it will make future patch
 easier to review. Also removed one stray tab while I was there.
 
 Signed-off-by: Wei Liu wei.l...@citrix.com
 Cc: Ian Campbell ian.campb...@citrix.com
 Cc: Ian Jackson ian.jack...@eu.citrix.com
 CC: Konrad Wilk konrad.w...@oracle.com
 ---
  tools/libxc/xc_dom_x86.c | 15 ++-
  1 file changed, 10 insertions(+), 5 deletions(-)
 
 diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
 index bf06fe4..9dbaedb 100644
 --- a/tools/libxc/xc_dom_x86.c
 +++ b/tools/libxc/xc_dom_x86.c
 @@ -772,15 +772,16 @@ int arch_setup_meminit(struct xc_dom_image *dom)
  return rc;
  }
  
 -dom-p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * dom-total_pages);
 -if ( dom-p2m_host == NULL )
 -return -EINVAL;
 -
  if ( dom-superpages )
  {
  int count = dom-total_pages  SUPERPAGE_PFN_SHIFT;
  xen_pfn_t extents[count];
  
 +dom-p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) *
 +  dom-total_pages);
 +if ( dom-p2m_host == NULL )
 +return -EINVAL;
 +
  DOMPRINTF(Populating memory with %d superpages, count);
  for ( pfn = 0; pfn  count; pfn++ )
  extents[pfn] = pfn  SUPERPAGE_PFN_SHIFT;
 @@ -809,9 +810,13 @@ int arch_setup_meminit(struct xc_dom_image *dom)
  return rc;
  }
  /* setup initial p2m */
 +dom-p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) *
 +  dom-total_pages);
 +if ( dom-p2m_host == NULL )
 +return -EINVAL;
  for ( pfn = 0; pfn  dom-total_pages; pfn++ )
  dom-p2m_host[pfn] = pfn;
 -
 +
  /* allocate guest memory */
  for ( i = rc = allocsz = 0;
(i  dom-total_pages)  !rc;



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v6 04/23] libxc: duplicate snippet to allocate p2m_host array

2015-03-02 Thread Konrad Rzeszutek Wilk
On Mon, Mar 02, 2015 at 04:18:08PM +, Ian Campbell wrote:
 On Mon, 2015-03-02 at 15:33 +, Wei Liu wrote:
  On Mon, Mar 02, 2015 at 03:26:58PM +, Ian Campbell wrote:
   On Thu, 2015-02-26 at 15:55 +, Wei Liu wrote:
Currently all in tree code doesn't set the superpage flag, but Konrad
wants it retained for the moment.
   
   ... because? I can't seem to see any relevant mails from Konrad in my
   vnuma patch folder.
   
  
  That was quite some time ago (last year) I asked him about this and he
  said oracle is still using it.
 
 and will still be using it when they upgrade to 4.6?

Sadly yes.
 
  I would remove superpage support if I can, but since Konrad said they
  are using it I will just leave it alone.
 
 Please can you explain this in the commit log then.
 
 

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v6 04/23] libxc: duplicate snippet to allocate p2m_host array

2015-03-02 Thread Konrad Rzeszutek Wilk
  @@ -772,15 +772,16 @@ int arch_setup_meminit(struct xc_dom_image *dom)
   return rc;
   }
   
  -dom-p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * 
  dom-total_pages);
  -if ( dom-p2m_host == NULL )
  -return -EINVAL;
  -
   if ( dom-superpages )
   {
   int count = dom-total_pages  SUPERPAGE_PFN_SHIFT;
   xen_pfn_t extents[count];
   
  +dom-p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) *
  +  dom-total_pages);

'count' pls.

  +if ( dom-p2m_host == NULL )
  +return -EINVAL;
  +
   DOMPRINTF(Populating memory with %d superpages, count);
   for ( pfn = 0; pfn  count; pfn++ )
   extents[pfn] = pfn  SUPERPAGE_PFN_SHIFT;
  @@ -809,9 +810,13 @@ int arch_setup_meminit(struct xc_dom_image *dom)
   return rc;
   }
   /* setup initial p2m */
  +dom-p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) *
  +  dom-total_pages);
  +if ( dom-p2m_host == NULL )
  +return -EINVAL;
   for ( pfn = 0; pfn  dom-total_pages; pfn++ )
   dom-p2m_host[pfn] = pfn;
  -
  +

??
   /* allocate guest memory */
   for ( i = rc = allocsz = 0;
 (i  dom-total_pages)  !rc;
 
 

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v6 04/23] libxc: duplicate snippet to allocate p2m_host array

2015-02-26 Thread Wei Liu
Currently all in tree code doesn't set the superpage flag, but Konrad
wants it retained for the moment.

As I'm going to change the p2m_host array allocation, duplicate the code
snippet to allocate p2m_host array in this patch, so that we retain the
behaviour in superpage case.

This patch introduces no functional change and it will make future patch
easier to review. Also removed one stray tab while I was there.

Signed-off-by: Wei Liu wei.l...@citrix.com
Cc: Ian Campbell ian.campb...@citrix.com
Cc: Ian Jackson ian.jack...@eu.citrix.com
CC: Konrad Wilk konrad.w...@oracle.com
---
 tools/libxc/xc_dom_x86.c | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index bf06fe4..9dbaedb 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -772,15 +772,16 @@ int arch_setup_meminit(struct xc_dom_image *dom)
 return rc;
 }
 
-dom-p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * dom-total_pages);
-if ( dom-p2m_host == NULL )
-return -EINVAL;
-
 if ( dom-superpages )
 {
 int count = dom-total_pages  SUPERPAGE_PFN_SHIFT;
 xen_pfn_t extents[count];
 
+dom-p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) *
+  dom-total_pages);
+if ( dom-p2m_host == NULL )
+return -EINVAL;
+
 DOMPRINTF(Populating memory with %d superpages, count);
 for ( pfn = 0; pfn  count; pfn++ )
 extents[pfn] = pfn  SUPERPAGE_PFN_SHIFT;
@@ -809,9 +810,13 @@ int arch_setup_meminit(struct xc_dom_image *dom)
 return rc;
 }
 /* setup initial p2m */
+dom-p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) *
+  dom-total_pages);
+if ( dom-p2m_host == NULL )
+return -EINVAL;
 for ( pfn = 0; pfn  dom-total_pages; pfn++ )
 dom-p2m_host[pfn] = pfn;
-
+
 /* allocate guest memory */
 for ( i = rc = allocsz = 0;
   (i  dom-total_pages)  !rc;
-- 
1.9.1


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel