From: David Hildenbrand <david@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Yumei Huang <yuhuang@redhat.com>,
stable@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>, Jiang Liu <liuj97@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] virtio-balloon: fix managed page counts when migrating pages between zones
Date: Thu, 5 Dec 2019 11:13:11 +0100 [thread overview]
Message-ID: <940e5d03-dc20-da0b-17e0-6f11cf480ec6@redhat.com> (raw)
In-Reply-To: <20191205110823.6479c3b2@redhat.com>
On 05.12.19 11:08, Igor Mammedov wrote:
> On Wed, 4 Dec 2019 21:48:07 +0100
> David Hildenbrand <david@redhat.com> wrote:
>
>> In case we have to migrate a ballon page to a newpage of another zone, the
>> managed page count of both zones is wrong. Paired with memory offlining
>> (which will adjust the managed page count), we can trigger kernel crashes
>> and all kinds of different symptoms.
>>
>> One way to reproduce:
>> 1. Start a QEMU guest with 4GB, no NUMA
>> 2. Hotplug a 1GB DIMM and only the memory to ZONE_NORMAL
> ^^^^
> should it be "online" ?
Very right!
[...]
>> mutex_unlock(&vb->balloon_lock);
>>
>> + /* fixup the managed page count (esp. of the zone) */
>> + if (!virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_DEFLATE_ON_OOM)) {
> what happens when balloon has the feature?
With that feature we don't touch the managed page counts at all (see the
other 2 adjust_managed_page_count() callers in this file).
>
>> + adjust_managed_page_count(page, 1);
>> + adjust_managed_page_count(newpage, -1);
>> + }
>> +
>> put_page(page); /* balloon reference */
>>
>> return MIGRATEPAGE_SUCCESS;
>
BTW, I posted a v2 just some minutes ago
(https://lkml.kernel.org/r/20191205092420.6934-1-david@redhat.com)
Thanks!
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2019-12-05 10:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-04 20:48 [PATCH] virtio-balloon: fix managed page counts when migrating pages between zones David Hildenbrand
2019-12-05 9:04 ` David Hildenbrand
2019-12-05 10:08 ` Igor Mammedov
2019-12-05 10:13 ` David Hildenbrand [this message]
2019-12-10 13:31 ` Michael S. Tsirkin
2019-12-10 13:38 ` David Hildenbrand
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=940e5d03-dc20-da0b-17e0-6f11cf480ec6@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=imammedo@redhat.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liuj97@gmail.com \
--cc=mst@redhat.com \
--cc=stable@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=yuhuang@redhat.com \
/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).