All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qian Cai <cai@lca.pw>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: paulus@ozlabs.org, benh@kernel.crashing.org,
	catalin.marinas@arm.com, kvm-ppc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc/kvm: silence kmemleak false positives
Date: Mon, 11 May 2020 07:43:30 -0400	[thread overview]
Message-ID: <44807D44-98D9-431C-9266-08014C4B47F6@lca.pw> (raw)
In-Reply-To: <87y2pybu38.fsf@mpe.ellerman.id.au>



> On May 11, 2020, at 7:15 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> 
> There is kmemleak_alloc_phys(), which according to the docs can be used
> for tracking a phys address.
> 
> Did you try that?

Caitlin, 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.

WARNING: multiple messages have this Message-ID (diff)
From: Qian Cai <cai@lca.pw>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org,
	catalin.marinas@arm.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/kvm: silence kmemleak false positives
Date: Mon, 11 May 2020 07:43:30 -0400	[thread overview]
Message-ID: <44807D44-98D9-431C-9266-08014C4B47F6@lca.pw> (raw)
In-Reply-To: <87y2pybu38.fsf@mpe.ellerman.id.au>



> On May 11, 2020, at 7:15 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> 
> There is kmemleak_alloc_phys(), which according to the docs can be used
> for tracking a phys address.
> 
> Did you try that?

Caitlin, 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.

WARNING: multiple messages have this Message-ID (diff)
From: Qian Cai <cai@lca.pw>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: paulus@ozlabs.org, benh@kernel.crashing.org,
	catalin.marinas@arm.com, kvm-ppc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc/kvm: silence kmemleak false positives
Date: Mon, 11 May 2020 11:43:30 +0000	[thread overview]
Message-ID: <44807D44-98D9-431C-9266-08014C4B47F6@lca.pw> (raw)
In-Reply-To: <87y2pybu38.fsf@mpe.ellerman.id.au>



> On May 11, 2020, at 7:15 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> 
> There is kmemleak_alloc_phys(), which according to the docs can be used
> for tracking a phys address.
> 
> Did you try that?

Caitlin, 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.

  parent reply	other threads:[~2020-05-11 11:43 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-09  1:55 [PATCH] powerpc/kvm: silence kmemleak false positives Qian Cai
2020-05-09  1:55 ` Qian Cai
2020-05-09  1:55 ` Qian Cai
2020-05-11 11:15 ` Michael Ellerman
2020-05-11 11:15   ` Michael Ellerman
2020-05-11 11:15   ` Michael Ellerman
2020-05-11 11:28   ` Catalin Marinas
2020-05-11 11:28     ` Catalin Marinas
2020-05-11 11:28     ` Catalin Marinas
2020-05-13  4:00     ` Michael Ellerman
2020-05-13  4:00       ` Michael Ellerman
2020-05-13  4:00       ` Michael Ellerman
2020-05-11 11:43   ` Qian Cai [this message]
2020-05-11 11:43     ` Qian Cai
2020-05-11 11:43     ` Qian Cai
2020-05-12 14:17     ` Catalin Marinas
2020-05-12 14:17       ` Catalin Marinas
2020-05-12 14:17       ` Catalin Marinas
2020-05-13  4:05 ` Michael Ellerman
2020-05-13  4:05   ` Michael Ellerman
2020-05-13  4:05   ` Michael Ellerman
2020-05-13  6:24   ` Qian Cai
2020-05-13  6:24     ` Qian Cai
2020-05-13  6:24     ` Qian Cai

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=44807D44-98D9-431C-9266-08014C4B47F6@lca.pw \
    --to=cai@lca.pw \
    --cc=benh@kernel.crashing.org \
    --cc=catalin.marinas@arm.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@ozlabs.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.