Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932441AbbFHJiX (ORCPT ); Mon, 8 Jun 2015 05:38:23 -0400 Received: from resqmta-ch2-03v.sys.comcast.net ([69.252.207.35]:60748 "EHLO resqmta-ch2-03v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752704AbbFHJiP (ORCPT ); Mon, 8 Jun 2015 05:38:15 -0400 Date: Mon, 8 Jun 2015 04:38:13 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@east.gentwo.org To: "Liu, XinwuX" cc: "catalin.marinas@arm.com" , "penberg@kernel.org" , "mpm@selenic.com" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "yanmin_zhang@linux.intel.com" , "He, Bo" , "Chen, Lin Z" Subject: Re: [PATCH] slub/slab: fix kmemleak didn't work on some case In-Reply-To: <99C214DF91337140A8D774E25DF6CD5FC89DA2@shsmsx102.ccr.corp.intel.com> Message-ID: References: <99C214DF91337140A8D774E25DF6CD5FC89DA2@shsmsx102.ccr.corp.intel.com> Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1124 Lines: 29 On Mon, 8 Jun 2015, Liu, XinwuX wrote: > when kernel uses kmalloc to allocate memory, slub/slab will find > a suitable kmem_cache. Ususally the cache's object size is often > greater than requested size. There is unused space which contains > dirty data. These dirty data might have pointers pointing to a block dirty? In what sense? > of leaked memory. Kernel wouldn't consider this memory as leaked when > scanning kmemleak object. This has never been considered leaked memory before to my knowledge and the data is already initialized. F.e. The zeroing function in linux/mm/slub.c::slab_alloc_node() zeros the complete object and not only the number of bytes specified in the kmalloc call. Same thing is true for SLAB. I am a bit confused as to what issue this patch would address. Also please send clean patches without special characters. Ensure proper tabbing etc. -- 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/