From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by kanga.kvack.org (Postfix) with ESMTP id A51D76B0038 for ; Tue, 1 Dec 2015 19:54:34 -0500 (EST) Received: by pacdm15 with SMTP id dm15so22006654pac.3 for ; Tue, 01 Dec 2015 16:54:34 -0800 (PST) Received: from userp1040.oracle.com (userp1040.oracle.com. [156.151.31.81]) by mx.google.com with ESMTPS id s131si739784pfs.12.2015.12.01.16.54.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Dec 2015 16:54:33 -0800 (PST) Subject: Re: memory leak in alloc_huge_page References: <565DEC6C.4030809@oracle.com> From: Mike Kravetz Message-ID: <565E413D.8050608@oracle.com> Date: Tue, 1 Dec 2015 16:54:21 -0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Dmitry Vyukov 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 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 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org 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