From mboxrd@z Thu Jan 1 00:00:00 1970 From: Koshelev Vladimir Subject: hva_to_pfn and memory leak Date: Thu, 22 Nov 2012 18:13:26 +0400 Message-ID: <1030761353593606@web26e.yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from forward8.mail.yandex.net ([77.88.61.38]:43609 "EHLO forward8.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752641Ab2KVSyg (ORCPT ); Thu, 22 Nov 2012 13:54:36 -0500 Received: from web26e.yandex.ru (web26e.yandex.ru [77.88.61.6]) by forward8.mail.yandex.net (Yandex) with ESMTP id 08140F61E77 for ; Thu, 22 Nov 2012 18:13:26 +0400 (MSK) Sender: kvm-owner@vger.kernel.org List-ID: 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.