All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Wang <yun.wang-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
To: Catalin Marinas
	<catalin.marinas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [RFC PATCH v2] iommu/amd: gray the 'irq_remap_table' object for kmemleak
Date: Wed, 2 Dec 2015 11:56:20 +0100	[thread overview]
Message-ID: <565ECE54.5080706@profitbricks.com> (raw)
In-Reply-To: <CAHkRjk5QNQiNeJTcjKFQzpac_4us_3Ts1w4+uRw6TY16LbgsJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>


On 12/02/2015 11:52 AM, Catalin Marinas wrote:
[snip]
>>
>> Is there any more concern? actually we just want to get rid of this
>> annoying report on obj won't leak, if you're going to create obj for
>> 'irq_lookup_table' that's also fine for us, or will you pick this patch?
> 
> My preference (from a kmemleak perspective) is to tell kmemleak about
> the irq_lookup_table. Untested:

I'm fine with both solution, will leave the decision to maintainer :-)

BTW, could you please send a formal patch with descriptions?

Regards,
Michael Wang

> 
> diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
> index 013bdfff2d4d..c41609f71cbe 100644
> --- a/drivers/iommu/amd_iommu_init.c
> +++ b/drivers/iommu/amd_iommu_init.c
> @@ -27,6 +27,7 @@
>  #include <linux/amd-iommu.h>
>  #include <linux/export.h>
>  #include <linux/iommu.h>
> +#include <linux/kmemleak.h>
>  #include <asm/pci-direct.h>
>  #include <asm/iommu.h>
>  #include <asm/gart.h>
> @@ -1692,6 +1693,7 @@ static struct syscore_ops amd_iommu_syscore_ops = {
> 
>  static void __init free_on_init_error(void)
>  {
> + kmemleak_free(irq_lookup_table);
>   free_pages((unsigned long)irq_lookup_table,
>     get_order(rlookup_table_size));
> 
> @@ -1906,6 +1908,7 @@ static int __init early_amd_iommu_init(void)
>   irq_lookup_table = (void *)__get_free_pages(
>   GFP_KERNEL | __GFP_ZERO,
>   get_order(rlookup_table_size));
> + kmemleak_alloc(irq_lookup_table, rlookup_table_size, 1, GFP_KERNEL);
>   if (!irq_lookup_table)
>   goto out;
>   }
> 

WARNING: multiple messages have this Message-ID (diff)
From: Michael Wang <yun.wang@profitbricks.com>
To: Catalin Marinas <catalin.marinas@gmail.com>
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: Wed, 2 Dec 2015 11:56:20 +0100	[thread overview]
Message-ID: <565ECE54.5080706@profitbricks.com> (raw)
In-Reply-To: <CAHkRjk5QNQiNeJTcjKFQzpac_4us_3Ts1w4+uRw6TY16LbgsJA@mail.gmail.com>


On 12/02/2015 11:52 AM, Catalin Marinas wrote:
[snip]
>>
>> Is there any more concern? actually we just want to get rid of this
>> annoying report on obj won't leak, if you're going to create obj for
>> 'irq_lookup_table' that's also fine for us, or will you pick this patch?
> 
> My preference (from a kmemleak perspective) is to tell kmemleak about
> the irq_lookup_table. Untested:

I'm fine with both solution, will leave the decision to maintainer :-)

BTW, could you please send a formal patch with descriptions?

Regards,
Michael Wang

> 
> diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
> index 013bdfff2d4d..c41609f71cbe 100644
> --- a/drivers/iommu/amd_iommu_init.c
> +++ b/drivers/iommu/amd_iommu_init.c
> @@ -27,6 +27,7 @@
>  #include <linux/amd-iommu.h>
>  #include <linux/export.h>
>  #include <linux/iommu.h>
> +#include <linux/kmemleak.h>
>  #include <asm/pci-direct.h>
>  #include <asm/iommu.h>
>  #include <asm/gart.h>
> @@ -1692,6 +1693,7 @@ static struct syscore_ops amd_iommu_syscore_ops = {
> 
>  static void __init free_on_init_error(void)
>  {
> + kmemleak_free(irq_lookup_table);
>   free_pages((unsigned long)irq_lookup_table,
>     get_order(rlookup_table_size));
> 
> @@ -1906,6 +1908,7 @@ static int __init early_amd_iommu_init(void)
>   irq_lookup_table = (void *)__get_free_pages(
>   GFP_KERNEL | __GFP_ZERO,
>   get_order(rlookup_table_size));
> + kmemleak_alloc(irq_lookup_table, rlookup_table_size, 1, GFP_KERNEL);
>   if (!irq_lookup_table)
>   goto out;
>   }
> 

  parent reply	other threads:[~2015-12-02 10:56 UTC|newest]

Thread overview: 45+ 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
     [not found]   ` <564F051E.9010703-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2015-11-25 11:14     ` Michael Wang
2015-11-25 11:14       ` Michael Wang
2015-11-25 15:08   ` Joerg Roedel
     [not found]     ` <20151125150806.GG2064-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-11-25 15:14       ` Michael Wang
2015-11-25 15:14         ` Michael Wang
2015-12-02 10:37         ` Michael Wang
2015-12-02 10:52           ` Catalin Marinas
     [not found]             ` <CAHkRjk5QNQiNeJTcjKFQzpac_4us_3Ts1w4+uRw6TY16LbgsJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-02 10:56               ` Michael Wang [this message]
2015-12-02 10:56                 ` Michael Wang
2015-12-02 11:31                 ` Catalin Marinas
     [not found]                   ` <CAHkRjk5WzPT1gRaa=3qyrp1gcee9ZQKF_rU42FAu0C6ep8JPug-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-02 11:38                     ` Michael Wang
2015-12-02 11:38                       ` Michael Wang
     [not found]                       ` <565ED81B.3020606-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2015-12-02 11:51                         ` Joerg Roedel
2015-12-02 11:51                           ` Joerg Roedel
     [not found]                           ` <20151202115142.GD18805-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-12-02 12:31                             ` Michael Wang
2015-12-02 12:31                               ` Michael Wang
2015-12-02 12:53                               ` Borislav Petkov
     [not found]                                 ` <20151202125315.GB3910-fF5Pk5pvG8Y@public.gmane.org>
2015-12-02 13:01                                   ` Michael Wang
2015-12-02 13:01                                     ` Michael Wang
     [not found]                                     ` <565EEBC3.5050807-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2015-12-02 13:13                                       ` Borislav Petkov
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
     [not found]                                                 ` <20151202135931.GF3783-fF5Pk5pvG8Y@public.gmane.org>
2015-12-02 14:09                                                   ` Michael Wang
2015-12-02 14:09                                                     ` Michael Wang
     [not found]                                                     ` <565EFB8E.4020600-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2015-12-02 14:13                                                       ` Borislav Petkov
2015-12-02 14:13                                                         ` Borislav Petkov
     [not found]                                                         ` <20151202141309.GG3783-fF5Pk5pvG8Y@public.gmane.org>
2015-12-02 14:21                                                           ` Michael Wang
2015-12-02 14:21                                                             ` Michael Wang
2015-12-02 17:36                                                   ` Catalin Marinas
2015-12-02 17:36                                                     ` Catalin Marinas
     [not found]                                                     ` <CAHkRjk4DdRE6=tN7VZu67Bsdty_4uT2GSbUff5MwP_nSJ+uj4A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-02 18:40                                                       ` Borislav Petkov
2015-12-02 18:40                                                         ` Borislav Petkov
2015-12-03  8:47                                                     ` Michael Wang
     [not found]                               ` <565EE4AA.4070309-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2015-12-02 12:56                                 ` Joerg Roedel
2015-12-02 12:56                                   ` Joerg Roedel
     [not found]                                   ` <20151202125636.GE18805-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-12-02 13:07                                     ` Michael Wang
2015-12-02 13:07                                       ` Michael Wang
2015-12-02 11:17               ` Joerg Roedel
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=565ECE54.5080706@profitbricks.com \
    --to=yun.wang-eikl63zcoxah+58jc4qpia@public.gmane.org \
    --cc=catalin.marinas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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.