x86: unify kmap_atomic_pfn() and iomap_atomic_prot_pfn()
Subsystems (7)
PATCH 1/2 x86: unify kmap_atomic_pfn() and iomap_atomic_prot_pfn()
kmap_atomic_pfn() and iomap_atomic_prot_pfn() are almost same except pgprot. This patch removes the code duplication for these two functions.
--- arch/x86/include/asm/highmem.h | 1 + arch/x86/mm/highmem_32.c | 17 +++++++++++------ arch/x86/mm/iomap_32.c | 13 ++----------- 3 files changed, 14 insertions(+), 17 deletions(-)
arch/x86/include/asm/highmem.h +1 -0
@@ -63,6 +63,7 @@ void *kmap_atomic_prot(struct page *pagevoid *kmap_atomic (struct page *page,enum km_type type);void kunmap_atomic (void *kvaddr,enum km_type type);void *kmap_atomic_pfn (unsigned long pfn,enum km_type type); +void *kmap_atomic_prot_pfn (unsigned long pfn,enum km_type type,pgprot_t prot);struct page *kmap_atomic_to_page (void *ptr);#ifndef CONFIG_PARAVIRT
arch/x86/mm/highmem_32.c +11 -6
@@ -121,23 +121,28 @@ void kunmap_atomic(void *kvaddr, enum kmpagefault_enable (); } -/* This is the same as kmap_atomic() but can map memory that doesn't -* have a struct page associated with it. -*/ -void *kmap_atomic_pfn (unsigned long pfn,enum km_type type) +void *kmap_atomic_prot_pfn (unsigned long pfn,enum km_type type,pgprot_t prot) {enum fixed_addresses idx;unsigned long vaddr;pagefault_disable (); - idx = type +KM_TYPE_NR *smp_processor_id (); + idx = type +KM_TYPE_NR *smp_processor_id (); vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx); -set_pte (kmap_pte-idx,pfn_pte (pfn, kmap_prot)); +set_pte (kmap_pte - idx,pfn_pte (pfn, prot));arch_flush_lazy_mmu_mode ();return (void *) vaddr; } + +/* This is the same as kmap_atomic() but can map memory that doesn't +* have a struct page associated with it. +*/ +void *kmap_atomic_pfn (unsigned long pfn,enum km_type type) +{ +return kmap_atomic_prot_pfn (pfn, type, kmap_prot); +}EXPORT_SYMBOL_GPL (kmap_atomic_pfn);/* temporarily in use by i915 GEM until vmap */ struct page *kmap_atomic_to_page (void *ptr)
arch/x86/mm/iomap_32.c +2 -11
@@ -18,6 +18,7 @@#include <asm/iomap.h> #include <asm/pat.h> +#include <asm/highmem.h> #include <linux/module.h> int is_io_mapping_possible (resource_size_t base,unsigned long size)
@@ -36,11 +37,6 @@ EXPORT_SYMBOL_GPL(is_io_mapping_possiblevoid *iomap_atomic_prot_pfn (unsigned long pfn,enum km_type type,pgprot_t prot) { -enum fixed_addresses idx; -unsigned long vaddr; - -pagefault_disable (); -/* * For non-PAT systems, promote PAGE_KERNEL_WC to PAGE_KERNEL_UC_MINUS. * PAGE_KERNEL_WC maps to PWT, which translates to uncached if the
@@ -50,12 +46,7 @@ iomap_atomic_prot_pfn(unsigned long pfn,if (!pat_enabled &&pgprot_val (prot) ==pgprot_val (PAGE_KERNEL_WC )) prot =PAGE_KERNEL_UC_MINUS ; - idx = type +KM_TYPE_NR *smp_processor_id (); - vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx); -set_pte (kmap_pte-idx,pfn_pte (pfn, prot)); -arch_flush_lazy_mmu_mode (); - -return (void *) vaddr; +return kmap_atomic_prot_pfn (pfn, type, prot); }EXPORT_SYMBOL_GPL (iomap_atomic_prot_pfn);
PATCH 2/2 x86: debug check for kmap_atomic_pfn and iomap_atomic_prot_pfn()
It may be useful for kmap_atomic_pfn() and iomap_atomic_prot_pfn() to check invalid kmap usage as well as kmap_atomic.
--- arch/x86/mm/highmem_32.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/mm/highmem_32.c +2 -0
@@ -128,6 +128,8 @@ void *kmap_atomic_prot_pfn(unsigned longpagefault_disable (); +debug_kmap_atomic_prot (type); + idx = type +KM_TYPE_NR *smp_processor_id (); vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx);set_pte (kmap_pte - idx,pfn_pte (pfn, prot));
[tip:x86/mm] x86: debug check for kmap_atomic_pfn and iomap_atomic_prot_pfn()
Commit-ID: 12074fa1073013dd11f1cff41db018d5cff4ecd9 Gitweb: http://git.kernel.org/tip/12074fa1073013dd11f1cff41db018d5cff4ecd9 Author: "Akinobu Mita" <[email protected]> AuthorDate: Wed, 11 Mar 2009 23:34:50 +0900 Commit: Ingo Molnar <[email protected]> CommitDate: Wed, 11 Mar 2009 15:47:46 +0100
x86: debug check for kmap_atomic_pfn and iomap_atomic_prot_pfn()
It may be useful for kmap_atomic_pfn() and iomap_atomic_prot_pfn() to check invalid kmap usage as well as kmap_atomic.
LKML-Reference: <[email protected]>
--- arch/x86/mm/highmem_32.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/mm/highmem_32.c +2 -0
@@ -128,6 +128,8 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)pagefault_disable (); +debug_kmap_atomic_prot (type); + idx = type +KM_TYPE_NR *smp_processor_id (); vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx);set_pte (kmap_pte - idx,pfn_pte (pfn, prot));
Quoted 2 lines · Akinobu Mita
kmap_atomic_pfn()andiomap_atomic_prot_pfn()are almost same except pgprot. This patch removes the code duplication for these two functions.
How exaclty does this compile with CONFIG_HIGHMEM=n ?
Thanks,
tglx
2009/3/12 Thomas Gleixner <[email protected]>:
Quoted 6 lines · Akinobu Mita
Quoted 2 lines
kmap_atomic_pfn()andiomap_atomic_prot_pfn()are almost same except pgprot. This patch removes the code duplication for these two functions.How exaclty does this compile with
CONFIG_HIGHMEM=n?
Oh, I didn't try without CONFIG_HIGHMEM.
Quoted 9 lines · Akinobu Mita
2009/3/12 Thomas Gleixner <[email protected]>:
Quoted 6 lines · Akinobu Mita
Quoted 2 lines
kmap_atomic_pfn()andiomap_atomic_prot_pfn()are almost same except pgprot. This patch removes the code duplication for these two functions.How exaclty does this compile with
CONFIG_HIGHMEM=n?Oh, I didn't try without
CONFIG_HIGHMEM.
i had it applied in testing locally and didnt see problems so far. Let me know if you can see any problems.
Ingo
2009/3/12 Ingo Molnar <[email protected]>:
Quoted 8 lines · Akinobu Mita
Quoted 6 lines
2009/3/12 Thomas Gleixner <[email protected]>:
Quoted 4 lines · Akinobu Mita
Quoted 2 lines
kmap_atomic_pfn()andiomap_atomic_prot_pfn()are almost same except pgprot. This patch removes the code duplication for these two functions.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
How exaclty does this compile with
CONFIG_HIGHMEM=n?Oh, I didn't try without
CONFIG_HIGHMEM.i had it applied in testing locally and didnt see problems so far. Let me know if you can see any problems.
It actually didn't compile with CONFIG_HIGHMEM=n as Thomas pointed out.
arch/x86/mm/iomap_32.c:49: undefined reference to `kmap_atomic_prot_pfn'
So please revert 1/2 and 2/2. However, I still think 2/2 is usefull and I'll submit it in other form.
Quoted 14 lines · Akinobu Mita
2009/3/12 Ingo Molnar <[email protected]>:
Quoted 13 lines · Akinobu Mita
Quoted 10 lines
2009/3/12 Thomas Gleixner <[email protected]>:
Quoted 6 lines · Akinobu Mita
Quoted 2 lines
kmap_atomic_pfn()andiomap_atomic_prot_pfn()are almost same except pgprot. This patch removes the code duplication for these two functions.How exaclty does this compile with
CONFIG_HIGHMEM=n?Oh, I didn't try without
CONFIG_HIGHMEM.
Quoted 8 lines
Quoted 2 lines
i had it applied in testing locally and didnt see problems so far. Let me know if you can see any problems.
It actually didn't compile with
CONFIG_HIGHMEM=nas Thomas pointed out.
arch/x86/mm/iomap_32.c:49: undefined reference to
`kmap_atomic_prot_pfn'
hm, i didnt see any build failures myself. Could you please send the .config that triggers it?
Ingo
Quoted 8 lines · Ingo Molnar
Quoted 5 lines
It actually didn't compile with
CONFIG_HIGHMEM=nas Thomas pointed out.
arch/x86/mm/iomap_32.c:49: undefined reference to
`kmap_atomic_prot_pfn'hm, i didnt see any build failures myself. Could you please send the .config that triggers it?
got it now. Somehow randconfig does not find that combo.
Ingo
Commit-ID: bb6d59ca927d855ffac567b35c0a790c67016103 Gitweb: http://git.kernel.org/tip/bb6d59ca927d855ffac567b35c0a790c67016103 Author: "Akinobu Mita" <[email protected]> AuthorDate: Wed, 11 Mar 2009 23:33:18 +0900 Commit: Ingo Molnar <[email protected]> CommitDate: Wed, 11 Mar 2009 15:47:46 +0100
x86: unify kmap_atomic_pfn() and iomap_atomic_prot_pfn()
kmap_atomic_pfn() and iomap_atomic_prot_pfn() are almost same except pgprot. This patch removes the code duplication for these two functions.
LKML-Reference: <[email protected]>
--- arch/x86/include/asm/highmem.h | 1 + arch/x86/mm/highmem_32.c | 17 +++++++++++------ arch/x86/mm/iomap_32.c | 13 ++----------- 3 files changed, 14 insertions(+), 17 deletions(-)
arch/x86/include/asm/highmem.h +1 -0
@@ -63,6 +63,7 @@ void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot);void *kmap_atomic (struct page *page,enum km_type type);void kunmap_atomic (void *kvaddr,enum km_type type);void *kmap_atomic_pfn (unsigned long pfn,enum km_type type); +void *kmap_atomic_prot_pfn (unsigned long pfn,enum km_type type,pgprot_t prot);struct page *kmap_atomic_to_page (void *ptr);#ifndef CONFIG_PARAVIRT
arch/x86/mm/highmem_32.c +11 -6
@@ -121,23 +121,28 @@ void kunmap_atomic(void *kvaddr, enum km_type type)pagefault_enable (); } -/* This is the same as kmap_atomic() but can map memory that doesn't -* have a struct page associated with it. -*/ -void *kmap_atomic_pfn (unsigned long pfn,enum km_type type) +void *kmap_atomic_prot_pfn (unsigned long pfn,enum km_type type,pgprot_t prot) {enum fixed_addresses idx;unsigned long vaddr;pagefault_disable (); - idx = type +KM_TYPE_NR *smp_processor_id (); + idx = type +KM_TYPE_NR *smp_processor_id (); vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx); -set_pte (kmap_pte-idx,pfn_pte (pfn, kmap_prot)); +set_pte (kmap_pte - idx,pfn_pte (pfn, prot));arch_flush_lazy_mmu_mode ();return (void *) vaddr; } + +/* This is the same as kmap_atomic() but can map memory that doesn't +* have a struct page associated with it. +*/ +void *kmap_atomic_pfn (unsigned long pfn,enum km_type type) +{ +return kmap_atomic_prot_pfn (pfn, type, kmap_prot); +}EXPORT_SYMBOL_GPL (kmap_atomic_pfn);/* temporarily in use by i915 GEM until vmap */ struct page *kmap_atomic_to_page (void *ptr)
arch/x86/mm/iomap_32.c +2 -11
@@ -18,6 +18,7 @@#include <asm/iomap.h> #include <asm/pat.h> +#include <asm/highmem.h> #include <linux/module.h> int is_io_mapping_possible (resource_size_t base,unsigned long size)
@@ -36,11 +37,6 @@ EXPORT_SYMBOL_GPL(is_io_mapping_possible);void *iomap_atomic_prot_pfn (unsigned long pfn,enum km_type type,pgprot_t prot) { -enum fixed_addresses idx; -unsigned long vaddr; - -pagefault_disable (); -/* * For non-PAT systems, promote PAGE_KERNEL_WC to PAGE_KERNEL_UC_MINUS. * PAGE_KERNEL_WC maps to PWT, which translates to uncached if the
@@ -50,12 +46,7 @@ iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)if (!pat_enabled &&pgprot_val (prot) ==pgprot_val (PAGE_KERNEL_WC )) prot =PAGE_KERNEL_UC_MINUS ; - idx = type +KM_TYPE_NR *smp_processor_id (); - vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx); -set_pte (kmap_pte-idx,pfn_pte (pfn, prot)); -arch_flush_lazy_mmu_mode (); - -return (void *) vaddr; +return kmap_atomic_prot_pfn (pfn, type, prot); }EXPORT_SYMBOL_GPL (iomap_atomic_prot_pfn);
[tip:x86/mm] x86: unify kmap_atomic_pfn() and iomap_atomic_prot_pfn(), fix
In reply to Akinobu MitaCommit-ID: dd63fdcc63f0f853b116b52e56200a0e0227cf5f Gitweb: http://git.kernel.org/tip/dd63fdcc63f0f853b116b52e56200a0e0227cf5f Author: Ingo Molnar <[email protected]> AuthorDate: Fri, 13 Mar 2009 03:20:49 +0100 Commit: Ingo Molnar <[email protected]> CommitDate: Fri, 13 Mar 2009 03:24:53 +0100
x86: unify kmap_atomic_pfn() and iomap_atomic_prot_pfn(), fix
Impact: build fix
Move kmap_atomic_prot_pfn() to iomap_32.c. It is used on all 32-bit kernels, while highmem_32.c is only built on highmem kernels.
( Note: the debug_kmap_atomic_prot() check is removed for now, that
problem is handled via another patch. )
LKML-Reference: <[email protected]>
--- arch/x86/mm/highmem_32.c | 20 ++------------------ arch/x86/mm/iomap_32.c | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 19 deletions(-)
arch/x86/mm/highmem_32.c +2 -18
@@ -121,24 +121,8 @@ void kunmap_atomic(void *kvaddr, enum km_type type)pagefault_enable (); } -void *kmap_atomic_prot_pfn (unsigned long pfn,enum km_type type,pgprot_t prot) -{ -enum fixed_addresses idx; -unsigned long vaddr; - -pagefault_disable (); - -debug_kmap_atomic_prot (type); - - idx = type +KM_TYPE_NR *smp_processor_id (); - vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx); -set_pte (kmap_pte - idx,pfn_pte (pfn, prot)); -arch_flush_lazy_mmu_mode (); - -return (void *) vaddr; -} - -/* This is the same as kmap_atomic() but can map memory that doesn't +/* +* This is the same as kmap_atomic() but can map memory that doesn't * have a struct page associated with it. */ void *kmap_atomic_pfn (unsigned long pfn,enum km_type type)
arch/x86/mm/iomap_32.c +17 -1
@@ -32,7 +32,23 @@ int is_io_mapping_possible(resource_size_t base, unsigned long size) }EXPORT_SYMBOL_GPL (is_io_mapping_possible); -/* Map 'pfn' using fixed map 'type' and protections 'prot' +void *kmap_atomic_prot_pfn (unsigned long pfn,enum km_type type,pgprot_t prot) +{ +enum fixed_addresses idx; +unsigned long vaddr; + +pagefault_disable (); + + idx = type +KM_TYPE_NR *smp_processor_id (); + vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx); +set_pte (kmap_pte - idx,pfn_pte (pfn, prot)); +arch_flush_lazy_mmu_mode (); + +return (void *)vaddr; +} + +/* +* Map 'pfn' using fixed map 'type' and protections 'prot' */ void *iomap_atomic_prot_pfn (unsigned long pfn,enum km_type type,pgprot_t prot)
PATCH 1/2 mm: introduce debug_kmap_atomic
Quoted 6 lines · Ingo Molnar
x86: unify
kmap_atomic_pfn()andiomap_atomic_prot_pfn(), fixImpact: build fix
Move
kmap_atomic_prot_pfn()toiomap_32.c. It is used on all 32-bit kernels, whilehighmem_32.cis only built on highmem kernels.
Thanks for fixing that.
Quoted 2 lines
( Note: the
debug_kmap_atomic_prot()check is removed for now, that
problem is handled via another patch. )
The patches are now sitting in -mmotm now. For -tip, here are the rebased patches for the debug_kmap_atomic_prot() check.
Subject: mm: introduce debug_kmap_atomic
From: Akinobu Mita <[email protected]>
x86 has debug_kmap_atomic_prot() which is error checking function for kmap_atomic. It is usefull for the other architectures, although it needs CONFIG_TRACE_IRQFLAGS_SUPPORT.
This patch exposes it to the other architectures.
--- arch/x86/mm/highmem_32.c | 45 +-------------------------------------------- include/linux/highmem.h | 12 ++++++++++++ mm/highmem.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 44 deletions(-)
arch/x86/mm/highmem_32.c +1 -44
@@ -19,49 +19,6 @@ void kunmap(struct page *page)kunmap_high (page); } -static void debug_kmap_atomic_prot (enum km_type type) -{ -#ifdef CONFIG_DEBUG_HIGHMEM -static unsigned warn_count =10 ; - -if (unlikely (warn_count ==0 )) -return ; - -if (unlikely (in_interrupt ())) { -if (in_irq ()) { -if (type !=KM_IRQ0 && type !=KM_IRQ1 && - type !=KM_BIO_SRC_IRQ && type !=KM_BIO_DST_IRQ && - type !=KM_BOUNCE_READ ) { -WARN_ON (1 ); - warn_count--; - } - }else if (!irqs_disabled ()) {/* softirq */ -if (type !=KM_IRQ0 && type !=KM_IRQ1 && - type !=KM_SOFTIRQ0 && type !=KM_SOFTIRQ1 && - type !=KM_SKB_SUNRPC_DATA && - type !=KM_SKB_DATA_SOFTIRQ && - type !=KM_BOUNCE_READ ) { -WARN_ON (1 ); - warn_count--; - } - } - } - -if (type ==KM_IRQ0 || type ==KM_IRQ1 || type ==KM_BOUNCE_READ || - type ==KM_BIO_SRC_IRQ || type ==KM_BIO_DST_IRQ ) { -if (!irqs_disabled ()) { -WARN_ON (1 ); - warn_count--; - } - }else if (type ==KM_SOFTIRQ0 || type ==KM_SOFTIRQ1 ) { -if (irq_count () ==0 && !irqs_disabled ()) { -WARN_ON (1 ); - warn_count--; - } - } -#endif -} -/* * kmap_atomic/kunmap_atomic is significantly faster than kmap/kunmap because * no global lock is needed and because the kmap code must perform a global TLB
@@ -81,7 +38,7 @@ void *kmap_atomic_prot(struct page *pageif (!PageHighMem (page))return page_address (page); -debug_kmap_atomic_prot (type); +debug_kmap_atomic (type); idx = type +KM_TYPE_NR *smp_processor_id (); vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx);
include/linux/highmem.h +12 -0
@@ -187,4 +187,16 @@ static inline void copy_highpage(struct kunmap_atomic(vto, KM_USER1); } +#if defined(CONFIG_DEBUG_HIGHMEM ) && defined(CONFIG_TRACE_IRQFLAGS_SUPPORT ) + +void debug_kmap_atomic (enum km_type type); + +#else + +static inline void debug_kmap_atomic (enum km_type type) +{ +} + +#endif +#endif /* _LINUX_HIGHMEM_H */
mm/highmem.c +45 -0
48 lines not on this page · raw message
PATCH 2/2 mm: use debug_kmap_atomic
Subject: mm: use debug_kmap_atomic
From: Akinobu Mita <[email protected]>
Use debug_kmap_atomic in kmap_atomic, kmap_atomic_pfn, kmap_atomic_prot and iomap_atomic_prot_pfn.
--- arch/mips/mm/highmem.c | 2 ++ arch/powerpc/include/asm/highmem.h | 2 ++ arch/sparc/mm/highmem.c | 1 + arch/x86/mm/iomap_32.c | 3 ++- include/asm-frv/highmem.h | 2 ++ include/asm-mn10300/highmem.h | 2 ++ 6 files changed, 11 insertions(+), 1 deletion(-)
arch/mips/mm/highmem.c +2 -0
@@ -43,6 +43,7 @@ void *__kmap_atomic(struct page *page, eif (!PageHighMem (page))return page_address (page); +debug_kmap_atomic (type); idx = type +KM_TYPE_NR *smp_processor_id (); vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx);#ifdef CONFIG_DEBUG_HIGHMEM
@@ -91,6 +92,7 @@ void *kmap_atomic_pfn(unsigned long pfn,pagefault_disable (); +debug_kmap_atomic (type); idx = type +KM_TYPE_NR *smp_processor_id (); vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx);set_pte (kmap_pte-idx,pfn_pte (pfn, kmap_prot));
arch/powerpc/include/asm/highmem.h +2 -0
@@ -24,6 +24,7 @@#include <linux/init.h> #include <linux/interrupt.h> +#include <linux/highmem.h> #include <asm/kmap_types.h> #include <asm/tlbflush.h> #include <asm/page.h>
@@ -94,6 +95,7 @@ static inline void *kmap_atomic_prot(strif (!PageHighMem (page))return page_address (page); +debug_kmap_atomic (type); idx = type +KM_TYPE_NR *smp_processor_id (); vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx);#ifdef CONFIG_DEBUG_HIGHMEM
arch/sparc/mm/highmem.c +1 -0
@@ -39,6 +39,7 @@ void *kmap_atomic(struct page *page, enuif (!PageHighMem (page))return page_address (page); +debug_kmap_atomic (type); idx = type +KM_TYPE_NR *smp_processor_id (); vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx);
arch/x86/mm/iomap_32.c +2 -1
@@ -18,8 +18,8 @@#include <asm/iomap.h> #include <asm/pat.h> -#include <asm/highmem.h> #include <linux/module.h> +#include <linux/highmem.h> int is_io_mapping_possible (resource_size_t base,unsigned long size) {
@@ -39,6 +39,7 @@ void *kmap_atomic_prot_pfn(unsigned longpagefault_disable (); +debug_kmap_atomic (type); idx = type +KM_TYPE_NR *smp_processor_id (); vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx);set_pte (kmap_pte - idx,pfn_pte (pfn, prot));
include/asm-frv/highmem.h +2 -0
@@ -18,6 +18,7 @@#ifdef __KERNEL__#include <linux/init.h> +#include <linux/highmem.h> #include <asm/mem-layout.h> #include <asm/spr-regs.h> #include <asm/mb-regs.h>
@@ -116,6 +117,7 @@ static inline void *kmap_atomic(struct punsigned long paddr;pagefault_disable (); +debug_kmap_atomic (type); paddr =page_to_phys (page);switch (type) {
include/asm-mn10300/highmem.h +2 -0
@@ -16,6 +16,7 @@#include <linux/init.h> #include <linux/interrupt.h> +#include <linux/highmem.h> #include <asm/kmap_types.h> #include <asm/pgtable.h>
@@ -77,6 +78,7 @@ static inline unsigned long kmap_atomic(if (page < highmem_start_page)return page_address (page); +debug_kmap_atomic (type); idx = type +KM_TYPE_NR *smp_processor_id (); vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx);#if HIGHMEM_DEBUG
Re: [PATCH -tip 1/2] mm: introduce debug_kmap_atomic
In reply to Akinobu MitaQuoted 8 lines · Akinobu Mita
Quoted 6 lines · Ingo Molnar
x86: unify
kmap_atomic_pfn()andiomap_atomic_prot_pfn(), fixImpact: build fix
Move
kmap_atomic_prot_pfn()toiomap_32.c. It is used on all 32-bit kernels, whilehighmem_32.cis only built on highmem kernels.
Quoted 7 lines
Thanks for fixing that.
Quoted 2 lines
( Note: the
debug_kmap_atomic_prot()check is removed for now, that
problem is handled via another patch. )The patches are now sitting in -mmotm now. For -tip, here are the rebased patches for the
debug_kmap_atomic_prot()check.
Due to the other-arch changes it's better to keep them in -mm i guess. Once the current batch goes out to linux-next (in the next few days) Andrew could pick up the two -tip patches you posted here.
Ingo
Re: [PATCH -tip 1/2] mm: introduce debug_kmap_atomic
Quoted 7 lines · Ingo Molnar
Quoted 2 lines
The patches are now sitting in -mmotm now. For -tip, here are the rebased patches for the
debug_kmap_atomic_prot()check.Due to the other-arch changes it's better to keep them in -mm i guess. Once the current batch goes out to linux-next (in the next few days) Andrew could pick up the two -tip patches you posted here.
OK, then please consider to apply this patch for now.
From: Akinobu Mita <[email protected]>
Subject: remove unnecessary include in iomap_32.c
asm/highmem.h inclusion is added to use kmap_atomic_prot_pfn() by commit bb6d59ca927d855ffac567b35c0a790c67016103
Now kmap_atomic_prot_pfn is moved to iomap_32.c by commit dd63fdcc63f0f853b116b52e56200a0e0227cf5f
So the asm/highmem.h inclusion in iomap_32.c is unnecessary now.
--- arch/x86/mm/iomap_32.c | 1 - 1 file changed, 1 deletion(-)
arch/x86/mm/iomap_32.c +0 -1
@@ -18,7 +18,6 @@#include <asm/iomap.h> #include <asm/pat.h> -#include <asm/highmem.h> #include <linux/module.h> int is_io_mapping_possible (resource_size_t base,unsigned long size)
[tip:x86/mm] x86, mm: remove unnecessary include file from iomap_32.c
Commit-ID: 0920dce7d5889634faa336f65833ee44f3b7651e Gitweb: http://git.kernel.org/tip/0920dce7d5889634faa336f65833ee44f3b7651e Author: Akinobu Mita <[email protected]> AuthorDate: Mon, 16 Mar 2009 00:15:18 +0900 Commit: Ingo Molnar <[email protected]> CommitDate: Sun, 15 Mar 2009 20:05:08 +0100
x86, mm: remove unnecessary include file from iomap_32.c
asm/highmem.h inclusion is added to use kmap_atomic_prot_pfn() by commit bb6d59ca927d855ffac567b35c0a790c67016103
Now kmap_atomic_prot_pfn is moved to iomap_32.c by commit dd63fdcc63f0f853b116b52e56200a0e0227cf5f
So the asm/highmem.h inclusion in iomap_32.c is unnecessary now.
LKML-Reference: <[email protected]>
--- arch/x86/mm/iomap_32.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
arch/x86/mm/iomap_32.c +0 -1
@@ -18,7 +18,6 @@#include <asm/iomap.h> #include <asm/pat.h> -#include <asm/highmem.h> #include <linux/module.h> int is_io_mapping_possible (resource_size_t base,unsigned long size)
Andrew Morton
maintainerRe: [PATCH -tip 1/2] mm: introduce debug_kmap_atomic
In reply to Ingo MolnarQuoted 16 lines · On Sat, 14 Mar 2009 14:15:55 +0100 Ingo Molnar <[email protected]> wrote:
Quoted 13 lines · Akinobu Mita
Quoted 6 lines · Ingo Molnar
x86: unify
kmap_atomic_pfn()andiomap_atomic_prot_pfn(), fixImpact: build fix
Move
kmap_atomic_prot_pfn()toiomap_32.c. It is used on all 32-bit kernels, whilehighmem_32.cis only built on highmem kernels.Thanks for fixing that.
Quoted 2 lines
( Note: the
debug_kmap_atomic_prot()check is removed for now, that
problem is handled via another patch. )
Quoted 7 lines
Quoted 2 lines
The patches are now sitting in -mmotm now. For -tip, here are the rebased patches for the
debug_kmap_atomic_prot()check.Due to the other-arch changes it's better to keep them in -mm i guess. Once the current batch goes out to linux-next (in the next few days) Andrew could pick up the two -tip patches you posted here.
I really don't know what's going on here.
Re: [PATCH -tip 1/2] mm: introduce debug_kmap_atomic
Quoted 1 line · Andrew Morton
I really don't know what's going on here.
Theare are two patches from me in -tip:
http://git.kernel.org/?p=linux/kernel/git/x86/linux-2.6-tip.git;a=commitdiff;h=bb6d59ca927d855ffac567b35c0a790c67016103
http://git.kernel.org/?p=linux/kernel/git/x86/linux-2.6-tip.git;a=commitdiff;h=dd63fdcc63f0f853b116b52e56200a0e0227cf5f
which may break -mmotm patches from me:
introduce-debug_kmap_atomic.patch
use-debug_kmap_atomic.patch
So please feel free to drop them if they cannot be applied. I'll resubmit them in that case.