All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Ian Jackson <ian.jackson@eu.citrix.com>
Subject: Re: [PATCH for-4.7] libxl: keep PoD target adjustment by memory fudge after reload_domain_config()
Date: Wed, 01 Jun 2016 10:29:36 +0200	[thread overview]
Message-ID: <87lh2pfh1r.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <CAFLBxZa98Ysuep+9uEvAHuSptEkibeRqFBtBB0jEwXd4DwKtug@mail.gmail.com> (George Dunlap's message of "Tue, 31 May 2016 19:36:57 +0100")

George Dunlap <George.Dunlap@eu.citrix.com> writes:

> On Tue, May 31, 2016 at 6:42 PM, Wei Liu <wei.liu2@citrix.com> wrote:
>> From: Vitaly Kuznetsov <vkuznets@redhat.com>
>>
>> Commit 56fb5fd623 ("libxl: adjust PoD target by memory fudge, too")
>> introduced target_memkb adjustment for HVM PoD domains on create. The
>> adjustment is however being reset on reload_domain_config() (e.g. when
>> we reboot the guest).
>
> It was determined that all of the following...
>
>>  For example:
>>
>> I'm trying to create HVM PoD domain with the following settings:
>> memory=1024
>> maxmem=4096
>> When the domain boots for the first time I see the following in Xen:
>>
>> (XEN)     nr_pages=262145 ... max_pages=262400 (looks good)
>>
>> When I reboot the domain I see the following:
>> (XEN)     nr_pages=261889 ... max_pages=262144  (oops)
>>
>> After second reboot:
>> (XEN)     nr_pages=261633 ... max_pages=261888 (even less)
>>
>> And eventually the domain crashes with "p2m_pod_demand_populate: Dom4 out of
>> PoD memory! (tot=261377 ents=787200 dom4)".
>
> has actually nothing to do with this patch; and that actually,
> contrary to the description above, the problem is that the adjustment
> is *not* being reset.
>
> A better description would be something like this:
>
> ---
> Commit 56fb5fd623 ("libxl: adjust PoD target by memory fudge, too")
> introduced target_memkb adjustment for HVM PoD domains on create,
> wherein
> the value it wrote to target is always 1MiB lower than the actual
> target_memkb.  Unfortunately, on reboot, it is this value which is
> read *unmodified* to feed into the next domain creation; from which
> 1MiB is subtracted *again*.  This means that any guest which reboots
> with memory < maxmem will have its memory target decreased by 1MiB on
> every boot.
>
> This patch makes it so that when reading target on reboot, we adjust
> the value we read *up* by 1MiB, so that the domain will be build with
> the appropriate amount of memory and the target will remain the same
> after reboot.
>
> This is still not quite a complete fix, as the 1MiB offset is only
> subtracted when creating or rebooting; it is not subtracted when 'xl
> set-memory' is called.  But it will prevent any situations where
> memory is continually increased or decreased.  A better fix will have
> to wait until after the release.
> ---

Yes, thanks, this description is better. Wei, please let me know if you
want me to re-send the patch with this description or if it's possible
to make the adjustment upon commit.

-- 
  Vitaly

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

  reply	other threads:[~2016-06-01  8:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31 17:42 [PATCH for-4.7] libxl: keep PoD target adjustment by memory fudge after reload_domain_config() Wei Liu
2016-05-31 18:36 ` George Dunlap
2016-06-01  8:29   ` Vitaly Kuznetsov [this message]
2016-06-01  8:41     ` Wei Liu
2016-06-01 15:48 ` Ian Jackson
2016-06-01 15:56   ` 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=87lh2pfh1r.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=George.Dunlap@eu.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.