From: Michael Wang <yun.wang@profitbricks.com>
To: Catalin Marinas <catalin.marinas@gmail.com>,
Borislav Petkov <bp@alien8.de>
Cc: Joerg Roedel <joro@8bytes.org>,
iommu@lists.linux-foundation.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH v2] iommu/amd: gray the 'irq_remap_table' object for kmemleak
Date: Thu, 3 Dec 2015 09:47:46 +0100 [thread overview]
Message-ID: <566001B2.2060701@profitbricks.com> (raw)
In-Reply-To: <CAHkRjk4DdRE6=tN7VZu67Bsdty_4uT2GSbUff5MwP_nSJ+uj4A@mail.gmail.com>
On 12/02/2015 06:36 PM, Catalin Marinas wrote:
> On 2 December 2015 at 13:59, Borislav Petkov <bp@alien8.de> wrote:
[snip]
>
> 1. The sl?b allocators themselves use page allocations, so kmemleak
> could end up detecting the same pointer twice, hiding a potential leak
>
> 2. Most page allocations do not contain data/pointers relevant to
> kmemleak (e.g. page cache pages), however the randomness of such data
> greatly diminishes kmemleak's ability to detect real leaks
>
> Arguably, kmemleak could be made to detect both cases above by a
> combination of page flags, additional annotations or specific page
> alloc API. However, this has its own drawbacks in terms of code
> complexity (potentially outside mm/kmemleak.c) and overhead.
Thanks for the very nice explain :-) I used to thought overhead is
the only concern, missing the point regarding allocator it self.
Regards,
Michael Wang
>
> Regarding a kmemleak_alloc() annotation like in the patch I suggested,
> that's the second one I've seen needed outside alloc APIs (the first
> one is commit f75782e4e067 - "block: kmemleak: Track the page
> allocations for struct request"). If the number of such explicit
> annotations stays small, it's better to keep it this way.
>
> There are other explicit annotations like kmemleak_not_leak() or
> kmemleak_ignore() but these are for objects kmemleak knows about and
> incorrectly reports them as leaks. Most of the time is because the
> pointers to such objects are stored in a different form (e.g. physical
> address).
>
> Anyway, kmemleak is not the only tool requiring annotations (take
> spin_lock_nested() for example). If needed, we could do with an
> additional page alloc/free API which informs kmemleak in the process
> but I don't think it's worth it.
>
next prev parent reply other threads:[~2015-12-03 8:47 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-20 11:09 [RFC PATCH] iommu/amd: make kmemleak ignore the 'irq_remap_table' object Michael Wang
2015-11-20 11:33 ` [RFC PATCH v2] iommu/amd: gray the 'irq_remap_table' object for kmemleak Michael Wang
2015-11-20 12:31 ` Michael Wang
2015-11-25 11:14 ` Michael Wang
2015-11-25 15:08 ` Joerg Roedel
2015-11-25 15:14 ` Michael Wang
2015-12-02 10:37 ` Michael Wang
2015-12-02 10:52 ` Catalin Marinas
2015-12-02 10:56 ` Michael Wang
2015-12-02 11:31 ` Catalin Marinas
2015-12-02 11:38 ` Michael Wang
2015-12-02 11:51 ` Joerg Roedel
2015-12-02 12:31 ` Michael Wang
2015-12-02 12:53 ` Borislav Petkov
2015-12-02 13:01 ` Michael Wang
2015-12-02 13:13 ` Borislav Petkov
2015-12-02 13:18 ` Michael Wang
2015-12-02 13:40 ` Borislav Petkov
2015-12-02 13:48 ` Michael Wang
2015-12-02 13:59 ` Borislav Petkov
2015-12-02 14:09 ` Michael Wang
2015-12-02 14:13 ` Borislav Petkov
2015-12-02 14:21 ` Michael Wang
2015-12-02 17:36 ` Catalin Marinas
2015-12-02 18:40 ` Borislav Petkov
2015-12-03 8:47 ` Michael Wang [this message]
2015-12-02 12:56 ` Joerg Roedel
2015-12-02 13:07 ` Michael Wang
2015-12-02 11:17 ` Joerg Roedel
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=566001B2.2060701@profitbricks.com \
--to=yun.wang@profitbricks.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@gmail.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.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