Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: mmu_gather rework

Fix up the sh mmu_gather code to conform to the new API.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: David Miller <davem@davemloft.net>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Tony Luck <tony.luck@intel.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Nick Piggin <npiggin@kernel.dk>
Cc: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Peter Zijlstra and committed by
Linus Torvalds
1e56a564 9e14f674

+17 -11
+17 -11
arch/sh/include/asm/tlb.h
··· 23 23 unsigned long start, end; 24 24 }; 25 25 26 - DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); 27 - 28 26 static inline void init_tlb_gather(struct mmu_gather *tlb) 29 27 { 30 28 tlb->start = TASK_SIZE; ··· 34 36 } 35 37 } 36 38 37 - static inline struct mmu_gather * 38 - tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) 39 + static inline void 40 + tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned int full_mm_flush) 39 41 { 40 - struct mmu_gather *tlb = &get_cpu_var(mmu_gathers); 41 - 42 42 tlb->mm = mm; 43 43 tlb->fullmm = full_mm_flush; 44 44 45 45 init_tlb_gather(tlb); 46 - 47 - return tlb; 48 46 } 49 47 50 48 static inline void ··· 51 57 52 58 /* keep the page table cache within bounds */ 53 59 check_pgt_cache(); 54 - 55 - put_cpu_var(mmu_gathers); 56 60 } 57 61 58 62 static inline void ··· 83 91 } 84 92 } 85 93 86 - #define tlb_remove_page(tlb,page) free_page_and_swap_cache(page) 94 + static inline void tlb_flush_mmu(struct mmu_gather *tlb) 95 + { 96 + } 97 + 98 + static inline int __tlb_remove_page(struct mmu_gather *tlb, struct page *page) 99 + { 100 + free_page_and_swap_cache(page); 101 + return 1; /* avoid calling tlb_flush_mmu */ 102 + } 103 + 104 + static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) 105 + { 106 + __tlb_remove_page(tlb, page); 107 + } 108 + 87 109 #define pte_free_tlb(tlb, ptep, addr) pte_free((tlb)->mm, ptep) 88 110 #define pmd_free_tlb(tlb, pmdp, addr) pmd_free((tlb)->mm, pmdp) 89 111 #define pud_free_tlb(tlb, pudp, addr) pud_free((tlb)->mm, pudp)