From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUIrA-0005wn-Vf for qemu-devel@nongnu.org; Thu, 10 Oct 2013 12:13:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUIr4-0006au-6M for qemu-devel@nongnu.org; Thu, 10 Oct 2013 12:12:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUIr3-0006ag-Ub for qemu-devel@nongnu.org; Thu, 10 Oct 2013 12:12:50 -0400 From: Andrea Arcangeli Date: Thu, 10 Oct 2013 18:12:40 +0200 Message-Id: <1381421561-10203-1-git-send-email-aarcange@redhat.com> Subject: [Qemu-devel] [PATCH] initialize PG_reserved for tail pages of gigantig compound pages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrew Morton Cc: kvm@vger.kernel.org, Gleb Natapov , Hugh Dickins , qemu-devel@nongnu.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mel Gorman Hi, large CC list because the below patch is important to merge before 3.12 final, either that or 11feeb498086a3a5907b8148bdf1786a9b18fc55 should be reverted ASAP. The optimization 11feeb498086a3a5907b8148bdf1786a9b18fc55 avoids deferefencing the head page during KVM mmio vmexit, and it is a worthwhile optimization. However for it to work, PG_reserved must be identical between tail and head pages of all compound pages (at least those that can end up used as guest physical memory). That looked a safe assumption to make and it is enforced everywhere except by the gigantic compound page initialization code (i.e. KVM running on hugepagesz=1g didn't work as expected). This further patch enforces the above assumption for gigantic compound pages too. It has been successfully verified to fix the gigantic compound pages memory leak in combination with patch 11feeb498086a3a5907b8148bdf1786a9b18fc55. Enforcing PG_reserved not set for tail pages of hugetlbfs gigantic compound pages sounds safer regardless of commit 11feeb498086a3a5907b8148bdf1786a9b18fc55 to be consistent with the other hugetlbfs page sizes (i.e hugetlbfs page order < MAX_ORDER). Thanks, Andrea Andrea Arcangeli (1): mm: hugetlb: initialize PG_reserved for tail pages of gigantig compound pages mm/hugetlb.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)