From: Catalin Marinas Date: Tue, 12 May 2020 14:17:23 +0000 Subject: Re: [PATCH] powerpc/kvm: silence kmemleak false positives Message-Id: <20200512141723.GB14943@gaia> List-Id: References: <87y2pybu38.fsf@mpe.ellerman.id.au> <44807D44-98D9-431C-9266-08014C4B47F6@lca.pw> In-Reply-To: <44807D44-98D9-431C-9266-08014C4B47F6@lca.pw> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: Qian Cai Cc: Michael Ellerman , paulus@ozlabs.org, benh@kernel.crashing.org, kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org On Mon, May 11, 2020 at 07:43:30AM -0400, Qian Cai wrote: > On May 11, 2020, at 7:15 AM, Michael Ellerman wrote: > > There is kmemleak_alloc_phys(), which according to the docs can be used > > for tracking a phys address. > > > > Did you try that? > > Catalin, feel free to give your thoughts here. > > My understanding is that it seems the doc is a bit misleading. > kmemleak_alloc_phys() is to allocate kmemleak objects for a physical > address range, so kmemleak could scan those memory pointers within > for possible referencing other memory. It was only used in memblock so > far, but those new memory allocations here contain no reference to > other memory. > > In this case, we have already had kmemleak objects for those memory > allocation. It is just that other pointers reference those memory by > their physical address which is a known kmemleak limitation won’t be > able to track the the connection. Thus, we always use > kmemleak_ignore() to not reporting those as leaks and don’t scan those > because they do not contain other memory reference. Indeed. I replied directly to Michael along the same lines. -- Catalin