linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Christophe Leroy <christophe.leroy@c-s.fr>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: powerpc/mm: Don't report hugepage tables as memory leaks when using kmemleak
Date: Thu,  4 Oct 2018 16:14:35 +1000 (AEST)	[thread overview]
Message-ID: <42QjK73m02z9s8J@ozlabs.org> (raw)
In-Reply-To: <fa22576baa70fd0cdf8b3f5af3767116a1c680e7.1534164087.git.christophe.leroy@c-s.fr>

On Mon, 2018-08-13 at 13:19:52 UTC, Christophe Leroy wrote:
> When a process allocates a hugepage, the following leak is
> reported by kmemleak. This is a false positive which is
> due to the pointer to the table being stored in the PGD
> as physical memory address and not virtual memory pointer.
> 
> unreferenced object 0xc30f8200 (size 512):
>   comm "mmap", pid 374, jiffies 4872494 (age 627.630s)
>   hex dump (first 32 bytes):
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>   backtrace:
>     [<e32b68da>] huge_pte_alloc+0xdc/0x1f8
>     [<9e0df1e1>] hugetlb_fault+0x560/0x8f8
>     [<7938ec6c>] follow_hugetlb_page+0x14c/0x44c
>     [<afbdb405>] __get_user_pages+0x1c4/0x3dc
>     [<b8fd7cd9>] __mm_populate+0xac/0x140
>     [<3215421e>] vm_mmap_pgoff+0xb4/0xb8
>     [<c148db69>] ksys_mmap_pgoff+0xcc/0x1fc
>     [<4fcd760f>] ret_from_syscall+0x0/0x38
> 
> See commit a984506c542e2 ("powerpc/mm: Don't report PUDs as
> memory leaks when using kmemleak") for detailed explanation.
> 
> To fix that, this patch tells kmemleak to ignore the allocated
> hugepage table.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/803d690e68f0c5230183f1a42c7d50

cheers

      reply	other threads:[~2018-10-04  6:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-13 13:19 [PATCH] powerpc/mm: Don't report hugepage tables as memory leaks when using kmemleak Christophe Leroy
2018-10-04  6:14 ` Michael Ellerman [this message]

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=42QjK73m02z9s8J@ozlabs.org \
    --to=patch-notifications@ellerman.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=christophe.leroy@c-s.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).