From: Koshelev Vladimir <Vedun-Z@yandex.ru>
To: "kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: hva_to_pfn and memory leak
Date: Thu, 22 Nov 2012 21:02:27 +0400 [thread overview]
Message-ID: <1144801353603747@web5e.yandex.ru> (raw)
In-Reply-To: <1030761353593606@web26e.yandex.ru>
22.11.2012, 18:13, "Koshelev Vladimir" <Vedun-Z@yandex.ru>:
> Hello, guys!
>
> I have written paravirtual interface for GPA->HPA translation inside guest. I build GPA->HPA translation table in guest virtual memory.
> To do this, I need to translate userspace virtual address from memslot to host physical address. I use hva_to_pfn for it. It works fine, but linux doesn't free the guest
> memory after guest power off. After testing I have found that cause of memory leak is hva_to_pfg call. You can find my code at http://pastebin.com/0zBV2aPN.
> Do I translate hva to hpa in the right way?
>
> I do this patch for RHEL Linux Kernel 2.6.32-279.5.2.el6 because I use CentOS 6.3.
>
> Thanks!
>
> Vladimir.
Fixed.
I have found that kvm_release_pfn_clean is necessary for this case. Before that I thought hva_to_pfn just translates(doesn't map) the HVA, but it is not true.
prev parent reply other threads:[~2012-11-22 18:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-22 14:13 hva_to_pfn and memory leak Koshelev Vladimir
2012-11-22 17:02 ` Koshelev Vladimir [this message]
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=1144801353603747@web5e.yandex.ru \
--to=vedun-z@yandex.ru \
--cc=kvm@vger.kernel.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