From: Laura Abbott <lauraa@codeaurora.org>
To: Andrew Morton <akpm@linux-foundation.org>,
Kyungmin Park <kmpark@infradead.org>, Dave Hansen <dave@sr71.net>,
linux-mm@kvack.org, Russell King <linux@arm.linux.org.uk>
Cc: linux-kernel@vger.kernel.org,
Laura Abbott <lauraa@codeaurora.org>,
linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCHv3 07/11] arm: mm: Add iotable_init_novmreserve
Date: Thu, 2 Jan 2014 13:53:25 -0800 [thread overview]
Message-ID: <1388699609-18214-8-git-send-email-lauraa@codeaurora.org> (raw)
In-Reply-To: <1388699609-18214-1-git-send-email-lauraa@codeaurora.org>
iotable_init is currently used by dma_contiguous_remap to remap
CMA memory appropriately. This has the side effect of reserving
the area of CMA in the vmalloc tracking structures. This is fine
under normal circumstances but it creates conflicts if we want
to track lowmem in vmalloc. Since dma_contiguous_remap is only
really concerned with the remapping, introduce iotable_init_novmreserve
to allow remapping of pages without reserving the virtual address
in vmalloc space.
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
---
arch/arm/include/asm/mach/map.h | 2 ++
arch/arm/mm/dma-mapping.c | 2 +-
arch/arm/mm/ioremap.c | 5 +++--
arch/arm/mm/mm.h | 2 +-
arch/arm/mm/mmu.c | 17 ++++++++++++++---
5 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
index 2fe141f..02e3509 100644
--- a/arch/arm/include/asm/mach/map.h
+++ b/arch/arm/include/asm/mach/map.h
@@ -37,6 +37,7 @@ struct map_desc {
#ifdef CONFIG_MMU
extern void iotable_init(struct map_desc *, int);
+extern void iotable_init_novmreserve(struct map_desc *, int);
extern void vm_reserve_area_early(unsigned long addr, unsigned long size,
void *caller);
@@ -56,6 +57,7 @@ extern int ioremap_page(unsigned long virt, unsigned long phys,
const struct mem_type *mtype);
#else
#define iotable_init(map,num) do { } while (0)
+#define iotable_init_novmreserve(map,num) do { } while(0)
#define vm_reserve_area_early(a,s,c) do { } while (0)
#endif
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index f61a570..c4c9f4b 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -470,7 +470,7 @@ void __init dma_contiguous_remap(void)
addr += PMD_SIZE)
pmd_clear(pmd_off_k(addr));
- iotable_init(&map, 1);
+ iotable_init_novmreserve(&map, 1);
}
}
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index f123d6e..ad92d4f 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -84,14 +84,15 @@ struct static_vm *find_static_vm_vaddr(void *vaddr)
return NULL;
}
-void __init add_static_vm_early(struct static_vm *svm)
+void __init add_static_vm_early(struct static_vm *svm, bool add_to_vm)
{
struct static_vm *curr_svm;
struct vm_struct *vm;
void *vaddr;
vm = &svm->vm;
- vm_area_add_early(vm);
+ if (add_to_vm)
+ vm_area_add_early(vm);
vaddr = vm->addr;
list_for_each_entry(curr_svm, &static_vmlist, list) {
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index d5a982d..6f9d28b 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -75,7 +75,7 @@ struct static_vm {
extern struct list_head static_vmlist;
extern struct static_vm *find_static_vm_vaddr(void *vaddr);
-extern __init void add_static_vm_early(struct static_vm *svm);
+extern __init void add_static_vm_early(struct static_vm *svm, bool add_to_vm);
#endif
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 580ef2d..5450b43 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -819,7 +819,8 @@ static void __init create_mapping(struct map_desc *md)
/*
* Create the architecture specific mappings
*/
-void __init iotable_init(struct map_desc *io_desc, int nr)
+static void __init __iotable_init(struct map_desc *io_desc, int nr,
+ bool add_to_vm)
{
struct map_desc *md;
struct vm_struct *vm;
@@ -840,10 +841,20 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
vm->flags |= VM_ARM_MTYPE(md->type);
vm->caller = iotable_init;
- add_static_vm_early(svm++);
+ add_static_vm_early(svm++, add_to_vm);
}
}
+void __init iotable_init(struct map_desc *io_desc, int nr)
+{
+ return __iotable_init(io_desc, nr, true);
+}
+
+void __init iotable_init_novmreserve(struct map_desc *io_desc, int nr)
+{
+ return __iotable_init(io_desc, nr, false);
+}
+
void __init vm_reserve_area_early(unsigned long addr, unsigned long size,
void *caller)
{
@@ -857,7 +868,7 @@ void __init vm_reserve_area_early(unsigned long addr, unsigned long size,
vm->size = size;
vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING;
vm->caller = caller;
- add_static_vm_early(svm);
+ add_static_vm_early(svm, true);
}
#ifndef CONFIG_ARM_LPAE
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-01-02 21:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-02 21:53 [RFC PATCHv3 00/11] Intermix Lowmem and vmalloc Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 01/11] mce: acpi/apei: Use get_vm_area directly Laura Abbott
2014-01-03 2:33 ` Chen, Gong
2014-01-02 21:53 ` [RFC PATCHv3 02/11] iommu/omap: " Laura Abbott
2014-01-03 2:40 ` Chen, Gong
2014-01-02 21:53 ` [RFC PATCHv3 03/11] percpu: use VMALLOC_TOTAL instead of VMALLOC_END - VMALLOC_START Laura Abbott
2014-01-12 3:39 ` Tejun Heo
2014-01-02 21:53 ` [RFC PATCHv3 04/11] dm: Use VMALLOC_TOTAL instead of VMALLCO_END " Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 05/11] staging: lustre: Use is_vmalloc_addr Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 06/11] arm: use is_vmalloc_addr Laura Abbott
2014-01-02 22:13 ` Dave Hansen
2014-01-02 21:53 ` Laura Abbott [this message]
2014-01-02 21:53 ` [RFC PATCHv3 08/11] mm/vmalloc.c: Allow lowmem to be tracked in vmalloc Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 09/11] arm: mm: Track lowmem " Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 10/11] arm: Use for_each_potential_vmalloc_area Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 11/11] fs/proc/kcore.c: " Laura Abbott
2014-01-03 18:23 ` [RFC PATCHv3 00/11] Intermix Lowmem and vmalloc Dave Hansen
2014-01-03 22:08 ` Laura Abbott
2014-01-04 7:31 ` Minchan Kim
2014-01-06 19:08 ` Laura Abbott
2014-01-08 2:52 ` Minchan Kim
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=1388699609-18214-8-git-send-email-lauraa@codeaurora.org \
--to=lauraa@codeaurora.org \
--cc=akpm@linux-foundation.org \
--cc=dave@sr71.net \
--cc=kmpark@infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@arm.linux.org.uk \
/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).