From: George Dunlap <george.dunlap@eu.citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <Ian.Campbell@citrix.com>,
xen-devel <xen-devel@lists.xen.org>
Subject: Re: PoD code killing domain before it really gets started
Date: Tue, 7 Aug 2012 16:08:15 +0100 [thread overview]
Message-ID: <50212F5F.3090405@eu.citrix.com> (raw)
In-Reply-To: <502134440200007800093416@nat28.tlf.novell.com>
On 07/08/12 14:29, Jan Beulich wrote:
>>>> On 07.08.12 at 15:13, George Dunlap <George.Dunlap@eu.citrix.com> wrote:
>> On Tue, Aug 7, 2012 at 1:17 PM, Jan Beulich <JBeulich@suse.com> wrote:
>>>>>> On 06.08.12 at 18:03, George Dunlap <George.Dunlap@eu.citrix.com> wrote:
>>>> 2. Allocate the PoD cache before populating the p2m table
>>> So this doesn't work, the call simply has no effect (and never
>>> reaches p2m_pod_set_cache_target()). Apparently because
>>> of
>>>
>>> /* P == B: Nothing to do. */
>>> if ( p2md->pod.entry_count == 0 )
>>> goto out;
>>>
>>> in p2m_pod_set_mem_target(). Now I'm not sure about the
>>> proper adjustment here: Entirely dropping the conditional is
>>> certainly wrong. Would
>>>
>>> if ( p2md->pod.entry_count == 0 && d->tot_pages > 0 )
>>> goto out;
>>>
>>> be okay?
>>>
>>> But then later in that function we also have
>>>
>>> /* B < T': Set the cache size equal to # of outstanding entries,
>>> * let the balloon driver fill in the rest. */
>>> if ( pod_target > p2md->pod.entry_count )
>>> pod_target = p2md->pod.entry_count;
>>>
>>> which in the case at hand would set pod_target to 0, and the
>>> whole operation would again not have any effect afaict. So
>>> maybe this was the reason to do this operation _after_ the
>>> normal address space population?
>> Snap -- forgot about that.
>>
>> The main thing is for set_mem_target() to be simple for the toolstack
>> -- it's just supposed to say how much memory it wants the guest to
>> use, and Xen is supposed to figure out how much memory the PoD cache
>> needs. The interface is that the toolstack is just supposed to call
>> set_mem_target() after each time it changes the balloon target. The
>> idea was to be robust against the user setting arbitrary new targets
>> before the balloon driver had reached the old target. So the problem
>> with allowing (pod_target > entry_count) is that that's the condition
>> that happens when you are ballooning up.
>>
>> Maybe the best thing to do is to introduce a specific call to
>> initialize the PoD cache that would ignore entry_count?
> Hmm, would looks more like a hack to me.
>
> How about doing the initial check as suggested earlier
>
> if ( p2md->pod.entry_count == 0 && d->tot_pages > 0 )
> goto out;
>
> and the latter check in a similar way
>
> if ( pod_target > p2md->pod.entry_count && d->tot_pages > 0 )
> pod_target = p2md->pod.entry_count;
>
> (which would still take care of any ballooning activity)? Or are
> there any other traps to fall into?
The "d->tot_pages > 0" seems more like a hack to me. :-) What's hackish
about having an interface like this?
* allocate_pod_mem()
* for() { populate_pod_mem() }
* [Boot VM]
* set_pod_target()
Right now set_pod_mem() is used both for initial allocation and for
adjustments. But it seems like there's good reason to make a distinction.
-George
next prev parent reply other threads:[~2012-08-07 15:08 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-26 14:41 PoD code killing domain before it really gets started Jan Beulich
2012-07-26 15:37 ` Jan Beulich
2012-07-26 16:14 ` George Dunlap
2012-07-27 6:45 ` Jan Beulich
2012-08-06 13:57 ` Jan Beulich
2012-08-06 14:12 ` Jan Beulich
2012-08-06 16:03 ` George Dunlap
2012-08-07 7:34 ` Jan Beulich
2012-08-07 10:00 ` Tim Deegan
2012-08-07 10:32 ` George Dunlap
2012-08-07 11:03 ` Jan Beulich
2012-08-07 10:20 ` George Dunlap
2012-08-07 11:05 ` Jan Beulich
2012-08-07 12:17 ` Jan Beulich
2012-08-07 13:13 ` George Dunlap
2012-08-07 13:29 ` Jan Beulich
2012-08-07 15:08 ` George Dunlap [this message]
2012-08-07 15:36 ` Jan Beulich
2012-08-09 8:37 ` Jan Beulich
[not found] <mailman.10292.1344326858.1399.xen-devel@lists.xen.org>
2012-08-07 14:40 ` Andres Lagar-Cavilla
2012-08-07 15:04 ` George Dunlap
2012-08-07 15:36 ` Andres Lagar-Cavilla
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=50212F5F.3090405@eu.citrix.com \
--to=george.dunlap@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.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).