From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f199.google.com (mail-wr0-f199.google.com [209.85.128.199]) by kanga.kvack.org (Postfix) with ESMTP id 9B3BD6B0390 for ; Wed, 29 Mar 2017 06:44:01 -0400 (EDT) Received: by mail-wr0-f199.google.com with SMTP id m33so1994919wrm.23 for ; Wed, 29 Mar 2017 03:44:01 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id y14si7992134wrd.240.2017.03.29.03.44.00 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 29 Mar 2017 03:44:00 -0700 (PDT) Date: Wed, 29 Mar 2017 12:43:56 +0200 From: Michal Hocko Subject: Re: [PATCH v2] module: check if memory leak by module. Message-ID: <20170329104355.GG27994@dhcp22.suse.cz> References: <1490767322-9914-1-git-send-email-maninder1.s@samsung.com> <20170329074522.GB27994@dhcp22.suse.cz> <20170329092332epcms5p10ae8263c6e3ef14eac40e08a09eff9e6@epcms5p1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170329092332epcms5p10ae8263c6e3ef14eac40e08a09eff9e6@epcms5p1> Sender: owner-linux-mm@kvack.org List-ID: To: Vaneet Narang Cc: Miroslav Benes , Maninder Singh , "jeyu@redhat.com" , "rusty@rustcorp.com.au" , "akpm@linux-foundation.org" , "chris@chris-wilson.co.uk" , "aryabinin@virtuozzo.com" , "joonas.lahtinen@linux.intel.com" , "keescook@chromium.org" , "pavel@ucw.cz" , "jinb.park7@gmail.com" , "anisse@astier.eu" , "rafael.j.wysocki@intel.com" , "zijun_hu@htc.com" , "mingo@kernel.org" , "mawilcox@microsoft.com" , "thgarnie@google.com" , "joelaf@google.com" , "kirill.shutemov@linux.intel.com" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , PANKAJ MISHRA , Ajeet Kumar Yadav , =?utf-8?B?7J207ZWZ67SJ?= , AMIT SAHRAWAT , =?utf-8?B?656E66a/?= , CPGS On Wed 29-03-17 09:23:32, Vaneet Narang wrote: > Hi, > > >> Hmm, how can you track _all_ vmalloc allocations done on behalf of the > >> module? It is quite some time since I've checked kernel/module.c but > >> from my vague understading your check is basically only about statically > >> vmalloced areas by module loader. Is that correct? If yes then is this > >> actually useful? Were there any bugs in the loader code recently? What > >> led you to prepare this patch? All this should be part of the changelog! > > First of all there is no issue in kernel/module.c. This patch add functionality > to detect scenario where some kernel module does some memory allocation but gets > unloaded without doing vfree. For example > static int kernel_init(void) > { > char * ptr = vmalloc(400 * 1024); > return 0; > } How can you track that allocation back to the module? Does this patch actually works at all? Also why would be vmalloc more important than kmalloc allocations? -- Michal Hocko SUSE Labs -- 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