Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753811AbbDHVQR (ORCPT ); Wed, 8 Apr 2015 17:16:17 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:48302 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752535AbbDHVQO (ORCPT ); Wed, 8 Apr 2015 17:16:14 -0400 Message-ID: <55259A95.3030500@oracle.com> Date: Wed, 08 Apr 2015 14:16:05 -0700 From: Mike Kravetz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Shawn Bohrer , linux-mm@kvack.org CC: linux-kernel@vger.kernel.org Subject: Re: HugePages_Rsvd leak References: <20150408161539.GA29546@sbohrermbp13-local.rgmadvisors.com> In-Reply-To: <20150408161539.GA29546@sbohrermbp13-local.rgmadvisors.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1410 Lines: 29 On 04/08/2015 09:15 AM, Shawn Bohrer wrote: > I've noticed on a number of my systems that after shutting down my > application that uses huge pages that I'm left with some pages still > in HugePages_Rsvd. It is possible that I still have something using > huge pages that I'm not aware of but so far my attempts to find > anything using huge pages have failed. I've run some simple tests > using map_hugetlb.c from the kernel source and can see that pages that > have been reserved but not allocated still show up in > /proc//smaps and /proc//numa_maps. Are there any cases > where this is not true? Just a quick question. Are you using hugetlb filesystem(s)? If so, you might want to take a look at files residing in the filesystem(s). As an experiment, I had a program do a simple mmap() of a file in a hugetlb filesystem. The program just created the mapping, and did not actually fault/allocate any huge pages. The result was the reservation (HugePages_Rsvd) of sufficient huge pages to cover the mapping. When the program exited, the reservations remained. If I remove (unlink) the file the reservations will be removed. -- Mike Kravetz -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/