From: Andrea Arcangeli <andrea@qumranet.com>
To: Ben-Ami Yassour <benami@il.ibm.com>
Cc: aliguori@us.ibm.com, Han Weidong <weidong.han@intel.com>,
"Kay, Allen M" <allen.m.kay@intel.com>,
Muli Ben-Yehuda <muli@il.ibm.com>,
Amit Shah <amit.shah@qumranet.com>,
kvm@vger.kernel.org, avi@qumranet.com
Subject: Re: [PATCH] Handle vma regions with no backing page
Date: Tue, 3 Jun 2008 13:39:37 +0200 [thread overview]
Message-ID: <20080603113937.GE8158@duo.random> (raw)
In-Reply-To: <alpine.DEB.1.10.0806031413010.8803@cluwyn.haifa.ibm.com>
On Tue, Jun 03, 2008 at 02:17:55PM +0300, Ben-Ami Yassour wrote:
> Anthony Liguori <aliguori@us.ibm.com> wrote on 04/29/2008 05:32:09 PM:
>
>> Subject
>>
>> [PATCH] Handle vma regions with no backing page
>>
>> This patch allows VMA's that contain no backing page to be used for guest
>> memory. This is a drop-in replacement for Ben-Ami's first page in his
>> direct
>> mmio series. Here, we continue to allow mmio pages to be represented in
>> the
>> rmap.
>
>> struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn)
>> {
>> - return pfn_to_page(gfn_to_pfn(kvm, gfn));
>> + pfn_t pfn;
>> +
>> + pfn = gfn_to_pfn(kvm, gfn);
>> + if (pfn_valid(pfn))
>> + return pfn_to_page(pfn);
>> +
>> + return NULL;
>> }
>
> We noticed that pfn_valid does not always works as expected by this patch
> to indicate that a pfn has a backing page.
> We have seen a case where CONFIG_NUMA was not set and then where pfn_valid
> returned 1 for an mmio pfn.
> We then changed the config file with CONFIG_NUMA set and it worked fine as
> expected (since a different implementation of pfn_valid was used).
>
> How should we overcome this issue?
There's a page_is_ram() too, but that's the e820 map check and it
means it's RAM not that there's a page backing store. Certainly if
it's not ram we should go ahead with just the pfn but it'd be a
workaround.
I really think it'd be better off to fix pfn_valid to work for NUMA. I
can't see how pfn_valid can be ok to return true when there's no
backing page... Probably pfn_valid was used for debugging todate, but
if you check vm_normal_page you'll see that it is not used just for
debugging and it seems VM_MIXEDMAP will break as much as KVM.
I can't see how VM_MIXEDMAP can be sane doing pfn_to_page(pfn) and
pretending this is a normal page, when there's no 'struct page'
backing the pfn.
next prev parent reply other threads:[~2008-06-03 11:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-03 11:17 [PATCH] Handle vma regions with no backing page Ben-Ami Yassour
2008-06-03 11:39 ` Andrea Arcangeli [this message]
2008-06-04 15:09 ` Ben-Ami Yassour
2008-06-04 16:17 ` Muli Ben-Yehuda
2008-06-04 19:34 ` Andrea Arcangeli
2008-06-04 19:41 ` Anthony Liguori
2008-06-04 19:51 ` Andrea Arcangeli
2008-06-04 19:59 ` Dave Hansen
2008-06-04 9:48 ` Avi Kivity
2008-06-04 16:48 ` Anthony Liguori
-- strict thread matches above, loose matches on Subject: below --
2008-04-29 14:32 Anthony Liguori
2008-04-29 14:54 ` Andrea Arcangeli
2008-04-29 15:14 ` Anthony Liguori
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=20080603113937.GE8158@duo.random \
--to=andrea@qumranet.com \
--cc=aliguori@us.ibm.com \
--cc=allen.m.kay@intel.com \
--cc=amit.shah@qumranet.com \
--cc=avi@qumranet.com \
--cc=benami@il.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=muli@il.ibm.com \
--cc=weidong.han@intel.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