mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Catalin Marinas <catalin.marinas@arm.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: pmenzel@molgen.mpg.de, Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Several suspected memory leaks
Date: Wed, 08 Aug 2018 23:45:30 +1000	[thread overview]
Message-ID: <87600las5h.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <CAHkRjk7aYtMJXmQ_zuV7B12JiCkLfg3-8x+ayTD2DU9gDwi8Hw@mail.gmail.com>

Catalin Marinas <catalin.marinas@arm.com> writes:
> On Wed, 11 Jul 2018 at 00:40, Benjamin Herrenschmidt
> <benh@kernel.crashing.org> wrote:
>> On Tue, 2018-07-10 at 17:17 +0200, Paul Menzel wrote:
>> > On a the IBM S822LC (8335-GTA) with Ubuntu 18.04 I built Linux master
>> > – 4.18-rc4+, commit 092150a2 (Merge branch 'for-linus'
>> > of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid) – with
>> > kmemleak. Several issues are found.
>>
>> Some of these are completely uninteresting though and look like
>> kmemleak bugs to me :-)
>>
>> >     [<00000000bc285bbf>] __pud_alloc+0x80/0x270
>> >     [<0000000007135d64>] hash__map_kernel_page+0x30c/0x4d0
>> >     [<0000000071677858>] __ioremap_at+0x108/0x140
>> >     [<000000000023e921>] __ioremap_caller+0x130/0x180
>> >     [<000000009dbc3923>] icp_native_init_one_node+0x5cc/0x760
>> >     [<0000000015f3168a>] icp_native_init+0x70/0x13c
>> >     [<00000000655550ed>] xics_init+0x38/0x1ac
>> >     [<0000000088dbf9d1>] pnv_init_IRQ+0x30/0x5c
>>
>> This is the interrupt controller mapping its registers, why on earth
>> would that be considered a leak ? kmemleak needs to learn to ignore
>> kernel page tables allocations.
>
> Indeed, that's just a false positive for powerpc. Kmemleak ignores
> page allocations and most architectures use __get_free_pages() for the
> page table. In this particular case, the powerpc code uses
> kmem_cache_alloc() and that's tracked by kmemleak. Since the pgd
> stores the __pa(pud), kmemleak doesn't detect this pointer and reports
> it as a leak. To work around this, you can pass SLAB_NOLEAKTRACE to
> kmem_cache_create() in pgtable_cache_add()

Ah thanks, I didn't know we could do it that way.

I did this instead which seems to work:

  https://git.kernel.org/torvalds/c/a984506c542e


cheers

  reply	other threads:[~2018-08-08 13:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-10 15:17 Paul Menzel
2018-07-10 23:37 ` Benjamin Herrenschmidt
2018-08-07 11:03   ` Catalin Marinas
2018-08-08 13:45     ` Michael Ellerman [this message]
2018-07-11 14:27 ` Michael Ellerman
2018-07-12  6:54   ` Michael Ellerman

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=87600las5h.fsf@concordia.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=pmenzel@molgen.mpg.de \
    /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

all inboxes | Powered by JetHome®