THP fixes for ppc64
cover THP fixes for ppc64
Hi,
This patch series fixes machine check exception that we observed when using transparent huge page along with 4k hash pte on power bare metal platform. Patch "powerpc: mm: Use read barrier when creating real_pte" is not really related to thp, but was added in the series because it is fixing a related issue with 4k pte. That patch was not really needed to fix the MCE.
Aneesh Kumar K.V (8):
powerpc: thp: Add write barrier after updating the valid bit
powerpc: thp: don't recompute vsid and ssize in loop on invalidate
powerpc: thp: invalidate old 64K based hash page mapping before insert
of 4k pte
powerpc: thp: Handle combo pages in invalidate
powerpc: thp: inalidate with vpn in loop
powerpc: thp: use ACCESS_ONCE when loading pmdp
powerpc: mm: Use read barrier when creating real_pte
powerpc: thp: Add tracepoints to track hugepage invalidate
arch/powerpc/include/asm/machdep.h | 6 +-- arch/powerpc/include/asm/pgtable-ppc64.h | 2 +- arch/powerpc/include/asm/pte-hash64-64k.h | 27 ++++++++-- arch/powerpc/mm/hash_native_64.c | 40 ++++---------- arch/powerpc/mm/hugepage-hash64.c | 88 +++++++++++++++++++++++++++---- arch/powerpc/mm/pgtable_64.c | 44 ++++++++++------ arch/powerpc/mm/tlb_hash64.c | 6 ++- arch/powerpc/platforms/pseries/lpar.c | 20 +++---- include/trace/events/thp.h | 88 +++++++++++++++++++++++++++++++ 9 files changed, 242 insertions(+), 79 deletions(-) create mode 100644 include/trace/events/thp.h
-aneesh
PATCH 1/8 powerpc: thp: Add write barrier after updating the valid bit
With hugepages, we store the hpte valid information in the pte page whose address is stored in the second half of the PMD. Use a write barrier to make sure clearing pmd busy bit and updating hpte valid info are ordered properly.
--- arch/powerpc/mm/hugepage-hash64.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/powerpc/mm/hugepage-hash64.c +4 -1
@@ -172,8 +172,11 @@ repeat:mark_hpte_slot_valid (hpte_slot_array, index, slot); }/* -* No need to use ldarx/stdcx here +* The hpte valid is stored in the pgtable whose address is in the +* second half of the PMD. Order this against clearing of the busy bit in +* huge pmd. */ +smp_wmb (); *pmdp =__pmd (new_pmd & ~_PAGE_BUSY);return 0 ; }
Signature · 1 line
1.9.1
PATCH 2/8 powerpc: thp: don't recompute vsid and ssize in loop on invalidate
In reply to Aneesh Kumar K.VThe segment identifier and segment size will remain the same in the loop, So we can compute it outside. We also change the hugepage_invalidate interface so that we can use it the later patch
--- arch/powerpc/include/asm/machdep.h | 6 +++--- arch/powerpc/mm/hash_native_64.c | 19 +++++-------------- arch/powerpc/mm/pgtable_64.c | 24 ++++++++++++------------ arch/powerpc/platforms/pseries/lpar.c | 20 ++++++-------------- 4 files changed, 26 insertions(+), 43 deletions(-)
arch/powerpc/include/asm/machdep.h +3 -3
@@ -57,10 +57,10 @@ struct machdep_calls {void (*hpte_removebolted)(unsigned long ea,int psize,int ssize);void (*flush_hash_range)(unsigned long number,int local); -void (*hugepage_invalidate)(struct mm_struct *mm, +void (*hugepage_invalidate)(unsigned long vsid, +unsigned long addr,unsigned char *hpte_slot_array, -unsigned long addr,int psize); - +int psize,int ssize);/* special for kexec, to be called in real mode, linear mapping is * destroyed as well */ void (*hpte_clear_all)(void );
arch/powerpc/mm/hash_native_64.c +5 -14
@@ -412,18 +412,18 @@ static void native_hpte_invalidate(unsigned long slot, unsigned long vpn,local_irq_restore (flags); } -static void native_hugepage_invalidate (struct mm_struct *mm, +static void native_hugepage_invalidate (unsigned long vsid, +unsigned long addr,unsigned char *hpte_slot_array, -unsigned long addr,int psize) +int psize,int ssize) { -int ssize =0 , i; -int lock_tlbie; +int i, lock_tlbie;struct hash_pte *hptep;int actual_psize =MMU_PAGE_16M ;unsigned int max_hpte_count, valid;unsigned long flags, s_addr = addr;unsigned long hpte_v, want_v, shift; -unsigned long hidx, vpn =0 , vsid, hash, slot; +unsigned long hidx, vpn =0 , hash, slot; shift = mmu_psize_defs[psize].shift; max_hpte_count =1U << (PMD_SHIFT - shift);
@@ -437,15 +437,6 @@ static void native_hugepage_invalidate(struct mm_struct *mm,/* get the vpn */ addr = s_addr + (i * (1ul << shift)); -if (!is_kernel_addr (addr)) { - ssize =user_segment_size (addr); - vsid =get_vsid (mm->context.id, addr, ssize); -WARN_ON (vsid ==0 ); - }else { - vsid =get_kernel_vsid (addr, mmu_kernel_ssize); - ssize = mmu_kernel_ssize; - } - vpn =hpt_vpn (addr, vsid, ssize); hash =hpt_hash (vpn, shift, ssize);if (hidx & _PTEIDX_SECONDARY)
arch/powerpc/mm/pgtable_64.c +12 -12
@@ -745,12 +745,21 @@ void hpte_do_hugepage_flush(struct mm_struct *mm, unsigned long addr,if (!hpte_slot_array)return ; -/* get the base page size */ +/* get the base page size,vsid and segment size */ psize =get_slice_psize (mm, s_addr); +if (!is_kernel_addr (s_addr)) { + ssize =user_segment_size (s_addr); + vsid =get_vsid (mm->context.id, s_addr, ssize); +WARN_ON (vsid ==0 ); + }else { + vsid =get_kernel_vsid (s_addr, mmu_kernel_ssize); + ssize = mmu_kernel_ssize; + }if (ppc_md.hugepage_invalidate) -return ppc_md.hugepage_invalidate (mm, hpte_slot_array, - s_addr, psize); +return ppc_md.hugepage_invalidate (vsid, s_addr, + hpte_slot_array, + psize, ssize);/* * No bluk hpte removal support, invalidate each entry */
@@ -768,15 +777,6 @@ void hpte_do_hugepage_flush(struct mm_struct *mm, unsigned long addr,/* get the vpn */ addr = s_addr + (i * (1ul << shift)); -if (!is_kernel_addr (addr)) { - ssize =user_segment_size (addr); - vsid =get_vsid (mm->context.id, addr, ssize); -WARN_ON (vsid ==0 ); - }else { - vsid =get_kernel_vsid (addr, mmu_kernel_ssize); - ssize = mmu_kernel_ssize; - } - vpn =hpt_vpn (addr, vsid, ssize); hash =hpt_hash (vpn, shift, ssize);if (hidx & _PTEIDX_SECONDARY)
arch/powerpc/platforms/pseries/lpar.c +6 -14
@@ -430,16 +430,17 @@ static void __pSeries_lpar_hugepage_invalidate(unsigned long *slot,spin_unlock_irqrestore (&pSeries_lpar_tlbie_lock, flags); } -static void pSeries_lpar_hugepage_invalidate (struct mm_struct *mm, -unsigned char *hpte_slot_array, -unsigned long addr,int psize) +static void pSeries_lpar_hugepage_invalidate (unsigned long vsid, +unsigned long addr, +unsigned char *hpte_slot_array, +int psize,int ssize) { -int ssize =0 , i, index =0 ; +int i, index =0 ;unsigned long s_addr = addr;unsigned int max_hpte_count, valid;unsigned long vpn_array[PPC64_HUGE_HPTE_BATCH ];unsigned long slot_array[PPC64_HUGE_HPTE_BATCH ]; -unsigned long shift, hidx, vpn =0 , vsid, hash, slot; +unsigned long shift, hidx, vpn =0 , hash, slot; shift = mmu_psize_defs[psize].shift; max_hpte_count =1U << (PMD_SHIFT - shift);
@@ -452,15 +453,6 @@ static void pSeries_lpar_hugepage_invalidate(struct mm_struct *mm,/* get the vpn */ addr = s_addr + (i * (1ul << shift)); -if (!is_kernel_addr (addr)) { - ssize =user_segment_size (addr); - vsid =get_vsid (mm->context.id, addr, ssize); -WARN_ON (vsid ==0 ); - }else { - vsid =get_kernel_vsid (addr, mmu_kernel_ssize); - ssize = mmu_kernel_ssize; - } - vpn =hpt_vpn (addr, vsid, ssize); hash =hpt_hash (vpn, shift, ssize);if (hidx & _PTEIDX_SECONDARY)
Signature · 1 line
1.9.1
PATCH 3/8 powerpc: thp: invalidate old 64K based hash page mapping before insert of 4k pte
In reply to Aneesh Kumar K.VIf we changed base page size of the segment, either via sub_page_protect or via remap_4k_pfn, we do a demote_segment which doesn't flush the hash table entries. We do a lazy hash page table flush for all mapped pages in the demoted segment. This happens when we handle hash page fault for these pages.
We use _PAGE_COMBO bit along with _PAGE_HASHPTE to indicate whether a pte is backed by 4K hash pte. If we find _PAGE_COMBO not set on the pte, that implies that we could possibly have older 64K hash pte entries in the hash page table and we need to invalidate those entries.
Handle this correctly for 16M pages
--- arch/powerpc/mm/hugepage-hash64.c | 79 ++++++++++++++++++++++++++++++++++----- 1 file changed, 70 insertions(+), 9 deletions(-)
arch/powerpc/mm/hugepage-hash64.c +70 -9
@@ -18,6 +18,57 @@#include <linux/mm.h> #include <asm/machdep.h> +static void invalidate_old_hpte (unsigned long vsid,unsigned long addr, +pmd_t *pmdp,unsigned int psize,int ssize) +{ +int i, max_hpte_count, valid; +unsigned long s_addr; +unsigned char *hpte_slot_array; +unsigned long hidx, shift, vpn, hash, slot; + + s_addr = addr &HPAGE_PMD_MASK ; + hpte_slot_array =get_hpte_slot_array (pmdp); +/* +* IF we try to do a HUGE PTE update after a withdraw is done. +* we will find the below NULL. This happens when we do +* split_huge_page_pmd +*/ +if (!hpte_slot_array) +return ; + +if (ppc_md.hugepage_invalidate) +return ppc_md.hugepage_invalidate (vsid, s_addr, hpte_slot_array, + psize, ssize); +/* +* No bluk hpte removal support, invalidate each entry +*/ + shift = mmu_psize_defs[psize].shift; + max_hpte_count =HPAGE_PMD_SIZE >> shift; +for (i =0 ; i < max_hpte_count; i++) { +/* +* 8 bits per each hpte entries +* 000| [ secondary group (one bit) | hidx (3 bits) | valid bit] +*/ + valid =hpte_valid (hpte_slot_array, i); +if (!valid) +continue ; + hidx =hpte_hash_index (hpte_slot_array, i); + +/* get the vpn */ + addr = s_addr + (i * (1ul << shift)); + vpn =hpt_vpn (addr, vsid, ssize); + hash =hpt_hash (vpn, shift, ssize); +if (hidx & _PTEIDX_SECONDARY) + hash = ~hash; + + slot = (hash & htab_hash_mask) *HPTES_PER_GROUP ; + slot += hidx & _PTEIDX_GROUP_IX; + ppc_md.hpte_invalidate (slot, vpn, psize, +MMU_PAGE_16M , ssize,0 ); + } +} + +int __hash_page_thp (unsigned long ea,unsigned long access,unsigned long vsid,pmd_t *pmdp,unsigned long trap,int local,int ssize,unsigned int psize)
@@ -85,6 +136,15 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid, vpn =hpt_vpn (ea, vsid, ssize); hash =hpt_hash (vpn, shift, ssize); hpte_slot_array =get_hpte_slot_array (pmdp); +if (psize ==MMU_PAGE_4K ) { +/* +* invalidate the old hpte entry if we have that mapped via 64K +* base page size. This is because demote_segment won't flush +* hash page table entries. +*/ +if ((old_pmd & _PAGE_HASHPTE) && !(old_pmd & _PAGE_COMBO)) +invalidate_old_hpte (vsid, ea, pmdp,MMU_PAGE_64K , ssize); + } valid =hpte_valid (hpte_slot_array, index);if (valid) {
@@ -107,11 +167,8 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid,* safely update this here. */ valid =0 ; - new_pmd &= ~_PAGE_HPTEFLAGS; hpte_slot_array[index] =0 ; - }else -/* clear the busy bits and set the hash pte bits */ - new_pmd = (new_pmd & ~_PAGE_HPTEFLAGS) | _PAGE_HASHPTE; + } }if (!valid) {
@@ -119,11 +176,7 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid,/* insert new entry */ pa =pmd_pfn (__pmd (old_pmd)) <<PAGE_SHIFT ; -repeat: - hpte_group = ((hash & htab_hash_mask) *HPTES_PER_GROUP ) & ~0x7UL ; - -/* clear the busy bits and set the hash pte bits */ - new_pmd = (new_pmd & ~_PAGE_HPTEFLAGS) | _PAGE_HASHPTE; + new_pmd |= _PAGE_HASHPTE;/* Add in WIMG bits */ rflags |= (new_pmd & (_PAGE_WRITETHRU | _PAGE_NO_CACHE |
@@ -132,6 +185,8 @@ repeat:* enable the memory coherence always */ rflags |=HPTE_R_M ; +repeat: + hpte_group = ((hash & htab_hash_mask) *HPTES_PER_GROUP ) & ~0x7UL ;/* Insert into the hash table, primary slot */ slot = ppc_md.hpte_insert(hpte_group, vpn, pa, rflags, 0,
@@ -172,6 +227,12 @@ repeat:mark_hpte_slot_valid (hpte_slot_array, index, slot); }/* +* Mark the pte with _PAGE_COMBO, if we are trying to hash it with +* base page size 4k. +*/ +if (psize ==MMU_PAGE_4K ) + new_pmd |= _PAGE_COMBO; +/* * The hpte valid is stored in the pgtable whose address is in the * second half of the PMD. Order this against clearing of the busy bit in * huge pmd.
Signature · 1 line
1.9.1
PATCH 4/8 powerpc: thp: Handle combo pages in invalidate
In reply to Aneesh Kumar K.VIf we changed base page size of the segment, either via sub_page_protect or via remap_4k_pfn, we do a demote_segment which doesn't flush the hash table entries. We do a lazy hash page table flush for all mapped pages in the demoted segment. This happens when we handle hash page fault for these pages.
We use _PAGE_COMBO bit along with _PAGE_HASHPTE to indicate whether a pte is backed by 4K hash pte. If we find _PAGE_COMBO not set on the pte, that implies that we could possibly have older 64K hash pte entries in the hash page table and we need to invalidate those entries.
Use _PAGE_COMBO to determine the page size with which we should invalidate the hash table entries on unmap.
--- arch/powerpc/include/asm/pgtable-ppc64.h | 2 +- arch/powerpc/mm/pgtable_64.c | 14 +++++++++++--- arch/powerpc/mm/tlb_hash64.c | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-)
arch/powerpc/include/asm/pgtable-ppc64.h +1 -1
@@ -413,7 +413,7 @@ static inline char *get_hpte_slot_array(pmd_t *pmdp) }extern void hpte_do_hugepage_flush (struct mm_struct *mm,unsigned long addr, -pmd_t *pmdp); +pmd_t *pmdp,unsigned long old_pmd);#ifdef CONFIG_TRANSPARENT_HUGEPAGE extern pmd_t pfn_pmd (unsigned long pfn,pgprot_t pgprot);extern pmd_t mk_pmd (struct page *page,pgprot_t pgprot);
arch/powerpc/mm/pgtable_64.c +11 -3
@@ -538,7 +538,7 @@ unsigned long pmd_hugepage_update(struct mm_struct *mm, unsigned long addr, *pmdp =__pmd ((old & ~clr) | set);#endif if (old & _PAGE_HASHPTE) -hpte_do_hugepage_flush (mm, addr, pmdp); +hpte_do_hugepage_flush (mm, addr, pmdp, old);return old; }
@@ -645,7 +645,7 @@ void pmdp_splitting_flush(struct vm_area_struct *vma,if (!(old & _PAGE_SPLITTING)) {/* We need to flush the hpte */ if (old & _PAGE_HASHPTE) -hpte_do_hugepage_flush (vma->vm_mm, address, pmdp); +hpte_do_hugepage_flush (vma->vm_mm, address, pmdp, old); }/* * This ensures that generic code that rely on IRQ disabling
@@ -723,7 +723,7 @@ void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,* neesd to be flushed. */ void hpte_do_hugepage_flush (struct mm_struct *mm,unsigned long addr, -pmd_t *pmdp) +pmd_t *pmdp,unsigned long old_pmd) {int ssize, i;unsigned long s_addr;
@@ -746,7 +746,15 @@ void hpte_do_hugepage_flush(struct mm_struct *mm, unsigned long addr,return ;/* get the base page size,vsid and segment size */ +#ifdef CONFIG_DEBUG_VM psize =get_slice_psize (mm, s_addr); +BUG_ON (psize ==MMU_PAGE_16M ); +#endif +if (old_pmd & _PAGE_COMBO) + psize =MMU_PAGE_4K ; +else + psize =MMU_PAGE_64K ; +if (!is_kernel_addr (s_addr)) { ssize =user_segment_size (s_addr); vsid =get_vsid (mm->context.id, s_addr, ssize);
arch/powerpc/mm/tlb_hash64.c +1 -1
@@ -216,7 +216,7 @@ void __flush_hash_table_range(struct mm_struct *mm, unsigned long start,if (!(pte & _PAGE_HASHPTE))continue ;if (unlikely (hugepage_shift &&pmd_trans_huge (*(pmd_t *)pte))) -hpte_do_hugepage_flush (mm, start, (pmd_t *)pte); +hpte_do_hugepage_flush (mm, start, (pmd_t *)ptep, pte);else hpte_need_flush (mm, start, ptep, pte,0 ); }
Signature · 1 line
1.9.1
PATCH 5/8 powerpc: thp: inalidate with vpn in loop
In reply to Aneesh Kumar K.VAs per ISA, for 4k base page size we compare 14..65 bits of VA specified with the entry_VA in tlb. That implies we need to make sure we do a tlbie with all the possible 4k va we used to access the 16MB hugepage. With 64k base page size we compare 14..57 bits of VA. Hence we cannot ignore the lower 24 bits of va while tlbie .We also cannot tlb invalidate a 16MB entry with just one tlbie instruction because we don't track which va was used to instantiate the tlb entry.
--- arch/powerpc/mm/hash_native_64.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-)
arch/powerpc/mm/hash_native_64.c +7 -16
@@ -417,7 +417,7 @@ static void native_hugepage_invalidate(unsigned long vsid,unsigned char *hpte_slot_array, int psize, int ssize) { - int i, lock_tlbie; + int i;struct hash_pte *hptep;int actual_psize =MMU_PAGE_16M ;unsigned int max_hpte_count, valid;
@@ -456,22 +456,13 @@ static void native_hugepage_invalidate(unsigned long vsid,else /* Invalidate the hpte. NOTE: this also unlocks it */ hptep->v =0 ; +/* +* We need to do tlb invalidate for all the address, tlbie +* instruction compares entry_VA in tlb with the VA specified +* here +*/ +tlbie (vpn, psize, actual_psize, ssize,0 ); } -/* -* Since this is a hugepage, we just need a single tlbie. -* use the last vpn. -*/ - lock_tlbie = !mmu_has_feature (MMU_FTR_LOCKLESS_TLBIE ); -if (lock_tlbie) -raw_spin_lock (&native_tlbie_lock); - - asmvolatile ("ptesync" :::"memory" ); -__tlbie (vpn, psize, actual_psize, ssize); - asmvolatile ("eieio; tlbsync; ptesync" :::"memory" ); - -if (lock_tlbie) -raw_spin_unlock (&native_tlbie_lock); -local_irq_restore (flags); }
Signature · 1 line
1.9.1
PATCH 6/8 powerpc: thp: use ACCESS_ONCE when loading pmdp
In reply to Aneesh Kumar K.VWe would get wrong results in compiler recomputed old_pmd. Avoid that by using ACCESS_ONCE
--- arch/powerpc/mm/hugepage-hash64.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/powerpc/mm/hugepage-hash64.c +3 -1
@@ -84,7 +84,9 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid,* atomically mark the linux large page PMD busy and dirty */ do { - old_pmd = pmd_val(*pmdp); + pmd_t pmd = ACCESS_ONCE(*pmdp); + + old_pmd = pmd_val(pmd); /* If PMD busy, retry the access */ if (unlikely(old_pmd & _PAGE_BUSY)) return 0;
Signature · 1 line
1.9.1
PATCH 7/8 powerpc: mm: Use read barrier when creating real_pte
In reply to Aneesh Kumar K.VOn ppc64 we support 4K hash pte with 64K page size. That requires us to track the hash pte slot information on a per 4k basis. We do that by storing the slot details in the second half of pte page. The pte bit _PAGE_COMBO is used to indicate whether the second half need to be looked while building real_pte. We need to use read memory barrier while doing that so that load of hidx is not reordered w.r.t _PAGE_COMBO check. On the store side we already do a lwsync in __hash_page_4K
--- arch/powerpc/include/asm/pte-hash64-64k.h | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-)
arch/powerpc/include/asm/pte-hash64-64k.h +26 -5
@@ -46,11 +46,32 @@* in order to deal with 64K made of 4K HW pages. Thus we override the * generic accessors and iterators here */ -#define __real_pte (e,p) ((real_pte_t) { \ - (e), (pte_val(e) & _PAGE_COMBO) ? \ - (pte_val(*((p) + PTRS_PER_PTE))) : 0 }) -#define __rpte_to_hidx (r,index) ((pte_val((r).pte) & _PAGE_COMBO) ? \ - (((r).hidx >> ((index)<<2)) & 0xf) : ((pte_val((r).pte) >> 12) & 0xf)) +#define __real_pte __real_pte +static inline real_pte_t __real_pte (pte_t pte,pte_t *ptep) +{ +real_pte_t rpte; + + rpte.pte = pte; + rpte.hidx =0 ; +if (pte_val (pte) & _PAGE_COMBO) { +/* +* Make sure we order the hidx load against the _PAGE_COMBO +* check. The store side ordering is done in __hash_page_4K +*/ +smp_rmb (); + rpte.hidx =pte_val (*((ptep) +PTRS_PER_PTE )); + } +return rpte; +} + +static inline unsigned long __rpte_to_hidx (real_pte_t rpte,unsigned long index) +{ +if ((pte_val (rpte.pte) & _PAGE_COMBO)) +return (rpte.hidx >> (index<<2 )) &0xf ; +else +return (pte_val (rpte.pte) >>12 ) &0xf ; +} +#define __rpte_to_pte (r) ((r).pte)#define __rpte_sub_valid (rpte, index) \ (pte_val(rpte.pte) & (_PAGE_HPTE_SUB0 >> (index)))
Signature · 1 line
1.9.1
PATCH 8/8 powerpc: thp: Add tracepoints to track hugepage invalidate
In reply to Aneesh Kumar K.VAdd tracepoint to track hugepage invalidate. This help us in debugging difficult to track bugs.
--- arch/powerpc/mm/pgtable_64.c | 6 +++ arch/powerpc/mm/tlb_hash64.c | 4 ++ include/trace/events/thp.h | 88 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 include/trace/events/thp.h
arch/powerpc/mm/pgtable_64.c +6 -0
@@ -54,6 +54,9 @@#include "mmu_decl.h" +#define CREATE_TRACE_POINTS +#include <trace/events/thp.h> +/* Some sanity checking */ #if TASK_SIZE_USER64 >PGTABLE_RANGE #error TASK_SIZE_USER64 exceeds pagetable range
@@ -537,6 +540,7 @@ unsigned long pmd_hugepage_update(struct mm_struct *mm, unsigned long addr, old =pmd_val (*pmdp); *pmdp =__pmd ((old & ~clr) | set);#endif +trace_hugepage_update (addr, old, clr, set);if (old & _PAGE_HASHPTE)hpte_do_hugepage_flush (mm, addr, pmdp, old);return old;
@@ -642,6 +646,7 @@ void pmdp_splitting_flush(struct vm_area_struct *vma,* If we didn't had the splitting flag set, go and flush the * HPTE entries. */ +trace_hugepage_splitting (address, old);if (!(old & _PAGE_SPLITTING)) {/* We need to flush the hpte */ if (old & _PAGE_HASHPTE)
@@ -709,6 +714,7 @@ void set_pmd_at(struct mm_struct *mm, unsigned long addr,assert_spin_locked (&mm->page_table_lock);WARN_ON (!pmd_trans_huge (pmd));#endif +trace_hugepage_set_pmd (addr, pmd);return set_pte_at (mm, addr,pmdp_ptep (pmdp),pmd_pte (pmd)); }
arch/powerpc/mm/tlb_hash64.c +4 -0
@@ -30,6 +30,8 @@#include <asm/tlb.h> #include <asm/bug.h> +#include <trace/events/thp.h> + DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch);/*
@@ -213,6 +215,8 @@ void __flush_hash_table_range(struct mm_struct *mm, unsigned long start,if (ptep ==NULL )continue ; pte =pte_val (*ptep); +if (hugepage_shift) +trace_hugepage_invalidate (start,pte_val (pte));if (!(pte & _PAGE_HASHPTE))continue ;if (unlikely (hugepage_shift &&pmd_trans_huge (*(pmd_t *)pte)))
include/trace/events/thp.h new file +88 -0
88 lines not on this page · raw message
Signature · 1 line
1.9.1