From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932290AbbLBAyg (ORCPT ); Tue, 1 Dec 2015 19:54:36 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:38183 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755329AbbLBAye (ORCPT ); Tue, 1 Dec 2015 19:54:34 -0500 Subject: Re: memory leak in alloc_huge_page To: Dmitry Vyukov References: <565DEC6C.4030809@oracle.com> From: Mike Kravetz Cc: Andrew Morton , Naoya Horiguchi , Hillf Danton , David Rientjes , "Kirill A. Shutemov" , Dave Hansen , "linux-mm@kvack.org" , LKML , Hugh Dickins , Greg Thelen , syzkaller , Kostya Serebryany , Alexander Potapenko , Sasha Levin , Eric Dumazet Message-ID: <565E413D.8050608@oracle.com> Date: Tue, 1 Dec 2015 16:54:21 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/01/2015 11:45 AM, Dmitry Vyukov wrote: > On Tue, Dec 1, 2015 at 7:52 PM, Mike Kravetz wrote: >> On 12/01/2015 06:04 AM, Dmitry Vyukov wrote: >>> There seems to be another leak if nrg is not NULL on this path, but >>> it's not what happens in my case since the WARNING does not fire. >> >> If nrg is not NULL, then it was added to the resv map and 'should' be >> free'ed when the map is free'ed. This is not optimal, but I do not >> think it would lead to a leak. I'll take a close look at this code >> with an emphasis on the leak you discovered. > > > Hi Mike, > > Note that it's not just a leak report, it is an actual leak. You > should be able to reproduce it. > OK, finally found the bug which is in region_del(). It does not correctly handle a "placeholder" region descriptor that is left after an aborted operation when the start of the region to be deleted is for the same page. I will have a patch shortly, after some testing. -- Mike Kravetz