From: Catalin Marinas <catalin.marinas@arm.com>
To: Christoph Lameter <cl@linux.com>
Cc: "Liu, XinwuX" <xinwux.liu@intel.com>,
"penberg@kernel.org" <penberg@kernel.org>,
"mpm@selenic.com" <mpm@selenic.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"yanmin_zhang@linux.intel.com" <yanmin_zhang@linux.intel.com>,
"He, Bo" <bo.he@intel.com>, "Chen, Lin Z" <lin.z.chen@intel.com>
Subject: Re: [PATCH] slub/slab: fix kmemleak didn't work on some case
Date: Mon, 8 Jun 2015 11:13:02 +0100 [thread overview]
Message-ID: <20150608101302.GB31349@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1506080425350.10651@east.gentwo.org>
On Mon, Jun 08, 2015 at 10:38:13AM +0100, Christoph Lameter wrote:
> 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?
I guess XinwuX meant uninitialised.
> > 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.
It's not the object being allocated that is considered leaked. But
uninitialised data in this object is scanned by kmemleak and it may look
like valid pointers to real leaked objects. So such data increases the
number of kmemleak false negatives.
As I replied already, I don't think this is that bad, or at least not
worse than what kmemleak already does (looking at all data whether it's
pointer or not). It also doesn't solve the kmem_cache_alloc() case where
the original object size is no longer available.
> 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.
But that's only when __GFP_ZERO is passed.
--
Catalin
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-06-08 10:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-08 5:14 Liu, XinwuX
2015-06-08 9:38 ` Christoph Lameter
2015-06-08 10:13 ` Catalin Marinas [this message]
2015-06-09 8:10 ` Zhang, Yanmin
2015-06-09 15:03 ` Catalin Marinas
2015-06-10 7:45 ` Zhang, Yanmin
2015-06-10 9:48 ` Catalin Marinas
2015-06-11 8:18 ` Liu, XinwuX
2015-06-08 10:03 ` Catalin Marinas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150608101302.GB31349@e104818-lin.cambridge.arm.com \
--to=catalin.marinas@arm.com \
--cc=bo.he@intel.com \
--cc=cl@linux.com \
--cc=lin.z.chen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mpm@selenic.com \
--cc=penberg@kernel.org \
--cc=xinwux.liu@intel.com \
--cc=yanmin_zhang@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox