From: Avi Kivity <avi@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: Paul Mackerras <paulus@samba.org>,
kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: PPC: Book3S HV: Fix refcounting of hugepages
Date: Tue, 08 May 2012 14:54:33 +0000 [thread overview]
Message-ID: <4FA933A9.8010502@redhat.com> (raw)
In-Reply-To: <59AC9683-912F-49C6-983E-1CE34E23BC5E@suse.de>
On 05/08/2012 04:10 PM, Alexander Graf wrote:
> On 08.05.2012, at 12:24, Paul Mackerras wrote:
>
> > From: David Gibson <david@gibson.dropbear.id.au>
> >
> > The H_REGISTER_VPA hcall implementation in HV Power KVM needs to pin some
> > guest memory pages into host memory so that they can be safely accessed
> > from usermode. It does this used get_user_pages_fast(). When the VPA is
> > unregistered, or the VCPUs are cleaned up, these pages are released using
> > put_page().
> >
> > However, the get_user_pages() is invoked on the specific memory are of the
> > VPA which could lie within hugepages. In case the pinned page is huge,
> > we explicitly find the head page of the compound page before calling
> > put_page() on it.
> >
> > At least with the latest kernel, this is not correct. put_page() already
> > handles finding the correct head page of a compound, and also deals with
> > various counts on the individual tail page which are important for
> > transparent huge pages. We don't support transparent hugepages on Power,
> > but even so, bypassing this count maintenance can lead (when the VM ends)
> > to a hugepage being released back to the pool with a non-zero mapcount on
> > one of the tail pages. This can then lead to a bad_page() when the page
> > is released from the hugepage pool.
> >
> > This removes the explicit compound_head() call to correct this bug.
> >
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > Signed-off-by: Paul Mackerras <paulus@samba.org>
>
> Acked-by: Alexander Graf <agraf@suse.de>
>
> Avi, could you please make sure this makes the next 3.4-rc or -stable?
>
>
Sure, applied to master, will push tomorrow.
--
error compiling committee.c: too many arguments to function
WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: Paul Mackerras <paulus@samba.org>,
kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: PPC: Book3S HV: Fix refcounting of hugepages
Date: Tue, 08 May 2012 17:54:33 +0300 [thread overview]
Message-ID: <4FA933A9.8010502@redhat.com> (raw)
In-Reply-To: <59AC9683-912F-49C6-983E-1CE34E23BC5E@suse.de>
On 05/08/2012 04:10 PM, Alexander Graf wrote:
> On 08.05.2012, at 12:24, Paul Mackerras wrote:
>
> > From: David Gibson <david@gibson.dropbear.id.au>
> >
> > The H_REGISTER_VPA hcall implementation in HV Power KVM needs to pin some
> > guest memory pages into host memory so that they can be safely accessed
> > from usermode. It does this used get_user_pages_fast(). When the VPA is
> > unregistered, or the VCPUs are cleaned up, these pages are released using
> > put_page().
> >
> > However, the get_user_pages() is invoked on the specific memory are of the
> > VPA which could lie within hugepages. In case the pinned page is huge,
> > we explicitly find the head page of the compound page before calling
> > put_page() on it.
> >
> > At least with the latest kernel, this is not correct. put_page() already
> > handles finding the correct head page of a compound, and also deals with
> > various counts on the individual tail page which are important for
> > transparent huge pages. We don't support transparent hugepages on Power,
> > but even so, bypassing this count maintenance can lead (when the VM ends)
> > to a hugepage being released back to the pool with a non-zero mapcount on
> > one of the tail pages. This can then lead to a bad_page() when the page
> > is released from the hugepage pool.
> >
> > This removes the explicit compound_head() call to correct this bug.
> >
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > Signed-off-by: Paul Mackerras <paulus@samba.org>
>
> Acked-by: Alexander Graf <agraf@suse.de>
>
> Avi, could you please make sure this makes the next 3.4-rc or -stable?
>
>
Sure, applied to master, will push tomorrow.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-05-08 14:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-08 10:24 [PATCH] KVM: PPC: Book3S HV: Fix refcounting of hugepages Paul Mackerras
2012-05-08 10:24 ` Paul Mackerras
2012-05-08 13:10 ` Alexander Graf
2012-05-08 13:10 ` Alexander Graf
2012-05-08 14:54 ` Avi Kivity [this message]
2012-05-08 14:54 ` Avi Kivity
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=4FA933A9.8010502@redhat.com \
--to=avi@redhat.com \
--cc=agraf@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=paulus@samba.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.