From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>,
dario.faggioli@citrix.com,
Ian Jackson <ian.jackson@eu.citrix.com>,
xen-devel@lists.xen.org, jbeulich@suse.com,
Elena Ufimtseva <ufimtseva@gmail.com>
Subject: Re: [PATCH v3 03/19] libxc: allocate memory with vNUMA information for PV guest
Date: Wed, 14 Jan 2015 10:58:08 +0000 [thread overview]
Message-ID: <54B64BC0.6000903@citrix.com> (raw)
In-Reply-To: <20150114105359.GZ4226@zion.uk.xensource.com>
On 14/01/15 10:53, Wei Liu wrote:
>
>>> + return -EINVAL;
>>> + }
>>> +
>>> /* allocate guest memory */
>>> - for ( i = rc = allocsz = 0;
>>> - (i < dom->total_pages) && !rc;
>>> - i += allocsz )
>>> + pfn_base = 0;
>>> + for ( i = 0; i < dom->nr_vnodes; i++ )
>>> {
>>> - allocsz = dom->total_pages - i;
>>> - if ( allocsz > 1024*1024 )
>>> - allocsz = 1024*1024;
>>> - rc = xc_domain_populate_physmap_exact(
>>> - dom->xch, dom->guest_domid, allocsz,
>>> - 0, 0, &dom->p2m_host[i]);
>>> + unsigned int memflags;
>>> + uint64_t pages;
>>> +
>>> + memflags = 0;
>>> + if ( dom->vnode_to_pnode[i] != XC_VNUMA_NO_NODE )
>>> + {
>>> + memflags |= XENMEMF_exact_node(dom->vnode_to_pnode[i]);
>>> + memflags |= XENMEMF_exact_node_request;
>>> + }
>>> +
>>> + pages = (dom->vnode_size[i] << 20) >> PAGE_SHIFT;
>>> +
>>> + for ( j = 0; j < pages; j += allocsz )
>>> + {
>>> + allocsz = pages - j;
>>> + if ( allocsz > 1024*1024 )
>>> + allocsz = 1024*1024;
>>> +
>>> + rc = xc_domain_populate_physmap_exact(dom->xch,
>>> + dom->guest_domid, allocsz, 0, memflags,
>>> + &dom->p2m_host[pfn_base+j]);
>>> +
>>> + if ( rc )
>>> + {
>>> + if ( dom->vnode_to_pnode[i] != XC_VNUMA_NO_NODE )
>>> + xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
>>> + "%s: fail to allocate 0x%"PRIx64"/0x%"PRIpfn" pages (v=%d, p=%d)\n",
>>> + __FUNCTION__, pages, dom->total_pages, i,
>>> + dom->vnode_to_pnode[i]);
>> "failed to allocate"
>>
> Fixed.
>
>> I am not sure the total number of pages is useful here, especially as
>> you don't know how many pages have successfully been allocated first.
>>
> Are you suggesting we don't print any number of print more numbers?
I am not suggesting that you don't print numbers. "pages" is useful to
know in the error message, but "d->total_pages" is not, as you don't
know how many successful allocations have occurred before, and the total
allocated memory so far.
~Andrew
next prev parent reply other threads:[~2015-01-14 10:58 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 12:11 [PATCH v3 00/19] Virtual NUMA for PV and HVM Wei Liu
2015-01-13 12:11 ` [PATCH v3 01/19] xen: dump vNUMA information with debug key "u" Wei Liu
2015-01-13 16:38 ` Jan Beulich
2015-01-13 16:45 ` Wei Liu
2015-01-13 19:21 ` Andrew Cooper
2015-01-13 20:51 ` Wei Liu
2015-01-14 11:06 ` Andrew Cooper
2015-01-14 11:24 ` Jan Beulich
2015-01-14 11:45 ` Andrew Cooper
2015-01-14 12:02 ` Wei Liu
2015-01-14 15:04 ` Jan Beulich
2015-01-14 14:49 ` Jan Beulich
2015-01-14 17:25 ` Wei Liu
2015-01-15 8:14 ` Jan Beulich
2015-01-15 10:38 ` Andrew Cooper
2015-01-13 12:11 ` [PATCH v3 02/19] xen: make two memory hypercalls vNUMA-aware Wei Liu
2015-01-13 12:11 ` [PATCH v3 03/19] libxc: allocate memory with vNUMA information for PV guest Wei Liu
2015-01-13 17:05 ` Ian Jackson
2015-01-13 17:41 ` Wei Liu
2015-01-13 20:02 ` Andrew Cooper
2015-01-14 10:53 ` Wei Liu
2015-01-14 10:58 ` Andrew Cooper [this message]
2015-01-14 11:01 ` Wei Liu
2015-01-13 12:11 ` [PATCH v3 04/19] libxl: introduce vNUMA types Wei Liu
2015-01-13 15:40 ` Ian Jackson
2015-01-13 15:51 ` Wei Liu
2015-01-13 12:11 ` [PATCH v3 05/19] libxl: add vmemrange to libxl__domain_build_state Wei Liu
2015-01-13 17:02 ` Ian Jackson
2015-01-13 17:34 ` Wei Liu
2015-01-13 12:11 ` [PATCH v3 06/19] libxl: introduce libxl__vnuma_config_check Wei Liu
2015-01-13 12:11 ` [PATCH v3 07/19] libxl: x86: factor out e820_host_sanitize Wei Liu
2015-01-13 17:07 ` Ian Jackson
2015-01-13 21:00 ` Andrew Cooper
2015-01-14 10:30 ` Wei Liu
2015-01-14 11:40 ` Ian Campbell
2015-01-14 12:05 ` Wei Liu
2015-01-13 12:11 ` [PATCH v3 08/19] libxl: functions to build vmemranges for PV guest Wei Liu
2015-01-13 18:15 ` Ian Jackson
2015-01-14 11:05 ` Wei Liu
2015-01-13 12:11 ` [PATCH v3 09/19] libxl: build, check and pass vNUMA info to Xen " Wei Liu
2015-01-13 12:11 ` [PATCH v3 10/19] xen: handle XENMEM_get_vnumainfo in compat_memory_op Wei Liu
2015-01-13 16:41 ` Jan Beulich
2015-01-13 12:11 ` [PATCH v3 11/19] tools/hvmloader: link errno.h from xen internal Wei Liu
2015-01-13 16:32 ` Jan Beulich
2015-01-13 16:36 ` Wei Liu
2015-01-13 12:11 ` [PATCH v3 12/19] hvmloader: retrieve vNUMA information from hypervisor Wei Liu
2015-01-13 16:50 ` Jan Beulich
2015-01-13 17:17 ` Wei Liu
2015-01-13 12:11 ` [PATCH v3 13/19] hvmloader: construct SRAT Wei Liu
2015-01-13 16:52 ` Jan Beulich
2015-01-13 12:11 ` [PATCH v3 14/19] hvmloader: construct SLIT Wei Liu
2015-01-13 16:53 ` Jan Beulich
2015-01-13 12:11 ` [PATCH v3 15/19] libxc: allocate memory with vNUMA information for HVM guest Wei Liu
2015-01-13 18:15 ` Konrad Rzeszutek Wilk
2015-01-13 20:44 ` Wei Liu
2015-01-14 19:02 ` Konrad Rzeszutek Wilk
2015-01-13 12:11 ` [PATCH v3 16/19] libxl: build, check and pass vNUMA info to Xen " Wei Liu
2015-01-13 12:11 ` [PATCH v3 17/19] libxl: disallow memory relocation when vNUMA is enabled Wei Liu
2015-01-13 12:11 ` [PATCH v3 18/19] libxlutil: nested list support Wei Liu
2015-01-13 15:52 ` Ian Jackson
2015-01-13 16:11 ` Wei Liu
2015-01-13 18:25 ` Ian Jackson
2015-01-13 12:11 ` [PATCH v3 19/19] xl: vNUMA support Wei Liu
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=54B64BC0.6000903@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=dario.faggioli@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=ufimtseva@gmail.com \
--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 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.