[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20141028132617.12dc0fb45f33103fe9f6b04b@linux-foundation.org>
Date: Tue, 28 Oct 2014 13:26:17 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Marek Szyprowski <m.szyprowski@...sung.com>
Cc: Stephen Rothwell <sfr@...b.auug.org.au>,
Kyungmin Park <kyungmin.park@...sung.com>,
linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>,
Thierry Reding <treding@...dia.com>
Subject: Re: linux-next: manual merge of the akpm-current tree with the
dma-mapping tree
On Tue, 28 Oct 2014 07:54:09 +0100 Marek Szyprowski <m.szyprowski@...sung.com> wrote:
> Hello,
>
> On 2014-10-28 07:29, Andrew Morton wrote:
> > On Tue, 28 Oct 2014 15:24:44 +1100 Stephen Rothwell <sfr@...b.auug.org.au> wrote:
> >
> >> Today's linux-next merge of the akpm-current tree got a conflict in
> >> mm/cma.c between commit 16195ddd4ebc ("mm: cma: Ensure that
> >> reservations never cross the low/high mem boundary") from the
> >> dma-mapping tree and commit 2a70e5a78672 ("mm/cma: ake kmemleak ignore
> >> CMA regions") from the akpm-current tree.
> > hm, we have multiple trees altering mm/cma.c?
> >
> > I'm a bit surprised that this series was merged, given that Laurent
> > said he would be sending out a v2...
>
> v2 of Laurent's patches has been posted on 24th October
> (https://lkml.org/lkml/2014/10/24/207 ), but since I didn't notice them
> to be taken
> I thought that it would make sense to get them via my tree and send them
> to Linus
> during the 3.18-rc cycle. If this was not appropriate, I will drop my tree.
I think I got it all sorted out. Thierry's "mm/cma: make kmemleak
ignore CMA regions" needed a bit of rework - please check.
From: Thierry Reding <treding@...dia.com>
Subject: mm/cma: make kmemleak ignore CMA regions
kmemleak will add allocations as objects to a pool. The memory allocated
for each object in this pool is periodically searched for pointers to
other allocated objects. This only works for memory that is mapped into
the kernel's virtual address space, which happens not to be the case for
most CMA regions.
Furthermore, CMA regions are typically used to store data transferred to
or from a device and therefore don't contain pointers to other objects.
Without this, the kernel crashes on the first execution of the
scan_gray_list() because it tries to access highmem. Perhaps a more
appropriate fix would be to reject any object that can't map to a kernel
virtual address?
[akpm@...ux-foundation.org: add comment]
[akpm@...ux-foundation.org: fix comment, per Catalin]
[sfr@...b.auug.org.au: include linux/io.h for phys_to_virt()]
Signed-off-by: Thierry Reding <treding@...dia.com>
Cc: Michal Nazarewicz <mina86@...a86.com>
Cc: Marek Szyprowski <m.szyprowski@...sung.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@....com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Cc: Catalin Marinas <catalin.marinas@....com>
Signed-off-by: Stephen Rothwell <sfr@...b.auug.org.au>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---
mm/cma.c | 6 ++++++
1 file changed, 6 insertions(+)
diff -puN mm/cma.c~mm-cma-make-kmemleak-ignore-cma-regions mm/cma.c
--- a/mm/cma.c~mm-cma-make-kmemleak-ignore-cma-regions
+++ a/mm/cma.c
@@ -33,6 +33,7 @@
#include <linux/log2.h>
#include <linux/cma.h>
#include <linux/highmem.h>
+#include <linux/io.h>
struct cma {
unsigned long base_pfn;
@@ -301,6 +302,11 @@ int __init cma_declare_contiguous(phys_a
}
}
+ /*
+ * kmemleak scans/reads tracked objects for pointers to other
+ * objects but this address isn't mapped and accessible
+ */
+ kmemleak_ignore(phys_to_virt(addr));
base = addr;
}
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists