From: Juergen Gross <jgross@suse.com>
To: Ian Campbell <ian.campbell@citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
Xen-devel <xen-devel@lists.xenproject.org>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Subject: Re: [PATCH] libxc: refactor memory allocation functions
Date: Tue, 1 Dec 2015 13:04:14 +0100 [thread overview]
Message-ID: <565D8CBE.9020001@suse.com> (raw)
In-Reply-To: <1448971124.15768.117.camel@citrix.com>
On 01/12/15 12:58, Ian Campbell wrote:
> On Tue, 2015-12-01 at 11:39 +0000, Wei Liu wrote:
>> There were some problems with the original memory allocation functions:
>> 1. xc_dom_alloc_segment and xc_dom_alloc_pad ended up calling
>> xc_dom_chk_alloc_pages while xc_dom_alloc_page open-coded everything.
>> 2. xc_dom_alloc_pad didn't call dom->allocate.
>>
>> Refactor the code so that:
>> 1. xc_dom_alloc_{segment,pad,page} end up calling
>> xc_dom_chk_alloc_pages.
>> 2. xc_dom_chk_alloc_pages calls dom->allocate.
>>
>> This way we avoid scattering dom->allocate over multiple locations and
>> open-coding.
>>
>> Also change the return type of xc_dom_alloc_page to xen_pfn_t and return
>> an invalid pfn when xc_dom_chk_alloc_pages fails.
>
> Given this presumably the handful of callers ought to gain some error
> handling in a followup patch?
I could do that. Wei?
>
> xc_dom_chk_alloc_pages does log, so at least the callers needn't bother
> with that.
>
>> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
>
>> ---
>> Cc: Ian Campbell <ian.campbell@citrix.com>
>> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
>> Cc: Juergen Gross <jgross@suse.com>
>>
>> We don't have INVALID_PFN, maybe we need one?
>
> We have INVALID_MFN and INVALID_P2M_ENTRY, not sure if the latter fits the
> bill (or if not how it is distinct from the former).
What about merging all of them into INVALID_FRAME?
I can create a patch(-series).
Juergen
next prev parent reply other threads:[~2015-12-01 12:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-01 11:39 [PATCH] libxc: refactor memory allocation functions Wei Liu
2015-12-01 11:45 ` Juergen Gross
2015-12-01 12:38 ` Ian Campbell
2015-12-01 11:58 ` Ian Campbell
2015-12-01 12:03 ` Wei Liu
2015-12-01 12:14 ` Ian Campbell
2015-12-01 12:04 ` Juergen Gross [this message]
2015-12-01 12:12 ` Wei Liu
2015-12-01 14:08 ` 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=565D8CBE.9020001@suse.com \
--to=jgross@suse.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--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 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.