lkml.org 
[lkml]   [2019]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 15/17] alpha/tlb: Fix __p*_free_tlb()
    Just like regular pages, page directories need to observe the
    following order:

    1) unhook
    2) TLB invalidate
    3) free

    to ensure it is safe against concurrent accesses.

    Since Alpha has page based PMDs, no software walkers and IPI based TLB
    invalidation, it can use the simple tlb_remove_page() based freeer.

    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    ---
    arch/alpha/include/asm/tlb.h | 13 +++++++++++--
    1 file changed, 11 insertions(+), 2 deletions(-)

    --- a/arch/alpha/include/asm/tlb.h
    +++ b/arch/alpha/include/asm/tlb.h
    @@ -4,7 +4,16 @@

    #include <asm-generic/tlb.h>

    -#define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, pte)
    -#define __pmd_free_tlb(tlb, pmd, address) pmd_free((tlb)->mm, pmd)
    +extern void ___pte_free_tlb(struct mmu_gather *tlb, pte_t *pte);
    +extern void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd);
    +
    +#define __pte_free_tlb(tlb, pte, address) \
    +do { \
    + pgtable_pte_page_dtor(pte); \
    + tlb_remove_table((tlb), (pte)); \
    +} while (0)
    +
    +#define __pmd_free_tlb(tlb, pmd, address) \
    + tlb_remove_table((tlb), virt_to_page(pmd))

    #endif

    \
     
     \ /
      Last update: 2019-12-11 13:32    [W:3.452 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site